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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 2242193002: [Interpreter] Avoid accessing Isolate from during bytecode generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_sourceposition
Patch Set: Rebase Created 4 years, 4 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/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-array-writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 7fd6e23a585c3e9a5b10ccd7f5118e60d1b5d162..be130abdb068218d7ada321a4e06cef731a5dd4d 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -21,17 +21,16 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(
Isolate* isolate, Zone* zone, int parameter_count, int context_count,
int locals_count, FunctionLiteral* literal,
SourcePositionTableBuilder::RecordingMode source_position_mode)
- : isolate_(isolate),
- zone_(zone),
+ : zone_(zone),
bytecode_generated_(false),
- constant_array_builder_(isolate, zone),
- handler_table_builder_(isolate, zone),
+ constant_array_builder_(zone, isolate->factory()->the_hole_value()),
+ handler_table_builder_(zone),
return_seen_in_block_(false),
parameter_count_(parameter_count),
local_register_count_(locals_count),
context_register_count_(context_count),
temporary_allocator_(zone, fixed_register_count()),
- bytecode_array_writer_(isolate, zone, &constant_array_builder_,
+ bytecode_array_writer_(zone, &constant_array_builder_,
source_position_mode),
pipeline_(&bytecode_array_writer_) {
DCHECK_GE(parameter_count_, 0);
@@ -75,14 +74,15 @@ bool BytecodeArrayBuilder::RegisterIsParameterOrLocal(Register reg) const {
return reg.is_parameter() || reg.index() < locals_count();
}
-Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray() {
+Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray(Isolate* isolate) {
DCHECK(return_seen_in_block_);
DCHECK(!bytecode_generated_);
bytecode_generated_ = true;
- Handle<FixedArray> handler_table = handler_table_builder()->ToHandlerTable();
- return pipeline_->ToBytecodeArray(fixed_register_count(), parameter_count(),
- handler_table);
+ Handle<FixedArray> handler_table =
+ handler_table_builder()->ToHandlerTable(isolate);
+ return pipeline_->ToBytecodeArray(isolate, fixed_register_count(),
+ parameter_count(), handler_table);
}
namespace {
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-array-writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698