Due to performance regression.
BUG=
R=jkummerow@chromium.org
Review URL: https://codereview.chromium.org/
189843006
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19709
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
void HConstant::Initialize(Representation r) {
if (r.IsNone()) {
- if (has_smi_value_) {
- r = Representation::FromType(Type::Smi());
+ if (has_smi_value_ && SmiValuesAre31Bits()) {
+ r = Representation::Smi();
} else if (has_int32_value_) {
r = Representation::Integer32();
} else if (has_double_value_) {
// The input to the count operation is on top of the expression stack.
Representation rep = Representation::FromType(expr->type());
if (rep.IsNone() || rep.IsTagged()) {
- rep = Representation::FromType(Type::Smi());
+ rep = Representation::Smi();
}
if (returns_original_input) {
HValue* HGraphBuilder::EnforceNumberType(HValue* number,
Type* expected) {
- return AddUncasted<HForceRepresentation>(
- number, Representation::FromType(expected));
+ if (expected->Is(Type::Smi())) {
+ return AddUncasted<HForceRepresentation>(number, Representation::Smi());
+ }
+ if (expected->Is(Type::Signed32())) {
+ return AddUncasted<HForceRepresentation>(number,
+ Representation::Integer32());
+ }
+ return number;
}
// TODO(rossberg): this does not belong here.
Representation Representation::FromType(Type* type) {
if (type->Is(Type::None())) return Representation::None();
- if (type->Is(Type::Smi())) return SmiValuesAre31Bits()
- ? Representation::Smi() : Representation::Integer32();
+ if (type->Is(Type::Smi())) return Representation::Smi();
if (type->Is(Type::Signed32())) return Representation::Integer32();
if (type->Is(Type::Number())) return Representation::Double();
return Representation::Tagged();
crash();
%OptimizeFunctionOnNextCall(crash);
crash();
-
-function f() {
- var v1 = 0;
- var v2 = -0;
- var t = v2++;
- v2++;
- return Math.max(v2++, v1++);
-}
-
-f();
-f();
-%OptimizeFunctionOnNextCall(f);
-f();