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

Unified Diff: src/parsing/preparser.h

Issue 1702063002: Non-pattern rewriting revisited (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix a bug I introduced when rebasing 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 93e00be6bae5e619b0cbf5cc23797ff6955d4bbf..cfbfe0ecc8f322bb23fc7e75d259b3b355232aec 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -197,8 +197,6 @@ class PreParserExpression {
ExpressionTypeField::decode(code_) == kAssignment;
}
- bool IsRewritableAssignmentExpression() const { return IsAssignment(); }
-
bool IsObjectLiteral() const {
return TypeField::decode(code_) == kObjectLiteralExpression;
}
@@ -487,8 +485,7 @@ class PreParserFactory {
PreParserExpression right, int pos) {
return PreParserExpression::Default();
}
- PreParserExpression NewRewritableAssignmentExpression(
- PreParserExpression expression) {
+ PreParserExpression NewRewritableExpression(PreParserExpression expression) {
return expression;
}
PreParserExpression NewAssignment(Token::Value op,
@@ -589,6 +586,9 @@ class PreParserTraits {
typedef int AstProperties;
+ typedef v8::internal::ExpressionClassifier<PreParserTraits>
+ ExpressionClassifier;
+
// Return types for traversing functions.
typedef PreParserIdentifier Identifier;
typedef PreParserExpression Expression;
@@ -885,7 +885,7 @@ class PreParserTraits {
++parameters->arity;
}
void DeclareFormalParameter(Scope* scope, PreParserIdentifier parameter,
- ExpressionClassifier* classifier) {
+ Type::ExpressionClassifier* classifier) {
if (!classifier->is_simple_parameter_list()) {
scope->SetHasNonSimpleParameters();
}
@@ -923,18 +923,18 @@ class PreParserTraits {
inline void RewriteDestructuringAssignments() {}
inline void QueueDestructuringAssignmentForRewriting(PreParserExpression) {}
+ inline void QueueNonPatternForRewriting(PreParserExpression) {}
void SetFunctionNameFromPropertyName(PreParserExpression,
PreParserIdentifier) {}
void SetFunctionNameFromIdentifierRef(PreParserExpression,
PreParserExpression) {}
- inline PreParserExpression RewriteNonPattern(
- PreParserExpression expr, const ExpressionClassifier* classifier,
- bool* ok);
- inline PreParserExpression RewriteNonPatternObjectLiteralProperty(
- PreParserExpression property, const ExpressionClassifier* classifier,
- bool* ok);
+ inline void RewriteNonPattern(Type::ExpressionClassifier* classifier,
+ bool* ok);
+
+ V8_INLINE Zone* zone() const;
+ V8_INLINE ZoneList<PreParserExpression>* GetNonPatternList() const;
inline PreParserExpression RewriteYieldStar(
PreParserExpression generator, PreParserExpression expr, int pos);
@@ -1119,19 +1119,19 @@ PreParserExpression PreParserTraits::ParseDoExpression(bool* ok) {
}
-PreParserExpression PreParserTraits::RewriteNonPattern(
- PreParserExpression expr, const ExpressionClassifier* classifier,
- bool* ok) {
+void PreParserTraits::RewriteNonPattern(Type::ExpressionClassifier* classifier,
+ bool* ok) {
pre_parser_->ValidateExpression(classifier, ok);
- return expr;
}
-PreParserExpression PreParserTraits::RewriteNonPatternObjectLiteralProperty(
- PreParserExpression property, const ExpressionClassifier* classifier,
- bool* ok) {
- pre_parser_->ValidateExpression(classifier, ok);
- return property;
+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();
}
« 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