Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index ac36cc7913a82db3976569aa182831692be718f0..84638147ea0a0c96783f248e3563af8c54e5e756 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -449,9 +449,13 @@ void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
int const slot_count = OpParameter<int>(node->op()); |
CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
- Callable callable = CodeFactory::FastNewFunctionContext(isolate()); |
- node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
- ReplaceWithStubCall(node, callable, flags); |
+ if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
+ Callable callable = CodeFactory::FastNewFunctionContext(isolate()); |
+ node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
+ ReplaceWithStubCall(node, callable, flags); |
+ } else { |
+ ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); |
+ } |
} |