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

Unified Diff: runtime/vm/ast.h

Issue 1482153006: VM: Reduce size of AST-nodes vtables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index 1290a0f8239b52d2d0c7401f53e45fdd3b1d30bb..0e9b68c3107aa8dd5828523affb6a34b24515aba 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -92,7 +92,6 @@ class AstNodeVisitor : public ValueObject {
#define DECLARE_COMMON_NODE_FUNCTIONS(type) \
virtual void Visit(AstNodeVisitor* visitor); \
virtual const char* PrettyName() const; \
- virtual bool Is##type() const { return true; } \
virtual type* As##type() { return this; }
@@ -107,7 +106,7 @@ class AstNode : public ZoneAllocated {
intptr_t token_pos() const { return token_pos_; }
#define AST_TYPE_CHECK(BaseName) \
- virtual bool Is##BaseName##Node() const { return false; } \
+ bool Is##BaseName##Node() { return As##BaseName##Node() != NULL; } \
virtual BaseName##Node* As##BaseName##Node() { return NULL; }
FOR_EACH_NODE(AST_TYPE_CHECK)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698