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

Unified Diff: src/parsing/parser.cc

Issue 1517243002: [es6] Remove the %DefaultConstructorCallSuper intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@GetSuperConstructor
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 9e8a69bb243a69189bc641fcb29a4fdbf881dab1..0969edde57324fb4bc80743802c3b083c4d10c23 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -361,14 +361,10 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
body = new (zone()) ZoneList<Statement*>(call_super ? 2 : 1, zone());
if (call_super) {
- // let super_constructor = %_GetSuperConstructor(<this-function>)
- // %_DefaultConstructorCallSuper(new.target, super_constructor)
+ // $super_constructor = %_GetSuperConstructor(<this-function>)
+ // %reflect_construct($super_constructor, arguments, new.target)
ZoneList<Expression*>* args =
new (zone()) ZoneList<Expression*>(2, zone());
- VariableProxy* new_target_proxy = scope_->NewUnresolved(
- factory(), ast_value_factory()->new_target_string(), Variable::NORMAL,
- pos);
- args->Add(new_target_proxy, zone());
VariableProxy* this_function_proxy = scope_->NewUnresolved(
factory(), ast_value_factory()->this_function_string(),
Variable::NORMAL, pos);
@@ -378,8 +374,16 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
Expression* super_constructor = factory()->NewCallRuntime(
Runtime::kInlineGetSuperConstructor, tmp, pos);
args->Add(super_constructor, zone());
+ VariableProxy* arguments_proxy = scope_->NewUnresolved(
+ factory(), ast_value_factory()->arguments_string(), Variable::NORMAL,
+ pos);
+ args->Add(arguments_proxy, zone());
+ VariableProxy* new_target_proxy = scope_->NewUnresolved(
+ factory(), ast_value_factory()->new_target_string(), Variable::NORMAL,
+ pos);
+ args->Add(new_target_proxy, zone());
CallRuntime* call = factory()->NewCallRuntime(
- Runtime::kInlineDefaultConstructorCallSuper, args, pos);
+ Context::REFLECT_CONSTRUCT_INDEX, args, pos);
body->Add(factory()->NewReturnStatement(call, pos), zone());
}
@@ -6434,8 +6438,8 @@ Expression* Parser::SpreadCall(Expression* function,
int pos) {
if (function->IsSuperCallReference()) {
// Super calls
- // let super_constructor = %_GetSuperConstructor(<this-function>)
- // %reflect_construct(super_constructor, args, new.target)
+ // $super_constructor = %_GetSuperConstructor(<this-function>)
+ // %reflect_construct($super_constructor, args, new.target)
ZoneList<Expression*>* tmp = new (zone()) ZoneList<Expression*>(1, zone());
tmp->Add(function->AsSuperCallReference()->this_function_var(), zone());
Expression* super_constructor = factory()->NewCallRuntime(
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698