Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index 2ff370b1c1972cb0cc1b57f6de5b4016d0ea1806..731a45ed7c961d734b22294723bf0a8210464110 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -589,6 +589,23 @@ void JSGenericLowering::LowerJSConstruct(Node* node) { |
NodeProperties::ChangeOp(node, common()->Call(desc)); |
} |
+void JSGenericLowering::LowerJSConstructWithArrayLike(Node* node) { |
+ Callable callable = |
+ Builtins::CallableFor(isolate(), Builtins::kConstructWithArrayLike); |
+ CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
+ isolate(), zone(), callable.descriptor(), 1, flags); |
+ Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
+ Node* receiver = jsgraph()->UndefinedConstant(); |
+ Node* arguments_list = node->InputAt(1); |
+ Node* new_target = node->InputAt(2); |
+ node->InsertInput(zone(), 0, stub_code); |
+ node->ReplaceInput(2, new_target); |
+ node->ReplaceInput(3, arguments_list); |
+ node->InsertInput(zone(), 4, receiver); |
+ NodeProperties::ChangeOp(node, common()->Call(desc)); |
+} |
+ |
void JSGenericLowering::LowerJSConstructWithSpread(Node* node) { |
SpreadWithArityParameter const& p = SpreadWithArityParameterOf(node->op()); |
int const arg_count = static_cast<int>(p.arity() - 2); |