Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 3cb06320ec4ccb93c3693c5f5e49d5936e9bf48b..5b123f69b9b499b4a7d00f2a8c91a9ac5b86bf6f 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -1834,6 +1834,26 @@ void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) { |
__ Dispatch(); |
} |
+// NewWithSpread <first_arg> <arg_count> |
+// |
+// Call the constructor in |first_arg| with the new.target in |first_arg + 1| |
+// for the |arg_count - 2| following arguments. The final argument is always a |
+// spread. |
+// |
+void Interpreter::DoNewWithSpread(InterpreterAssembler* assembler) { |
+ Node* first_arg_reg = __ BytecodeOperandReg(0); |
+ Node* first_arg = __ RegisterLocation(first_arg_reg); |
+ Node* args_count = __ BytecodeOperandCount(1); |
+ Node* context = __ GetContext(); |
+ |
+ // Call into Runtime function NewWithSpread which does everything. |
+ Node* runtime_function = __ Int32Constant(Runtime::kNewWithSpread); |
+ Node* result = |
+ __ CallRuntimeN(runtime_function, context, first_arg, args_count); |
+ __ SetAccumulator(result); |
+ __ Dispatch(); |
+} |
+ |
// New <constructor> <first_arg> <arg_count> |
// |
// Call operator new with |constructor| and the first argument in |