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: |