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

Unified Diff: src/interpreter/interpreter.cc

Issue 2629363002: [Ignition/turbo] Add a CallWithSpread bytecode. (Closed)
Patch Set: refactor OnlyLastArgIsSpread Created 3 years, 11 months 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
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 60c5e595afa004eb8f1e4d1b5f1126492d376cee..5dee728bd2ba360af75b99cbe4a6f57db40f1b71 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -2159,6 +2159,26 @@ void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) {
__ Dispatch();
}
+// CallWithSpread <first_arg> <arg_count>
+//
+// Call a JSfunction or Callable in |first_arg| with the receiver in
+// |first_arg + 1| and |arg_count - 2| arguments in subsequent registers. The
+// final argument is always a spread.
+//
+void Interpreter::DoCallWithSpread(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 CallWithSpread which does everything.
+ Node* runtime_function = __ Int32Constant(Runtime::kCallWithSpread);
+ Node* result =
+ __ CallRuntimeN(runtime_function, context, first_arg, args_count);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
// NewWithSpread <first_arg> <arg_count>
//
// Call the constructor in |first_arg| with the new.target in |first_arg + 1|

Powered by Google App Engine
This is Rietveld 408576698