| Index: src/interpreter/bytecode-generator.cc
|
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
|
| index a6b38ec3a94177899d92e0abdead805609e4568e..ae08617043f7bced602ed2185209251fc2613eb7 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);
|
| }
|
|
|