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

Unified Diff: src/interpreter/interpreter.cc

Issue 2649143002: [Turbofan] Implement call with spread bytecode in assembly code. (Closed)
Patch Set: Rename PushArgsMode to InterpreterPushArgsMode 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
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter-assembler.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 8abc65a3fe3240b77326dfce5f74f22cbf4493c0..26e04c534df6d096627abe4cdba45393a45d326d 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -2176,22 +2176,25 @@ void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) {
__ Dispatch();
}
-// CallWithSpread <first_arg> <arg_count>
+// CallWithSpread <callable> <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
+// Call a JSfunction or Callable in |callable| with the receiver in
+// |first_arg| and |arg_count - 1| 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* callable_reg = __ BytecodeOperandReg(0);
+ Node* callable = __ LoadRegister(callable_reg);
+ Node* receiver_reg = __ BytecodeOperandReg(1);
+ Node* receiver_arg = __ RegisterLocation(receiver_reg);
+ Node* receiver_args_count = __ BytecodeOperandCount(2);
+ Node* receiver_count = __ Int32Constant(1);
+ Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
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);
+ __ CallJSWithSpread(callable, context, receiver_arg, args_count);
__ SetAccumulator(result);
__ Dispatch();
}
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698