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

Unified Diff: src/parsing/parser.cc

Issue 1522503002: [es6] Don't use the %GetPrototype runtime entry for super calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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/compiler/js-intrinsic-lowering.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 d2919e1216e3a32ea3cfb90f5b726bba75854ddb..9e8a69bb243a69189bc641fcb29a4fdbf881dab1 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -361,7 +361,8 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
body = new (zone()) ZoneList<Statement*>(call_super ? 2 : 1, zone());
if (call_super) {
- // %_DefaultConstructorCallSuper(new.target, %GetPrototype(<this-fun>))
+ // let super_constructor = %_GetSuperConstructor(<this-function>)
+ // %_DefaultConstructorCallSuper(new.target, super_constructor)
ZoneList<Expression*>* args =
new (zone()) ZoneList<Expression*>(2, zone());
VariableProxy* new_target_proxy = scope_->NewUnresolved(
@@ -374,9 +375,9 @@ FunctionLiteral* Parser::DefaultConstructor(bool call_super, Scope* scope,
ZoneList<Expression*>* tmp =
new (zone()) ZoneList<Expression*>(1, zone());
tmp->Add(this_function_proxy, zone());
- Expression* get_prototype =
- factory()->NewCallRuntime(Runtime::kGetPrototype, tmp, pos);
- args->Add(get_prototype, zone());
+ Expression* super_constructor = factory()->NewCallRuntime(
+ Runtime::kInlineGetSuperConstructor, tmp, pos);
+ args->Add(super_constructor, zone());
CallRuntime* call = factory()->NewCallRuntime(
Runtime::kInlineDefaultConstructorCallSuper, args, pos);
body->Add(factory()->NewReturnStatement(call, pos), zone());
@@ -6433,12 +6434,13 @@ Expression* Parser::SpreadCall(Expression* function,
int pos) {
if (function->IsSuperCallReference()) {
// Super calls
- // %reflect_construct(%GetPrototype(<this-function>), args, new.target))
+ // let 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* get_prototype =
- factory()->NewCallRuntime(Runtime::kGetPrototype, tmp, pos);
- args->InsertAt(0, get_prototype, zone());
+ Expression* super_constructor = factory()->NewCallRuntime(
+ Runtime::kInlineGetSuperConstructor, tmp, pos);
+ args->InsertAt(0, super_constructor, zone());
args->Add(function->AsSuperCallReference()->new_target_var(), zone());
return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args,
pos);
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698