Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: src/compiler/arm/code-generator-arm.cc

Issue 2026313002: Emit unwinding information for TurboFan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame
Patch Set: Clarify assumptions on frame ction/dtion routines in arm/arm64. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d959a5d34d6e188a9da6ba448b779d622b1e11b1..692a1ebc53a2f42a58a00eee294eb369cd4a7909 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,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);
@@ -239,6 +246,10 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
__ CallStub(&stub);
if (must_save_lr_) {
__ Pop(lr);
+ if (unwinding_info_writer_) {
+ unwinding_info_writer_->MarkPopLinkRegisterFromTopOfStack(
+ __ pc_offset());
+ }
}
}
@@ -251,6 +262,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
Register const scratch1_;
RecordWriteMode const mode_;
bool must_save_lr_;
+ UnwindingInfoWriter* const unwinding_info_writer_;
};
@@ -413,6 +425,10 @@ Condition FlagsConditionToCondition(FlagsCondition condition) {
void CodeGenerator::AssembleDeconstructFrame() {
__ LeaveFrame(StackFrame::MANUAL);
+
+ if (!unwinding_info_writer_.is_empty()) {
Jarin 2016/07/06 07:09:42 I am wondering whether you do not want to fold thi
rmcilroy 2016/07/07 09:55:17 +1, I think this would make things clearer in the
+ unwinding_info_writer_->MarkFrameDeconstructed(__ pc_offset());
+ }
}
void CodeGenerator::AssemblePrepareTailCall() {
@@ -600,6 +616,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ Jump(ip);
}
DCHECK_EQ(LeaveCC, i.OutputSBit());
+ if (!unwinding_info_writer_.is_empty()) {
+ unwinding_info_writer_->MarkBlockWillExit();
+ }
frame_access_state()->ClearSPDelta();
frame_access_state()->SetFrameAccessToDefault();
break;
@@ -607,6 +626,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;
@@ -742,14 +764,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_.get());
__ 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_.get());
__ str(value, MemOperand(object, index));
}
__ CheckPageFlag(object, scratch0,
@@ -1600,6 +1624,11 @@ void CodeGenerator::AssembleConstructFrame() {
}
}
+ if (!unwinding_info_writer_.is_empty() &&
+ !info()->GeneratePreagedPrologue()) {
+ unwinding_info_writer_->MarkFrameConstructed(__ pc_offset());
+ }
+
int shrink_slots = frame()->GetSpillSlotCount();
if (info()->is_osr()) {
@@ -1661,6 +1690,10 @@ void CodeGenerator::AssembleReturn() {
DwVfpRegister::from_code(last));
}
+ if (!unwinding_info_writer_.is_empty()) {
+ unwinding_info_writer_->MarkBlockWillExit();
+ }
+
if (descriptor->IsCFunctionCall()) {
AssembleDeconstructFrame();
} else if (frame_access_state()->has_frame()) {

Powered by Google App Engine
This is Rietveld 408576698