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

Unified Diff: src/parsing/preparser.h

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/pattern-rewriter.cc ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index cfbfe0ecc8f322bb23fc7e75d259b3b355232aec..93e00be6bae5e619b0cbf5cc23797ff6955d4bbf 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -196,6 +196,8 @@
return TypeField::decode(code_) == kExpression &&
ExpressionTypeField::decode(code_) == kAssignment;
}
+
+ bool IsRewritableAssignmentExpression() const { return IsAssignment(); }
bool IsObjectLiteral() const {
return TypeField::decode(code_) == kObjectLiteralExpression;
@@ -485,7 +487,8 @@
PreParserExpression right, int pos) {
return PreParserExpression::Default();
}
- PreParserExpression NewRewritableExpression(PreParserExpression expression) {
+ PreParserExpression NewRewritableAssignmentExpression(
+ PreParserExpression expression) {
return expression;
}
PreParserExpression NewAssignment(Token::Value op,
@@ -585,9 +588,6 @@
typedef void GeneratorVariable;
typedef int AstProperties;
-
- typedef v8::internal::ExpressionClassifier<PreParserTraits>
- ExpressionClassifier;
// Return types for traversing functions.
typedef PreParserIdentifier Identifier;
@@ -885,7 +885,7 @@
++parameters->arity;
}
void DeclareFormalParameter(Scope* scope, PreParserIdentifier parameter,
- Type::ExpressionClassifier* classifier) {
+ ExpressionClassifier* classifier) {
if (!classifier->is_simple_parameter_list()) {
scope->SetHasNonSimpleParameters();
}
@@ -923,18 +923,18 @@
inline void RewriteDestructuringAssignments() {}
inline void QueueDestructuringAssignmentForRewriting(PreParserExpression) {}
- inline void QueueNonPatternForRewriting(PreParserExpression) {}
void SetFunctionNameFromPropertyName(PreParserExpression,
PreParserIdentifier) {}
void SetFunctionNameFromIdentifierRef(PreParserExpression,
PreParserExpression) {}
- inline void RewriteNonPattern(Type::ExpressionClassifier* classifier,
- bool* ok);
-
- V8_INLINE Zone* zone() const;
- V8_INLINE ZoneList<PreParserExpression>* GetNonPatternList() const;
+ inline PreParserExpression RewriteNonPattern(
+ PreParserExpression expr, const ExpressionClassifier* classifier,
+ bool* ok);
+ inline PreParserExpression RewriteNonPatternObjectLiteralProperty(
+ PreParserExpression property, const ExpressionClassifier* classifier,
+ bool* ok);
inline PreParserExpression RewriteYieldStar(
PreParserExpression generator, PreParserExpression expr, int pos);
@@ -1119,19 +1119,19 @@
}
-void PreParserTraits::RewriteNonPattern(Type::ExpressionClassifier* classifier,
- bool* ok) {
+PreParserExpression PreParserTraits::RewriteNonPattern(
+ PreParserExpression expr, const ExpressionClassifier* classifier,
+ bool* ok) {
pre_parser_->ValidateExpression(classifier, ok);
+ return expr;
}
-Zone* PreParserTraits::zone() const {
- return pre_parser_->function_state_->scope()->zone();
-}
-
-
-ZoneList<PreParserExpression>* PreParserTraits::GetNonPatternList() const {
- return pre_parser_->function_state_->non_patterns_to_rewrite();
+PreParserExpression PreParserTraits::RewriteNonPatternObjectLiteralProperty(
+ PreParserExpression property, const ExpressionClassifier* classifier,
+ bool* ok) {
+ pre_parser_->ValidateExpression(classifier, ok);
+ return property;
}
« no previous file with comments | « src/parsing/pattern-rewriter.cc ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698