Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index ba1abdc63291e15b6b225ad3df51a7465671537f..22c12f25a9e803aa004b033cd7ab9a3e206f943e 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1929,13 +1929,14 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); |
} else { |
ASSERT(to.IsInteger32()); |
- if (instr->value()->type().IsSmi()) { |
- LOperand* value = UseRegister(instr->value()); |
+ HValue* val = instr->value(); |
+ if (val->type().IsSmi() || val->representation().IsSmi()) { |
+ LOperand* value = UseRegister(val); |
return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); |
} else { |
bool truncating = instr->CanTruncateToInt32(); |
if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
- LOperand* value = UseRegister(instr->value()); |
+ LOperand* value = UseRegister(val); |
LOperand* xmm_temp = |
(truncating && CpuFeatures::IsSupported(SSE3)) |
? NULL |
@@ -1943,7 +1944,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); |
return AssignEnvironment(DefineSameAsFirst(res)); |
} else { |
- LOperand* value = UseFixed(instr->value(), ecx); |
+ LOperand* value = UseFixed(val, ecx); |
LTaggedToINoSSE2* res = |
new(zone()) LTaggedToINoSSE2(value, TempRegister(), |
TempRegister(), TempRegister()); |