| Index: src/compiler/js-generic-lowering.cc
|
| diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
|
| index 51fb4d6f143a46439ca3109672c2e5f89d71ac06..b0b9747239756316b57b1c30a6ae59fa0fc5e33e 100644
|
| --- a/src/compiler/js-generic-lowering.cc
|
| +++ b/src/compiler/js-generic-lowering.cc
|
| @@ -441,9 +441,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);
|
| + }
|
| }
|
|
|
|
|
|
|