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

Unified Diff: src/compiler/bytecode-graph-builder.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/compiler/bytecode-graph-builder.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index d22746d9ecbfa8378621b4eef81d13f8da7c09cf..f34e843470294d194a115bd4a7500ca7cbf068ae 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1338,14 +1338,34 @@ void BytecodeGraphBuilder::VisitCallRuntimeForPair() {
Environment::kAttachFrameState);
}
+Node* BytecodeGraphBuilder::ProcessCallNewWithSpreadArguments(
+ const Operator* op, Node* callee, Node* new_target,
+ interpreter::Register first_arg, size_t arity) {
+ Node** all = local_zone()->NewArray<Node*>(arity);
+ all[0] = callee;
+ int first_arg_index = first_arg.index();
+ for (int i = 1; i < static_cast<int>(arity) - 1; ++i) {
+ all[i] = environment()->LookupRegister(
+ interpreter::Register(first_arg_index + i - 1));
+ }
+ all[arity - 1] = new_target;
+ Node* value = MakeNode(op, static_cast<int>(arity), all, false);
+ return value;
+}
+
void BytecodeGraphBuilder::VisitNewWithSpread() {
PrepareEagerCheckpoint();
- interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(0);
- size_t arg_count = bytecode_iterator().GetRegisterCountOperand(1);
+ interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0);
+ interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1);
+ size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2);
+
+ Node* new_target = environment()->LookupAccumulator();
+ Node* callee = environment()->LookupRegister(callee_reg);
const Operator* op =
- javascript()->CallConstructWithSpread(static_cast<int>(arg_count));
- Node* value = ProcessCallRuntimeArguments(op, first_arg, arg_count);
+ javascript()->CallConstructWithSpread(static_cast<int>(arg_count) + 2);
+ Node* value = ProcessCallNewWithSpreadArguments(op, callee, new_target,
+ first_arg, arg_count + 2);
environment()->BindAccumulator(value, Environment::kAttachFrameState);
}
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698