Index: src/crankshaft/mips/lithium-codegen-mips.cc |
diff --git a/src/crankshaft/mips/lithium-codegen-mips.cc b/src/crankshaft/mips/lithium-codegen-mips.cc |
index 39076d8980fe9398555a7a56c7dd9910279af470..d1df69d7af53e41f4ec0d37c440320a45b420597 100644 |
--- a/src/crankshaft/mips/lithium-codegen-mips.cc |
+++ b/src/crankshaft/mips/lithium-codegen-mips.cc |
@@ -4424,13 +4424,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. |
- __ lw(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); |
@@ -4483,12 +4480,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. |
- __ lw(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); |