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

Unified Diff: src/parsing/preparser.cc

Issue 1712203002: Revert of Non-pattern rewriting revisited (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/parsing/preparser.h ('k') | src/typing-asm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index d335c8bdcd29433337d1173c9e17b3a1e116a999..f2559e4a8bbf9f98f22c8744cb2a9611aa3d8300 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -573,7 +573,7 @@
int decl_pos = peek_position();
PreParserExpression pattern = PreParserExpression::Default();
{
- ExpressionClassifier pattern_classifier(this);
+ ExpressionClassifier pattern_classifier;
Token::Value next = peek();
pattern = ParsePrimaryExpression(&pattern_classifier, CHECK_OK);
@@ -594,7 +594,7 @@
Scanner::Location variable_loc = scanner()->location();
nvars++;
if (Check(Token::ASSIGN)) {
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
ParseAssignmentExpression(var_context != kForStatement, &classifier,
CHECK_OK);
ValidateExpression(&classifier, CHECK_OK);
@@ -648,7 +648,7 @@
IsClassConstructor(function_state_->kind())) {
bool is_this = peek() == Token::THIS;
Expression expr = Expression::Default();
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
if (is_this) {
expr = ParseStrongInitializationExpression(&classifier, CHECK_OK);
} else {
@@ -684,7 +684,7 @@
}
bool starts_with_identifier = peek_any_identifier();
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
Expression expr = ParseExpression(true, &classifier, CHECK_OK);
ValidateExpression(&classifier, CHECK_OK);
@@ -937,9 +937,10 @@
}
if (mode == ForEachStatement::ITERATE) {
- ExpressionClassifier classifier(this);
- ParseAssignmentExpression(true, &classifier, CHECK_OK);
- RewriteNonPattern(&classifier, CHECK_OK);
+ ExpressionClassifier classifier;
+ Expression enumerable =
+ ParseAssignmentExpression(true, &classifier, CHECK_OK);
+ PreParserTraits::RewriteNonPattern(enumerable, &classifier, CHECK_OK);
} else {
ParseExpression(true, CHECK_OK);
}
@@ -950,7 +951,7 @@
}
} else {
int lhs_beg_pos = peek_position();
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
Expression lhs = ParseExpression(false, &classifier, CHECK_OK);
int lhs_end_pos = scanner()->location().end_pos;
is_let_identifier_expression =
@@ -975,9 +976,10 @@
}
if (mode == ForEachStatement::ITERATE) {
- ExpressionClassifier classifier(this);
- ParseAssignmentExpression(true, &classifier, CHECK_OK);
- RewriteNonPattern(&classifier, CHECK_OK);
+ ExpressionClassifier classifier;
+ Expression enumerable =
+ ParseAssignmentExpression(true, &classifier, CHECK_OK);
+ PreParserTraits::RewriteNonPattern(enumerable, &classifier, CHECK_OK);
} else {
ParseExpression(true, CHECK_OK);
}
@@ -1055,7 +1057,7 @@
if (tok == Token::CATCH) {
Consume(Token::CATCH);
Expect(Token::LPAREN, CHECK_OK);
- ExpressionClassifier pattern_classifier(this);
+ ExpressionClassifier pattern_classifier;
ParsePrimaryExpression(&pattern_classifier, CHECK_OK);
ValidateBindingPattern(&pattern_classifier, CHECK_OK);
Expect(Token::RPAREN, CHECK_OK);
@@ -1112,7 +1114,7 @@
FunctionState function_state(&function_state_, &scope_, function_scope, kind,
&factory);
DuplicateFinder duplicate_finder(scanner()->unicode_cache());
- ExpressionClassifier formals_classifier(this, &duplicate_finder);
+ ExpressionClassifier formals_classifier(&duplicate_finder);
Expect(Token::LPAREN, CHECK_OK);
int start_position = scanner()->location().beg_pos;
@@ -1218,7 +1220,7 @@
bool has_extends = Check(Token::EXTENDS);
if (has_extends) {
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
ParseLeftHandSideExpression(&classifier, CHECK_OK);
ValidateExpression(&classifier, CHECK_OK);
}
@@ -1234,7 +1236,7 @@
bool is_computed_name = false; // Classes do not care about computed
// property names here.
Identifier name;
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
ParsePropertyDefinition(&checker, in_class, has_extends, is_static,
&is_computed_name, &has_seen_constructor,
&classifier, &name, CHECK_OK);
@@ -1258,7 +1260,7 @@
// Allow "eval" or "arguments" for backward compatibility.
ParseIdentifier(kAllowRestrictedIdentifiers, CHECK_OK);
Scanner::Location spread_pos;
- ExpressionClassifier classifier(this);
+ ExpressionClassifier classifier;
ParseArguments(&spread_pos, &classifier, ok);
ValidateExpression(&classifier, CHECK_OK);
« no previous file with comments | « src/parsing/preparser.h ('k') | src/typing-asm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698