Index: src/crankshaft/x87/lithium-codegen-x87.cc |
diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc |
index 903c1c357a90e80f15747a646290d9d264048eab..05eb10fa7c7e5e4e439ac73dbc672e6be6fa56e0 100644 |
--- a/src/crankshaft/x87/lithium-codegen-x87.cc |
+++ b/src/crankshaft/x87/lithium-codegen-x87.cc |
@@ -4611,13 +4611,10 @@ void LCodeGen::DoDeferredNumberTagIU(LInstruction* instr, |
// Preserve the value of all registers. |
PushSafepointRegistersScope scope(this); |
- |
- // NumberTagI and NumberTagD use the context from the frame, rather than |
- // the environment's HContext or HInlinedContext value. |
- // They only call Runtime::kAllocateHeapNumber. |
- // The corresponding HChange instructions are added in a phase that does |
- // not have easy access to the local context. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ // Reset the context register. |
+ if (!reg.is(esi)) { |
+ __ Move(esi, Immediate(0)); |
+ } |
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
RecordSafepointWithRegisters( |
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
@@ -4672,12 +4669,10 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
__ Move(reg, Immediate(0)); |
PushSafepointRegistersScope scope(this); |
- // NumberTagI and NumberTagD use the context from the frame, rather than |
- // the environment's HContext or HInlinedContext value. |
- // They only call Runtime::kAllocateHeapNumber. |
- // The corresponding HChange instructions are added in a phase that does |
- // not have easy access to the local context. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ // Reset the context register. |
+ if (!reg.is(esi)) { |
+ __ Move(esi, Immediate(0)); |
+ } |
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
RecordSafepointWithRegisters( |
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |