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

Unified Diff: src/parser.cc

Issue 1161243005: Revert of [es6] Super call in arrows and eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months 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/parser.h ('k') | src/pattern-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 45baddbc895d7addd92e0db5c79b9f85112f4ffb..196853c0236e3b8fca9d2dca5f67481138d9fa17 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -359,17 +359,8 @@
body = new (zone()) ZoneList<Statement*>(call_super ? 2 : 1, zone());
AddAssertIsConstruct(body, pos);
if (call_super) {
- // %_DefaultConstructorCallSuper(new.target, .this_function)
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);
- args->Add(this_function_proxy, zone());
+ new (zone()) ZoneList<Expression*>(0, zone());
CallRuntime* call = factory()->NewCallRuntime(
ast_value_factory()->empty_string(),
Runtime::FunctionForId(Runtime::kInlineDefaultConstructorCallSuper),
@@ -756,29 +747,16 @@
Variable::THIS, pos, pos + 4);
}
-Expression* ParserTraits::SuperPropertyReference(Scope* scope,
- AstNodeFactory* factory,
- int pos) {
+Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory,
+ int pos) {
+ // TODO(arv): Split into SuperProperty and SuperCall?
VariableProxy* home_object_proxy = scope->NewUnresolved(
factory, parser_->ast_value_factory()->home_object_string(),
Variable::NORMAL, pos);
- return factory->NewSuperPropertyReference(
+
+ return factory->NewSuperReference(
ThisExpression(scope, factory, pos)->AsVariableProxy(), home_object_proxy,
pos);
-}
-
-
-Expression* ParserTraits::SuperCallReference(Scope* scope,
- AstNodeFactory* factory, int pos) {
- VariableProxy* new_target_proxy = scope->NewUnresolved(
- factory, parser_->ast_value_factory()->new_target_string(),
- Variable::NORMAL, pos);
- VariableProxy* this_function_proxy = scope->NewUnresolved(
- factory, parser_->ast_value_factory()->this_function_string(),
- Variable::NORMAL, pos);
- return factory->NewSuperCallReference(
- ThisExpression(scope, factory, pos)->AsVariableProxy(), new_target_proxy,
- this_function_proxy, pos);
}
@@ -5766,14 +5744,13 @@
Expression* Parser::SpreadCall(Expression* function,
ZoneList<v8::internal::Expression*>* args,
int pos) {
- if (function->IsSuperCallReference()) {
+ if (function->IsSuperReference()) {
// Super calls
- // %_CallSuperWithSpread(%ReflectConstruct(<super>, args, new.target))
args->InsertAt(0, function, zone());
- args->Add(function->AsSuperCallReference()->new_target_var(), zone());
+ args->Add(factory()->NewVariableProxy(scope_->new_target_var()), zone());
Expression* result = factory()->NewCallRuntime(
ast_value_factory()->reflect_construct_string(), NULL, args, pos);
- args = new (zone()) ZoneList<Expression*>(1, zone());
+ args = new (zone()) ZoneList<Expression*>(0, zone());
args->Add(result, zone());
return factory()->NewCallRuntime(
ast_value_factory()->empty_string(),
« no previous file with comments | « src/parser.h ('k') | src/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698