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

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

Issue 2026313002: Emit unwinding information for TurboFan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame
Patch Set: MarkFrameConstructed inside has_frame branch on ARM. 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
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/unwinding-info-writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 6b3b6b657561969c4cb27c06416780206c558525..9bce7fed2e10320d875d444ced976239fb4e05e3 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -37,6 +37,7 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
: frame_access_state_(nullptr),
linkage_(linkage),
code_(code),
+ unwinding_info_writer_(zone()),
info_(info),
labels_(zone()->NewArray<Label>(code->InstructionBlockCount())),
current_block_(RpoNumber::Invalid()),
@@ -101,6 +102,9 @@ Handle<Code> CodeGenerator::GenerateCode() {
}
}
+ unwinding_info_writer_.SetNumberOfInstructionBlocks(
+ code()->InstructionBlockCount());
+
// Assemble all non-deferred blocks, followed by deferred ones.
for (int deferred = 0; deferred < 2; ++deferred) {
for (const InstructionBlock* block : code()->instruction_blocks()) {
@@ -113,6 +117,7 @@ Handle<Code> CodeGenerator::GenerateCode() {
if (block->IsHandler()) EnsureSpaceForLazyDeopt();
// Bind a label for a block.
current_block_ = block->rpo_number();
+ unwinding_info_writer_.BeginInstructionBlock(masm()->pc_offset(), block);
if (FLAG_code_comments) {
// TODO(titzer): these code comments are a giant memory leak.
Vector<char> buffer = Vector<char>::New(200);
@@ -163,6 +168,7 @@ Handle<Code> CodeGenerator::GenerateCode() {
result = AssembleBlock(block);
}
if (result != kSuccess) return Handle<Code>();
+ unwinding_info_writer_.EndInstructionBlock(block);
}
}
@@ -203,8 +209,10 @@ Handle<Code> CodeGenerator::GenerateCode() {
safepoints()->Emit(masm(), frame()->GetTotalFrameSlotCount());
+ unwinding_info_writer_.Finish(masm()->pc_offset());
+
Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue(
- masm(), nullptr, info, Handle<Object>());
+ masm(), unwinding_info_writer_.eh_frame_writer(), info, Handle<Object>());
result->set_is_turbofanned(true);
result->set_stack_slots(frame()->GetTotalFrameSlotCount());
result->set_safepoint_table_offset(safepoints()->GetCodeOffset());
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/compiler/unwinding-info-writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698