| 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 c03dd107a4fa32310a038474db246c1d923ce056..c7832b66523c3e3588fd036d5c76ad33850562a5 100644
|
| --- a/src/crankshaft/mips64/lithium-codegen-mips64.cc
|
| +++ b/src/crankshaft/mips64/lithium-codegen-mips64.cc
|
| @@ -4626,13 +4626,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);
|
| @@ -4685,12 +4682,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);
|
|
|