Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index dd65e2416dcec5b40dc7a71754c5740519a3022f..d1351e71d21825d633e7489f549501b6a841200f 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -351,14 +351,19 @@ void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
- int const slot_count = OpParameter<int>(node->op()); |
+ const CreateFunctionContextParameters& parameters = |
+ CreateFunctionContextParametersOf(node->op()); |
+ int slot_count = parameters.slot_count(); |
+ ScopeType scope_type = parameters.scope_type(); |
CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
- if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
- Callable callable = CodeFactory::FastNewFunctionContext(isolate()); |
+ if (slot_count <= FastNewFunctionContextStub::MaximumSlots()) { |
+ Callable callable = |
+ CodeFactory::FastNewFunctionContext(isolate(), scope_type); |
node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
ReplaceWithStubCall(node, callable, flags); |
} else { |
+ node->InsertInput(zone(), 1, jsgraph()->SmiConstant(scope_type)); |
ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); |
} |
} |