| Index: src/compiler/js-generic-lowering.cc
|
| diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
|
| index 7af86889bf946a9a6e8c6a29f367d81b0cf63848..7b75f0f4916360d3d8a023ba5edf379610e64419 100644
|
| --- a/src/compiler/js-generic-lowering.cc
|
| +++ b/src/compiler/js-generic-lowering.cc
|
| @@ -520,6 +520,7 @@ void JSGenericLowering::LowerJSCreateScriptContext(Node* node) {
|
|
|
|
|
| void JSGenericLowering::LowerJSCallConstruct(Node* node) {
|
| + // TODO(bmeurer): Use the Construct builtin here.
|
| int arity = OpParameter<int>(node);
|
| CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL);
|
| CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
|
| @@ -540,18 +541,19 @@ void JSGenericLowering::LowerJSCallConstruct(Node* node) {
|
|
|
|
|
| void JSGenericLowering::LowerJSCallFunction(Node* node) {
|
| - const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
|
| - int arg_count = static_cast<int>(p.arity() - 2);
|
| - CallFunctionStub stub(isolate(), arg_count, p.flags());
|
| - CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
|
| + CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
|
| + int const arg_count = static_cast<int>(p.arity() - 2);
|
| + Callable callable = CodeFactory::Call(isolate());
|
| CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
|
| - if (p.AllowTailCalls()) {
|
| + if (p.tail_call_mode() == TailCallMode::kAllow) {
|
| flags |= CallDescriptor::kSupportsTailCalls;
|
| }
|
| CallDescriptor* desc = Linkage::GetStubCallDescriptor(
|
| - isolate(), zone(), d, static_cast<int>(p.arity() - 1), flags);
|
| - Node* stub_code = jsgraph()->HeapConstant(stub.GetCode());
|
| + 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));
|
| }
|
|
|
|
|