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

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

Issue 1010883002: Switch full-codegen from StackHandlers to handler table. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-isolate-dead-code
Patch Set: Fix debugger-pause-on-promise-rejection. Created 5 years, 9 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/ast-graph-builder.cc ('k') | src/debug.cc » ('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 7e5da3c19330b75bd358930aa821303c625ceebe..47dce3105cf708fd2778c0f9585446c98ac31637 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -134,12 +134,13 @@ Handle<Code> CodeGenerator::GenerateCode() {
// Emit exception handler table.
if (!handlers_.empty()) {
- Handle<FixedArray> table = isolate()->factory()->NewFixedArray(
- static_cast<int>(handlers_.size()) * 2, TENURED);
+ Handle<HandlerTable> table =
+ Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray(
+ HandlerTable::LengthForReturn(static_cast<int>(handlers_.size())),
+ TENURED));
for (size_t i = 0; i < handlers_.size(); ++i) {
- int table_index = static_cast<int>(i * 2);
- table->set(table_index + 0, Smi::FromInt(handlers_[i].pc_offset));
- table->set(table_index + 1, Smi::FromInt(handlers_[i].handler->pos()));
+ table->SetReturnOffset(static_cast<int>(i), handlers_[i].pc_offset);
+ table->SetReturnHandler(static_cast<int>(i), handlers_[i].handler->pos());
}
result->set_handler_table(*table);
}
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698