Chromium Code Reviews| Index: src/interpreter/bytecode-generator.cc |
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
| index 7279f69d8a01c554e1b0b627f423c994331568f8..5d95af2a1dd458f8f925ee335455a48159b97e6e 100644 |
| --- a/src/interpreter/bytecode-generator.cc |
| +++ b/src/interpreter/bytecode-generator.cc |
| @@ -2535,28 +2535,17 @@ 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()); |
| // 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); |
| + builder()->NewWithSpread(constructor, args_regs); |
|
rmcilroy
2017/01/16 16:28:02
nit - add a TODO to collect type on the feedback s
petermarshall
2017/01/18 10:05:32
Done
petermarshall
2017/01/18 10:05:32
Done
|
| } 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); |
|
rmcilroy
2017/01/16 16:28:02
nit - move setExpressionPosition to be outside the
petermarshall
2017/01/18 10:05:32
Oops - done
|
| // TODO(turbofan): For now we do gather feedback on super constructor |