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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 2504553003: [es6] Perform the IsConstructor test in GetSuperConstructor. (Closed)
Patch Set: Convert GetSuperConstructor to a new interpreter bytecode Created 4 years 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.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/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 } 2465 }
2466 2466
2467 2467
2468 void AstGraphBuilder::VisitCallSuper(Call* expr) { 2468 void AstGraphBuilder::VisitCallSuper(Call* expr) {
2469 SuperCallReference* super = expr->expression()->AsSuperCallReference(); 2469 SuperCallReference* super = expr->expression()->AsSuperCallReference();
2470 DCHECK_NOT_NULL(super); 2470 DCHECK_NOT_NULL(super);
2471 2471
2472 // Prepare the callee to the super call. 2472 // Prepare the callee to the super call.
2473 VisitForValue(super->this_function_var()); 2473 VisitForValue(super->this_function_var());
2474 Node* this_function = environment()->Pop(); 2474 Node* this_function = environment()->Pop();
2475 const Operator* op = 2475 Node* super_function =
2476 javascript()->CallRuntime(Runtime::kInlineGetSuperConstructor, 1); 2476 NewNode(javascript()->GetSuperConstructor(), this_function);
2477 Node* super_function = NewNode(op, this_function);
2478 environment()->Push(super_function); 2477 environment()->Push(super_function);
2479 2478
2480 // Evaluate all arguments to the super call. 2479 // Evaluate all arguments to the super call.
2481 ZoneList<Expression*>* args = expr->arguments(); 2480 ZoneList<Expression*>* args = expr->arguments();
2482 VisitForValues(args); 2481 VisitForValues(args);
2483 2482
2484 // The new target is loaded from the {new.target} variable. 2483 // The new target is loaded from the {new.target} variable.
2485 VisitForValue(super->new_target_var()); 2484 VisitForValue(super->new_target_var());
2486 2485
2487 // Create node to perform the super call. 2486 // Create node to perform the super call.
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
4355 // Phi does not exist yet, introduce one. 4354 // Phi does not exist yet, introduce one.
4356 value = NewPhi(inputs, value, control); 4355 value = NewPhi(inputs, value, control);
4357 value->ReplaceInput(inputs - 1, other); 4356 value->ReplaceInput(inputs - 1, other);
4358 } 4357 }
4359 return value; 4358 return value;
4360 } 4359 }
4361 4360
4362 } // namespace compiler 4361 } // namespace compiler
4363 } // namespace internal 4362 } // namespace internal
4364 } // namespace v8 4363 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698