Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index cea47831fdbbceccf1205ec5dc1eb13c81f43dd1..4822ceb4aea69adef6e543141666245f09e53d56 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1936,7 +1936,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
if (to.IsTagged()) { |
HValue* val = instr->value(); |
LOperand* value = UseRegister(val); |
- if (val->HasRange() && val->range()->IsInSmiRange()) { |
+ if (!instr->CheckFlag(HValue::kCanOverflow)) { |
return DefineSameAsFirst(new(zone()) LSmiTag(value)); |
} else if (val->CheckFlag(HInstruction::kUint32)) { |
LOperand* temp1 = TempRegister(); |
@@ -1952,13 +1952,11 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
} else if (to.IsSmi()) { |
HValue* val = instr->value(); |
LOperand* value = UseRegister(val); |
- LInstruction* result = val->CheckFlag(HInstruction::kUint32) |
- ? DefineSameAsFirst(new(zone()) LUint32ToSmi(value)) |
- : DefineSameAsFirst(new(zone()) LInteger32ToSmi(value)); |
- if (val->HasRange() && val->range()->IsInSmiRange()) { |
- return result; |
+ LInstruction* result = DefineSameAsFirst(new(zone()) LSmiTag(value)); |
+ if (instr->CheckFlag(HValue::kCanOverflow)) { |
+ result = AssignEnvironment(result); |
} |
- return AssignEnvironment(result); |
+ return result; |
} else { |
ASSERT(to.IsDouble()); |
if (instr->value()->CheckFlag(HInstruction::kUint32)) { |