Index: src/crankshaft/s390/lithium-codegen-s390.cc |
diff --git a/src/crankshaft/s390/lithium-codegen-s390.cc b/src/crankshaft/s390/lithium-codegen-s390.cc |
index 81217fa87b32ad95b24d2b66832c507a91898232..e5706e9b5102458342c56661d2e3eee7a1856130 100644 |
--- a/src/crankshaft/s390/lithium-codegen-s390.cc |
+++ b/src/crankshaft/s390/lithium-codegen-s390.cc |
@@ -4664,13 +4664,10 @@ void LCodeGen::DoDeferredNumberTagIU(LInstruction* instr, LOperand* value, |
// 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. |
- __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Reset the context register. |
+ if (!dst.is(cp)) { |
+ __ LoadImmP(cp, Operand::Zero()); |
+ } |
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
RecordSafepointWithRegisters(instr->pointer_map(), 0, |
Safepoint::kNoLazyDeopt); |
@@ -4720,12 +4717,10 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
__ LoadImmP(reg, Operand::Zero()); |
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. |
- __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Reset the context register. |
+ if (!reg.is(cp)) { |
+ __ LoadImmP(cp, Operand::Zero()); |
+ } |
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
RecordSafepointWithRegisters(instr->pointer_map(), 0, |
Safepoint::kNoLazyDeopt); |