Index: src/arm/lithium-arm.cc |
=================================================================== |
--- src/arm/lithium-arm.cc (revision 7157) |
+++ src/arm/lithium-arm.cc (working copy) |
@@ -1599,12 +1599,15 @@ |
LOperand* value = UseRegister(instr->value()); |
bool needs_check = !instr->value()->type().IsSmi(); |
LInstruction* res = NULL; |
- if (needs_check) { |
- res = DefineSameAsFirst(new LTaggedToI(value, FixedTemp(d1))); |
+ if (!needs_check) { |
+ res = DefineSameAsFirst(new LSmiUntag(value, needs_check)); |
} else { |
- res = DefineSameAsFirst(new LSmiUntag(value, needs_check)); |
- } |
- if (needs_check) { |
+ LOperand* temp1 = TempRegister(); |
+ LOperand* temp2 = instr->CanTruncateToInt32() ? TempRegister() |
+ : NULL; |
+ LOperand* temp3 = instr->CanTruncateToInt32() ? FixedTemp(d3) |
+ : NULL; |
+ res = DefineSameAsFirst(new LTaggedToI(value, temp1, temp2, temp3)); |
res = AssignEnvironment(res); |
} |
return res; |
@@ -1624,7 +1627,10 @@ |
} else { |
ASSERT(to.IsInteger32()); |
LOperand* value = UseRegister(instr->value()); |
- LDoubleToI* res = new LDoubleToI(value, TempRegister()); |
+ LDoubleToI* res = |
+ new LDoubleToI(value, |
+ TempRegister(), |
+ instr->CanTruncateToInt32() ? TempRegister() : NULL); |
return AssignEnvironment(DefineAsRegister(res)); |
} |
} else if (from.IsInteger32()) { |