Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index fc5a4a4fa67c5a470aefee9b7dfe4b2d7600301e..695e9db64ecbed34eec3b68ecead60321acc8fc7 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -505,7 +505,8 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject { |
declarations_.push_back(std::make_pair(slot, nullptr)); |
} |
- Handle<FixedArray> AllocateDeclarationPairs(CompilationInfo* info) { |
+ Handle<FixedArray> AllocateDeclarationPairs(CompilationInfo* info, |
+ ShouldCompile should_compile) { |
DCHECK(has_constant_pool_entry_); |
int array_index = 0; |
Handle<FixedArray> pairs = info->isolate()->factory()->NewFixedArray( |
@@ -517,8 +518,8 @@ class BytecodeGenerator::GlobalDeclarationsBuilder final : public ZoneObject { |
if (func == nullptr) { |
initial_value = info->isolate()->factory()->undefined_value(); |
} else { |
- initial_value = |
- Compiler::GetSharedFunctionInfo(func, info->script(), info); |
+ initial_value = Compiler::GetSharedFunctionInfo(func, info->script(), |
+ info, should_compile); |
} |
// Return a null handle if any initial values can't be created. Caller |
@@ -574,17 +575,19 @@ BytecodeGenerator::BytecodeGenerator(CompilationInfo* info) |
prototype_string_(info->isolate()->factory()->prototype_string()) { |
} |
-Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(Isolate* isolate) { |
- AllocateDeferredConstants(); |
+Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode( |
+ Isolate* isolate, ShouldCompile should_compile) { |
+ AllocateDeferredConstants(should_compile); |
if (HasStackOverflow()) return Handle<BytecodeArray>(); |
return builder()->ToBytecodeArray(isolate); |
} |
-void BytecodeGenerator::AllocateDeferredConstants() { |
+void BytecodeGenerator::AllocateDeferredConstants( |
+ ShouldCompile should_compile) { |
// Build global declaration pair arrays. |
for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) { |
Handle<FixedArray> declarations = |
- globals_builder->AllocateDeclarationPairs(info()); |
+ globals_builder->AllocateDeclarationPairs(info(), should_compile); |
if (declarations.is_null()) return SetStackOverflow(); |
builder()->InsertConstantPoolEntryAt(globals_builder->constant_pool_entry(), |
declarations); |
@@ -593,8 +596,8 @@ void BytecodeGenerator::AllocateDeferredConstants() { |
// Find or build shared function infos. |
for (std::pair<FunctionLiteral*, size_t> literal : function_literals_) { |
FunctionLiteral* expr = literal.first; |
- Handle<SharedFunctionInfo> shared_info = |
- Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); |
+ Handle<SharedFunctionInfo> shared_info = Compiler::GetSharedFunctionInfo( |
+ expr, info()->script(), info(), should_compile); |
if (shared_info.is_null()) return SetStackOverflow(); |
builder()->InsertConstantPoolEntryAt(literal.second, shared_info); |
} |