OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
6 | 6 |
7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-info.h" | 10 #include "src/compilation-info.h" |
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 builder()->StoreAccumulatorInRegister(constructor); | 2511 builder()->StoreAccumulatorInRegister(constructor); |
2512 | 2512 |
2513 ZoneList<Expression*>* args = expr->arguments(); | 2513 ZoneList<Expression*>* args = expr->arguments(); |
2514 | 2514 |
2515 // When a super call contains a spread, a CallSuper AST node is only created | 2515 // When a super call contains a spread, a CallSuper AST node is only created |
2516 // if there is exactly one spread, and it is the last argument. | 2516 // if there is exactly one spread, and it is the last argument. |
2517 if (!args->is_empty() && args->last()->IsSpread()) { | 2517 if (!args->is_empty() && args->last()->IsSpread()) { |
2518 RegisterList args_regs = | 2518 RegisterList args_regs = |
2519 register_allocator()->NewRegisterList(args->length() + 2); | 2519 register_allocator()->NewRegisterList(args->length() + 2); |
2520 builder()->MoveRegister(constructor, args_regs[0]); | 2520 builder()->MoveRegister(constructor, args_regs[0]); |
| 2521 VisitArguments(args, args_regs, 2); |
2521 VisitForRegisterValue(super->new_target_var(), args_regs[1]); | 2522 VisitForRegisterValue(super->new_target_var(), args_regs[1]); |
2522 VisitArguments(args, args_regs, 2); | |
2523 builder()->NewWithSpread(args_regs); | 2523 builder()->NewWithSpread(args_regs); |
2524 } else { | 2524 } else { |
2525 RegisterList args_regs = | 2525 RegisterList args_regs = |
2526 register_allocator()->NewRegisterList(args->length()); | 2526 register_allocator()->NewRegisterList(args->length()); |
2527 VisitArguments(args, args_regs); | 2527 VisitArguments(args, args_regs); |
2528 // The new target is loaded into the accumulator from the | 2528 // The new target is loaded into the accumulator from the |
2529 // {new.target} variable. | 2529 // {new.target} variable. |
2530 VisitForAccumulatorValue(super->new_target_var()); | 2530 VisitForAccumulatorValue(super->new_target_var()); |
2531 | 2531 |
2532 // Call construct. | 2532 // Call construct. |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 } | 3259 } |
3260 | 3260 |
3261 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3261 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3262 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3262 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3263 : Runtime::kStoreKeyedToSuper_Sloppy; | 3263 : Runtime::kStoreKeyedToSuper_Sloppy; |
3264 } | 3264 } |
3265 | 3265 |
3266 } // namespace interpreter | 3266 } // namespace interpreter |
3267 } // namespace internal | 3267 } // namespace internal |
3268 } // namespace v8 | 3268 } // namespace v8 |
OLD | NEW |