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

Unified Diff: src/interpreter/bytecode-generator.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/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index e9c4e7c958d5a1a03aceb5a7ba19095baa9f1596..05b7010ce70fb7a7aba66d7f490eb93fb5e54014 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2582,30 +2582,20 @@ void BytecodeGenerator::VisitCallSuper(Call* expr) {
builder()->GetSuperConstructor(constructor);
ZoneList<Expression*>* args = expr->arguments();
+ RegisterList args_regs = register_allocator()->NewGrowableRegisterList();
+ VisitArguments(args, &args_regs);
+ // The new target is loaded into the accumulator from the
+ // {new.target} variable.
+ VisitForAccumulatorValue(super->new_target_var());
+ builder()->SetExpressionPosition(expr);
// When a super call contains a spread, a CallSuper AST node is only created
// if there is exactly one spread, and it is the last argument.
if (!args->is_empty() && args->last()->IsSpread()) {
- RegisterList args_regs = register_allocator()->NewGrowableRegisterList();
- Register constructor_arg =
- register_allocator()->GrowRegisterList(&args_regs);
- builder()->MoveRegister(constructor, constructor_arg);
- // Reserve argument reg for new.target in correct place for runtime call.
- // TODO(petermarshall): Remove this when changing bytecode to use the new
- // stub.
- Register new_target = register_allocator()->GrowRegisterList(&args_regs);
- VisitArguments(args, &args_regs);
- VisitForRegisterValue(super->new_target_var(), new_target);
- builder()->NewWithSpread(args_regs);
+ // TODO(petermarshall): Collect type on the feedback slot.
+ builder()->NewWithSpread(constructor, args_regs);
} else {
- RegisterList args_regs = register_allocator()->NewGrowableRegisterList();
- VisitArguments(args, &args_regs);
- // The new target is loaded into the accumulator from the
- // {new.target} variable.
- VisitForAccumulatorValue(super->new_target_var());
-
// Call construct.
- builder()->SetExpressionPosition(expr);
// TODO(turbofan): For now we do gather feedback on super constructor
// calls, utilizing the existing machinery to inline the actual call
// target and the JSCreate for the implicit receiver allocation. This
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698