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

Unified Diff: src/interpreter/interpreter.cc

Issue 2571563004: [Turbofan] Implement super calls with spread bytecode in assembly code. (Closed)
Patch Set: MIPS64 port 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 bfec149a37703e5d6756f83d2a2e5ae5a44aad42..130d05dfa83b873728d2d5584bff535d492af094 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -2176,22 +2176,22 @@ void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) {
__ Dispatch();
}
-// NewWithSpread <first_arg> <arg_count>
+// NewWithSpread <constructor> <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.
+// Call the constructor in |constructor| with the first argument in register
+// |first_arg| and |arg_count| arguments in subsequent registers. The final
+// argument is always a spread. The new.target is in the accumulator.
//
void Interpreter::DoNewWithSpread(InterpreterAssembler* assembler) {
- Node* first_arg_reg = __ BytecodeOperandReg(0);
+ Node* new_target = __ GetAccumulator();
+ Node* constructor_reg = __ BytecodeOperandReg(0);
+ Node* constructor = __ LoadRegister(constructor_reg);
+ Node* first_arg_reg = __ BytecodeOperandReg(1);
Node* first_arg = __ RegisterLocation(first_arg_reg);
- Node* args_count = __ BytecodeOperandCount(1);
+ Node* args_count = __ BytecodeOperandCount(2);
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);
+ Node* result = __ CallConstructWithSpread(constructor, context, new_target,
+ first_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