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

Unified Diff: src/parsing/parser.h

Issue 2142233003: Templatize AstVisitor with its subclass (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 5 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/interpreter/bytecode-generator.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 35711b068f92b59adc3527e61cd3936692bb8a0c..a6a6a9e7143c69fcc4bc8e7b8ea600cf5f2e6301 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -507,10 +507,10 @@ class ParserTraits {
Expression* ThisExpression(Scope* scope, AstNodeFactory* factory,
int pos = kNoSourcePosition);
- Expression* SuperPropertyReference(Scope* scope, AstNodeFactory* factory,
- int pos);
- Expression* SuperCallReference(Scope* scope, AstNodeFactory* factory,
- int pos);
+ Expression* NewSuperPropertyReference(Scope* scope, AstNodeFactory* factory,
+ int pos);
+ Expression* NewSuperCallReference(Scope* scope, AstNodeFactory* factory,
+ int pos);
Expression* NewTargetExpression(Scope* scope, AstNodeFactory* factory,
int pos);
Expression* FunctionSentExpression(Scope* scope, AstNodeFactory* factory,
@@ -840,7 +840,7 @@ class Parser : public ParserBase<ParserTraits> {
Scanner::Location bindings_loc;
};
- class PatternRewriter : private AstVisitor {
+ class PatternRewriter final : private AstVisitor<PatternRewriter> {
public:
static void DeclareAndInitializeVariables(
Block* block, const DeclarationDescriptor* declaration_descriptor,
@@ -858,11 +858,10 @@ class Parser : public ParserBase<ParserTraits> {
private:
PatternRewriter() {}
-#define DECLARE_VISIT(type) void Visit##type(v8::internal::type* node) override;
+#define DECLARE_VISIT(type) void Visit##type(v8::internal::type* node);
// Visiting functions for AST nodes make this an AstVisitor.
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
- void Visit(AstNode* node) override;
enum PatternContext {
BINDING,
@@ -878,7 +877,7 @@ class Parser : public ParserBase<ParserTraits> {
Expression* old_value = current_value_;
current_value_ = value;
recursion_level_++;
- pattern->Accept(this);
+ Visit(pattern);
recursion_level_--;
current_value_ = old_value;
}
@@ -917,6 +916,8 @@ class Parser : public ParserBase<ParserTraits> {
Expression* current_value_;
int recursion_level_;
bool* ok_;
+
+ DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW()
};
Block* ParseVariableDeclarations(VariableDeclarationContext var_context,
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698