Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 12a5d29d21770df1c39b691df66c3654c3f27946..be05090f05e807fa3fdf04e88c1f2e87f4b8a7fd 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1335,6 +1335,21 @@ void BytecodeGraphBuilder::VisitCallRuntimeForPair() { |
Environment::kAttachFrameState); |
} |
+Node* BytecodeGraphBuilder::ProcessCallNewWithSpreadArguments( |
+ const Operator* op, interpreter::Register first_arg, size_t arity) { |
+ Node** all = local_zone()->NewArray<Node*>(arity); |
+ all[0] = environment()->LookupRegister(first_arg); |
+ int first_arg_index = first_arg.index(); |
+ for (int i = 1; i < static_cast<int>(arity) - 1; ++i) { |
+ all[i] = environment()->LookupRegister( |
+ interpreter::Register(first_arg_index + i + 1)); |
+ } |
+ all[arity - 1] = |
+ environment()->LookupRegister(interpreter::Register(first_arg_index + 1)); |
+ Node* value = MakeNode(op, static_cast<int>(arity), all, false); |
+ return value; |
+} |
+ |
void BytecodeGraphBuilder::VisitNewWithSpread() { |
PrepareEagerCheckpoint(); |
interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(0); |
@@ -1342,7 +1357,7 @@ void BytecodeGraphBuilder::VisitNewWithSpread() { |
const Operator* op = |
javascript()->CallConstructWithSpread(static_cast<int>(arg_count)); |
- Node* value = ProcessCallRuntimeArguments(op, first_arg, arg_count); |
+ Node* value = ProcessCallNewWithSpreadArguments(op, first_arg, arg_count); |
environment()->BindAccumulator(value, Environment::kAttachFrameState); |
} |