Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2122953002: [crankshaft] do not restore rsi in stub for deferred number conversions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing wrong registers Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/crankshaft/ppc/lithium-codegen-ppc.cc
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc
index 1511caaca21203f7f02e1165c1daddcff581415c..cbbc3cf1cb15a5e3f5c9040b6b0b3d56b356ff4b 100644
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc
@@ -4739,13 +4739,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)) {
+ __ li(cp, Operand::Zero());
+ }
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
RecordSafepointWithRegisters(instr->pointer_map(), 0,
Safepoint::kNoLazyDeopt);
@@ -4797,12 +4794,10 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
__ li(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)) {
+ __ li(cp, Operand::Zero());
+ }
__ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
RecordSafepointWithRegisters(instr->pointer_map(), 0,
Safepoint::kNoLazyDeopt);

Powered by Google App Engine
This is Rietveld 408576698