Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index b813b295cd14b1d2b36ac00f47f0a8b5b5480ada..ac59440c8d02988d1e407b68717a03c71add6f02 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -551,8 +551,16 @@ void JSGenericLowering::LowerJSCallFunction(Node* node) { |
void JSGenericLowering::LowerJSCallFunctionWithSpread(Node* node) { |
CallFunctionWithSpreadParameters const& p = |
CallFunctionWithSpreadParametersOf(node->op()); |
- ReplaceWithRuntimeCall(node, Runtime::kCallWithSpread, |
- static_cast<int>(p.arity())); |
+ int const arg_count = static_cast<int>(p.arity() - 2); |
+ Callable callable = CodeFactory::CallWithSpread(isolate()); |
+ CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
+ isolate(), zone(), callable.descriptor(), arg_count + 1, flags); |
+ Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
+ Node* stub_arity = jsgraph()->Int32Constant(arg_count); |
+ node->InsertInput(zone(), 0, stub_code); |
+ node->InsertInput(zone(), 2, stub_arity); |
+ NodeProperties::ChangeOp(node, common()->Call(desc)); |
} |
void JSGenericLowering::LowerJSCallRuntime(Node* node) { |