Index: src/crankshaft/mips64/lithium-codegen-mips64.cc |
diff --git a/src/crankshaft/mips64/lithium-codegen-mips64.cc b/src/crankshaft/mips64/lithium-codegen-mips64.cc |
index e40cb841111c1b8cff63c5ee22e268e9c97fb89b..c10ae34c2ad8a330ff301df807945735b1e620d3 100644 |
--- a/src/crankshaft/mips64/lithium-codegen-mips64.cc |
+++ b/src/crankshaft/mips64/lithium-codegen-mips64.cc |
@@ -4628,13 +4628,10 @@ void LCodeGen::DoDeferredNumberTagIU(LInstruction* instr, |
__ mov(dst, zero_reg); |
// 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. |
- __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Reset the context register. |
+ if (!dst.is(cp)) { |
+ __ mov(cp, zero_reg); |
+ } |
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
RecordSafepointWithRegisters( |
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
@@ -4687,12 +4684,10 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
__ mov(reg, zero_reg); |
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. |
- __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Reset the context register. |
+ if (!reg.is(cp)) { |
+ __ mov(cp, zero_reg); |
+ } |
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
RecordSafepointWithRegisters( |
instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |