Index: src/compiler/mips/code-generator-mips.cc |
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc |
index 05d53af12b59b8c1579b62dc6bdc16810ff26d51..4c9547b973a1708bc19fadf99f861d0b479e8e64 100644 |
--- a/src/compiler/mips/code-generator-mips.cc |
+++ b/src/compiler/mips/code-generator-mips.cc |
@@ -234,12 +234,17 @@ 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 ra if the frame was elided. |
+ __ Push(ra); |
+ } |
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, |
EMIT_REMEMBERED_SET, save_fp_mode); |
__ Addu(scratch1_, object_, index_); |
__ CallStub(&stub); |
+ if (!frame()->needs_frame()) { |
+ __ Pop(ra); |
+ } |
} |
private: |