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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2504553003: [es6] Perform the IsConstructor test in GetSuperConstructor. (Closed)
Patch Set: Convert GetSuperConstructor to a new interpreter bytecode Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after
2478 feedback_slot_index = feedback_index(expr->CallFeedbackICSlot()); 2478 feedback_slot_index = feedback_index(expr->CallFeedbackICSlot());
2479 } 2479 }
2480 builder()->Call(callee, args, feedback_slot_index, expr->tail_call_mode()); 2480 builder()->Call(callee, args, feedback_slot_index, expr->tail_call_mode());
2481 } 2481 }
2482 2482
2483 void BytecodeGenerator::VisitCallSuper(Call* expr) { 2483 void BytecodeGenerator::VisitCallSuper(Call* expr) {
2484 RegisterAllocationScope register_scope(this); 2484 RegisterAllocationScope register_scope(this);
2485 SuperCallReference* super = expr->expression()->AsSuperCallReference(); 2485 SuperCallReference* super = expr->expression()->AsSuperCallReference();
2486 2486
2487 // Prepare the constructor to the super call. 2487 // Prepare the constructor to the super call.
2488 Register this_function = VisitForRegisterValue(super->this_function_var()); 2488 VisitForAccumulatorValue(super->this_function_var());
2489 builder()->CallRuntime(Runtime::kInlineGetSuperConstructor, this_function); 2489 builder()->GetSuperConstructor();
Benedikt Meurer 2016/11/23 04:51:00 We should probably pass an output register to this
rmcilroy 2016/11/23 21:55:37 Yup sounds good, just add a kRegOut operand and pa
2490 2490
2491 Register constructor = this_function; // Re-use dead this_function register. 2491 Register constructor = register_allocator()->NewRegister();
2492 builder()->StoreAccumulatorInRegister(constructor); 2492 builder()->StoreAccumulatorInRegister(constructor);
2493 2493
2494 RegisterList args = 2494 RegisterList args =
2495 register_allocator()->NewRegisterList(expr->arguments()->length()); 2495 register_allocator()->NewRegisterList(expr->arguments()->length());
2496 VisitArguments(expr->arguments(), args); 2496 VisitArguments(expr->arguments(), args);
2497 2497
2498 // The new target is loaded into the accumulator from the 2498 // The new target is loaded into the accumulator from the
2499 // {new.target} variable. 2499 // {new.target} variable.
2500 VisitForAccumulatorValue(super->new_target_var()); 2500 VisitForAccumulatorValue(super->new_target_var());
2501 2501
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
3187 } 3187 }
3188 3188
3189 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { 3189 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() {
3190 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict 3190 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict
3191 : Runtime::kStoreKeyedToSuper_Sloppy; 3191 : Runtime::kStoreKeyedToSuper_Sloppy;
3192 } 3192 }
3193 3193
3194 } // namespace interpreter 3194 } // namespace interpreter
3195 } // namespace internal 3195 } // namespace internal
3196 } // namespace v8 3196 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698