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 cda9ce1de2213da6ade888220e0a48abf6a0a6ec..1993a4613acde719b31970ff3e199505771ac608 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -303,7 +303,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
public: |
OutOfLineRecordWrite(CodeGenerator* gen, Register object, Operand index, |
Register value, Register scratch0, Register scratch1, |
- RecordWriteMode mode) |
+ RecordWriteMode mode, |
+ UnwindingInfoWriter* unwinding_info_writer) |
: OutOfLineCode(gen), |
object_(object), |
index_(index), |
@@ -311,7 +312,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
scratch0_(scratch0), |
scratch1_(scratch1), |
mode_(mode), |
- must_save_lr_(!gen->frame_access_state()->has_frame()) {} |
+ must_save_lr_(!gen->frame_access_state()->has_frame()), |
+ unwinding_info_writer_(unwinding_info_writer) {} |
void Generate() final { |
if (mode_ > RecordWriteMode::kValueIsPointer) { |
@@ -328,6 +330,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
if (must_save_lr_) { |
// We need to save and restore lr if the frame was elided. |
__ Push(lr); |
+ if (unwinding_info_writer_) { |
+ unwinding_info_writer_->MarkLinkRegisterOnTopOfStack(__ pc_offset()); |
+ } |
} |
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, |
remembered_set_action, save_fp_mode); |
@@ -335,6 +340,10 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
__ CallStub(&stub); |
if (must_save_lr_) { |
__ Pop(lr); |
+ if (unwinding_info_writer_) { |
+ unwinding_info_writer_->MarkPopLinkRegisterFromTopOfStack( |
+ __ pc_offset()); |
+ } |
} |
} |
@@ -346,6 +355,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
Register const scratch1_; |
RecordWriteMode const mode_; |
bool must_save_lr_; |
+ UnwindingInfoWriter* const unwinding_info_writer_; |
}; |
@@ -539,6 +549,10 @@ void CodeGenerator::AssembleDeconstructFrame() { |
__ Mov(jssp, fp); |
} |
__ Pop(fp, lr); |
+ |
+ if (!unwinding_info_writer_.is_empty()) { |
+ unwinding_info_writer_->MarkFrameDeconstructed(__ pc_offset()); |
+ } |
} |
void CodeGenerator::AssemblePrepareTailCall() { |
@@ -654,6 +668,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
__ Add(target, target, Code::kHeaderSize - kHeapObjectTag); |
__ Jump(target); |
} |
+ if (!unwinding_info_writer_.is_empty()) { |
+ unwinding_info_writer_->MarkBlockWillExit(); |
+ } |
frame_access_state()->ClearSPDelta(); |
frame_access_state()->SetFrameAccessToDefault(); |
break; |
@@ -661,6 +678,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
case kArchTailCallAddress: { |
CHECK(!instr->InputAt(0)->IsImmediate()); |
__ Jump(i.InputRegister(0)); |
+ if (!unwinding_info_writer_.is_empty()) { |
+ unwinding_info_writer_->MarkBlockWillExit(); |
+ } |
frame_access_state()->ClearSPDelta(); |
frame_access_state()->SetFrameAccessToDefault(); |
break; |
@@ -805,8 +825,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
Register value = i.InputRegister(2); |
Register scratch0 = i.TempRegister(0); |
Register scratch1 = i.TempRegister(1); |
- auto ool = new (zone()) OutOfLineRecordWrite(this, object, index, value, |
- scratch0, scratch1, mode); |
+ auto ool = new (zone()) |
+ OutOfLineRecordWrite(this, object, index, value, scratch0, scratch1, |
+ mode, unwinding_info_writer_.get()); |
__ Str(value, MemOperand(object, index)); |
__ CheckPageFlagSet(object, scratch0, |
MemoryChunk::kPointersFromHereAreInterestingMask, |
@@ -1793,6 +1814,11 @@ void CodeGenerator::AssembleConstructFrame() { |
frame()->GetTotalFrameSlotCount()); |
} |
} |
+ |
+ if (!unwinding_info_writer_.is_empty() && |
+ !info()->GeneratePreagedPrologue()) { |
+ unwinding_info_writer_->MarkFrameConstructed(__ pc_offset()); |
+ } |
} |
int shrink_slots = frame()->GetSpillSlotCount(); |
@@ -1852,6 +1878,10 @@ void CodeGenerator::AssembleReturn() { |
__ PopCPURegList(saves_fp); |
} |
+ if (!unwinding_info_writer_.is_empty()) { |
+ unwinding_info_writer_->MarkBlockWillExit(); |
+ } |
+ |
int pop_count = static_cast<int>(descriptor->StackParameterCount()); |
if (descriptor->IsCFunctionCall()) { |
AssembleDeconstructFrame(); |