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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1442643002: [turbofan] Rename "original constructor" to "new target". (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index e85167057d29c5a24db2dba65947d5fa5a7d95c3..2c74d7fb22a641a31590151e9ad7e6a6856e9779 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -2503,7 +2503,7 @@ void AstGraphBuilder::VisitCallSuper(Call* expr) {
ZoneList<Expression*>* args = expr->arguments();
VisitForValues(args);
- // Original constructor is loaded from the {new.target} variable.
+ // The new target is loaded from the {new.target} variable.
VisitForValue(super->new_target_var());
// Create node to perform the super call.
@@ -2521,7 +2521,7 @@ void AstGraphBuilder::VisitCallNew(CallNew* expr) {
ZoneList<Expression*>* args = expr->arguments();
VisitForValues(args);
- // Original constructor is the same as the callee.
+ // The new target is the same as the callee.
environment()->Push(environment()->Peek(args->length()));
// Create node to perform the construct call.
@@ -3211,9 +3211,8 @@ Node* AstGraphBuilder::BuildThisFunctionVariable(Variable* this_function_var) {
Node* AstGraphBuilder::BuildNewTargetVariable(Variable* new_target_var) {
if (new_target_var == nullptr) return nullptr;
- // Retrieve the original constructor in case we are called as a constructor.
- const Operator* op =
- javascript()->CallRuntime(Runtime::kGetOriginalConstructor, 0);
+ // Retrieve the new target in case we are called as a constructor.
+ const Operator* op = javascript()->CallRuntime(Runtime::kGetNewTarget, 0);
Node* object = NewNode(op);
// TODO(4544): Bailout id only needed for JavaScriptFrame::Summarize.
PrepareFrameState(object, BailoutId::FunctionContext());
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698