Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 9ef9160582a27150fa1cda359dc9adc60a9e8c69..dc4727c175438722f0ac18223780dfe93ffaef91 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -2952,7 +2952,12 @@ void BytecodeGenerator::BuildNewLocalActivationContext() { |
.CallRuntime(Runtime::kPushModuleContext, args); |
} else { |
int slot_count = scope->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
- builder()->CreateFunctionContext(slot_count); |
+ if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
+ builder()->CreateFunctionContext(slot_count); |
+ } else { |
+ builder()->CallRuntime(Runtime::kNewFunctionContext, |
+ Register::function_closure()); |
+ } |
} |
} |