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

Unified Diff: src/parsing/parser.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/expression-classifier.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 62bd066cd4e2660d96a919c94133f9b97a0a2c4e..94496eb1e4d8b964962722f24d747745d9e69274 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -335,6 +335,9 @@ class ParserTraits {
typedef v8::internal::AstProperties AstProperties;
+ typedef v8::internal::ExpressionClassifier<ParserTraits>
+ ExpressionClassifier;
+
// Return types for traversing functions.
typedef const AstRawString* Identifier;
typedef v8::internal::Expression* Expression;
@@ -549,7 +552,7 @@ class ParserTraits {
int initializer_end_position, bool is_rest);
V8_INLINE void DeclareFormalParameter(
Scope* scope, const ParserFormalParameters::Parameter& parameter,
- ExpressionClassifier* classifier);
+ Type::ExpressionClassifier* classifier);
void ParseArrowFunctionFormalParameters(ParserFormalParameters* parameters,
Expression* params,
const Scanner::Location& params_loc,
@@ -643,6 +646,7 @@ class ParserTraits {
V8_INLINE void QueueDestructuringAssignmentForRewriting(
Expression* assignment);
+ V8_INLINE void QueueNonPatternForRewriting(Expression* expr);
void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property,
const AstRawString* name);
@@ -651,11 +655,12 @@ class ParserTraits {
Expression* identifier);
// Rewrite expressions that are not used as patterns
- V8_INLINE Expression* RewriteNonPattern(
- Expression* expr, const ExpressionClassifier* classifier, bool* ok);
- V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty(
- ObjectLiteralProperty* property, const ExpressionClassifier* classifier,
- bool* ok);
+ V8_INLINE void RewriteNonPattern(Type::ExpressionClassifier* classifier,
+ bool* ok);
+
+ V8_INLINE Zone* zone() const;
+
+ V8_INLINE ZoneList<Expression*>* GetNonPatternList() const;
Expression* RewriteYieldStar(
Expression* generator, Expression* expression, int pos);
@@ -812,8 +817,9 @@ class Parser : public ParserBase<ParserTraits> {
const DeclarationParsingResult::Declaration* declaration,
ZoneList<const AstRawString*>* names, bool* ok);
- static void RewriteDestructuringAssignment(
- Parser* parser, RewritableAssignmentExpression* expr, Scope* Scope);
+ static void RewriteDestructuringAssignment(Parser* parser,
+ RewritableExpression* expr,
+ Scope* Scope);
static Expression* RewriteDestructuringAssignment(Parser* parser,
Assignment* assignment,
@@ -1029,11 +1035,7 @@ class Parser : public ParserBase<ParserTraits> {
friend class NonPatternRewriter;
V8_INLINE Expression* RewriteSpreads(ArrayLiteral* lit);
- V8_INLINE Expression* RewriteNonPattern(
- Expression* expr, const ExpressionClassifier* classifier, bool* ok);
- V8_INLINE ObjectLiteralProperty* RewriteNonPatternObjectLiteralProperty(
- ObjectLiteralProperty* property, const ExpressionClassifier* classifier,
- bool* ok);
+ V8_INLINE void RewriteNonPattern(ExpressionClassifier* classifier, bool* ok);
friend class InitializerRewriter;
void RewriteParameterInitializer(Expression* expr, Scope* scope);
@@ -1184,7 +1186,7 @@ void ParserTraits::AddFormalParameter(ParserFormalParameters* parameters,
void ParserTraits::DeclareFormalParameter(
Scope* scope, const ParserFormalParameters::Parameter& parameter,
- ExpressionClassifier* classifier) {
+ Type::ExpressionClassifier* classifier) {
bool is_duplicate = false;
bool is_simple = classifier->is_simple_parameter_list();
auto name = is_simple || parameter.is_rest
« no previous file with comments | « src/parsing/expression-classifier.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698