Index: src/compiler/arm64/code-generator-arm64.cc |
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc |
index 37d3161dc4870cf71137a2398251e0dce5834e52..8b9f3b624231ba72b12f040035bea2a55fe78d34 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -292,12 +292,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 lr if the frame was elided. |
+ __ Push(lr); |
+ } |
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, |
EMIT_REMEMBERED_SET, save_fp_mode); |
__ Add(scratch1_, object_, index_); |
__ CallStub(&stub); |
+ if (!frame()->needs_frame()) { |
+ __ Pop(lr); |
+ } |
} |
private: |