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

Unified Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 1694263002: [Turbofan] Save and restore lr in OutOfLineRecordWrite when frame is elided. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | test/cctest/cctest.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ppc/code-generator-ppc.cc
diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
index 04c807960080530a897bcd04e00ebeb045af3b8a..076cc25de1f9ed728fd301f1f8aba3cdef13648c 100644
--- a/src/compiler/ppc/code-generator-ppc.cc
+++ b/src/compiler/ppc/code-generator-ppc.cc
@@ -183,12 +183,20 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
}
SaveFPRegsMode const save_fp_mode =
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
- // TODO(turbofan): Once we get frame elision working, we need to save
- // and restore lr properly here if the frame was elided.
+ if (!frame()->needs_frame()) {
+ // We need to save and restore lr if the frame was elided.
+ __ mflr(scratch1_);
+ __ Push(scratch1_);
+ }
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_,
EMIT_REMEMBERED_SET, save_fp_mode);
__ add(scratch1_, object_, offset_);
__ CallStub(&stub);
+ if (!frame()->needs_frame()) {
+ // We need to save and restore lr if the frame was elided.
+ __ Pop(scratch1_);
+ __ mtlr(scratch1_);
+ }
}
private:
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698