Revert "Use Representation::Integer32() for smi types on 32-bit-tagged systems."
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
This commit is contained in:
parent
a1102885e0
commit
8a3d715250
@ -2613,8 +2613,8 @@ HConstant::HConstant(ExternalReference reference)
|
||||
|
||||
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_) {
|
||||
|
@ -8740,7 +8740,7 @@ HInstruction* HOptimizedGraphBuilder::BuildIncrement(
|
||||
// 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) {
|
||||
@ -8990,8 +8990,14 @@ bool CanBeZero(HValue* right) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -568,8 +568,7 @@ typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Convert(
|
||||
// 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();
|
||||
|
@ -21,16 +21,3 @@ crash();
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user