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

Unified Diff: src/crankshaft/hydrogen.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/compiler/ast-loop-assignment-analyzer.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.h
diff --git a/src/crankshaft/hydrogen.h b/src/crankshaft/hydrogen.h
index f1b0b9346c132df1353ed962a2d0cc07fe2f055d..a81d244767610b11affbace1e5a55144f6996003 100644
--- a/src/crankshaft/hydrogen.h
+++ b/src/crankshaft/hydrogen.h
@@ -2062,8 +2062,10 @@ inline HContext* HGraphBuilder::New<HContext>() {
return HContext::New(zone());
}
-
-class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
+// This AstVistor is not final, and provides the AstVisitor methods as virtual
+// methods so they can be specialized by subclasses.
+class HOptimizedGraphBuilder : public HGraphBuilder,
+ public AstVisitor<HOptimizedGraphBuilder> {
public:
// A class encapsulating (lazily-allocated) break and continue blocks for
// a breakable statement. Separated from BreakAndContinueScope so that it
@@ -2143,7 +2145,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
FunctionState* function_state() const { return function_state_; }
- void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
+ void VisitDeclarations(ZoneList<Declaration*>* declarations);
AstTypeBounds* bounds() { return &bounds_; }
@@ -2351,7 +2353,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
HBasicBlock* false_block);
// Visit a list of expressions from left to right, each in a value context.
- void VisitExpressions(ZoneList<Expression*>* exprs) override;
+ void VisitExpressions(ZoneList<Expression*>* exprs);
void VisitExpressions(ZoneList<Expression*>* exprs,
ArgumentsAllowedFlag flag);
@@ -2361,9 +2363,9 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
void PushArgumentsFromEnvironment(int count);
void SetUpScope(Scope* scope);
- void VisitStatements(ZoneList<Statement*>* statements) override;
+ void VisitStatements(ZoneList<Statement*>* statements);
-#define DECLARE_VISIT(type) void Visit##type(type* node) override;
+#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
« no previous file with comments | « src/compiler/ast-loop-assignment-analyzer.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698