Index: src/compiler/arm/code-generator-arm.cc |
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc |
index c9192e44634c301d4fc9ce6754ca647bf42bf994..c94859de45a48ead688305ec4d31efee566c37bf 100644 |
--- a/src/compiler/arm/code-generator-arm.cc |
+++ b/src/compiler/arm/code-generator-arm.cc |
@@ -188,7 +188,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
public: |
OutOfLineRecordWrite(CodeGenerator* gen, Register object, Register index, |
Register value, Register scratch0, Register scratch1, |
- RecordWriteMode mode) |
+ RecordWriteMode mode, |
+ UnwindingInfoWriter* unwinding_info_writer) |
: OutOfLineCode(gen), |
object_(object), |
index_(index), |
@@ -197,11 +198,13 @@ 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) {} |
OutOfLineRecordWrite(CodeGenerator* gen, Register object, int32_t index, |
Register value, Register scratch0, Register scratch1, |
- RecordWriteMode mode) |
+ RecordWriteMode mode, |
+ UnwindingInfoWriter* unwinding_info_writer) |
: OutOfLineCode(gen), |
object_(object), |
index_(no_reg), |
@@ -210,7 +213,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) { |
@@ -227,6 +231,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
if (must_save_lr_) { |
// We need to save and restore lr if the frame was elided. |
__ Push(lr); |
+ unwinding_info_writer_->MarkLinkRegisterOnTopOfStack(__ pc_offset()); |
} |
RecordWriteStub stub(isolate(), object_, scratch0_, scratch1_, |
remembered_set_action, save_fp_mode); |
@@ -239,6 +244,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
__ CallStub(&stub); |
if (must_save_lr_) { |
__ Pop(lr); |
+ unwinding_info_writer_->MarkPopLinkRegisterFromTopOfStack(__ pc_offset()); |
} |
} |
@@ -251,6 +257,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
Register const scratch1_; |
RecordWriteMode const mode_; |
bool must_save_lr_; |
+ UnwindingInfoWriter* const unwinding_info_writer_; |
}; |
@@ -413,6 +420,7 @@ Condition FlagsConditionToCondition(FlagsCondition condition) { |
void CodeGenerator::AssembleDeconstructFrame() { |
__ LeaveFrame(StackFrame::MANUAL); |
+ unwinding_info_writer_.MarkFrameDeconstructed(__ pc_offset()); |
} |
void CodeGenerator::AssemblePrepareTailCall() { |
@@ -600,6 +608,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
__ Jump(ip); |
} |
DCHECK_EQ(LeaveCC, i.OutputSBit()); |
+ unwinding_info_writer_.MarkBlockWillExit(); |
frame_access_state()->ClearSPDelta(); |
frame_access_state()->SetFrameAccessToDefault(); |
break; |
@@ -607,6 +616,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
case kArchTailCallAddress: { |
CHECK(!instr->InputAt(0)->IsImmediate()); |
__ Jump(i.InputRegister(0)); |
+ unwinding_info_writer_.MarkBlockWillExit(); |
frame_access_state()->ClearSPDelta(); |
frame_access_state()->SetFrameAccessToDefault(); |
break; |
@@ -742,14 +752,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
AddressingModeField::decode(instr->opcode()); |
if (addressing_mode == kMode_Offset_RI) { |
int32_t index = i.InputInt32(1); |
- ool = new (zone()) OutOfLineRecordWrite(this, object, index, value, |
- scratch0, scratch1, mode); |
+ ool = new (zone()) |
+ OutOfLineRecordWrite(this, object, index, value, scratch0, scratch1, |
+ mode, &unwinding_info_writer_); |
__ str(value, MemOperand(object, index)); |
} else { |
DCHECK_EQ(kMode_Offset_RR, addressing_mode); |
Register index(i.InputRegister(1)); |
- ool = new (zone()) OutOfLineRecordWrite(this, object, index, value, |
- scratch0, scratch1, mode); |
+ ool = new (zone()) |
+ OutOfLineRecordWrite(this, object, index, value, scratch0, scratch1, |
+ mode, &unwinding_info_writer_); |
__ str(value, MemOperand(object, index)); |
} |
__ CheckPageFlag(object, scratch0, |
@@ -1602,6 +1614,10 @@ void CodeGenerator::AssembleConstructFrame() { |
} else { |
__ StubPrologue(info()->GetOutputStackFrameType()); |
} |
+ |
+ if (!info()->GeneratePreagedPrologue()) { |
+ unwinding_info_writer_.MarkFrameConstructed(__ pc_offset()); |
+ } |
} |
int shrink_slots = frame()->GetSpillSlotCount(); |
@@ -1665,6 +1681,8 @@ void CodeGenerator::AssembleReturn() { |
DwVfpRegister::from_code(last)); |
} |
+ unwinding_info_writer_.MarkBlockWillExit(); |
+ |
if (descriptor->IsCFunctionCall()) { |
AssembleDeconstructFrame(); |
} else if (frame_access_state()->has_frame()) { |