Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: src/interpreter/interpreter.cc

Issue 2541113004: [Ignition/turbo] Add a NewWithSpread bytecode. (Closed)
Patch Set: Add todo Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698