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

Side by Side Diff: runtime/vm/ast.h

Issue 317273005: VM: Make ZoneAllocated-objects that don't need a vtable smaller. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/allocation.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AST_H_ 5 #ifndef VM_AST_H_
6 #define VM_AST_H_ 6 #define VM_AST_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 virtual bool Is##type() const { return true; } \ 91 virtual bool Is##type() const { return true; } \
92 virtual type* As##type() { return this; } 92 virtual type* As##type() { return this; }
93 93
94 94
95 class AstNode : public ZoneAllocated { 95 class AstNode : public ZoneAllocated {
96 public: 96 public:
97 explicit AstNode(intptr_t token_pos) 97 explicit AstNode(intptr_t token_pos)
98 : token_pos_(token_pos) { 98 : token_pos_(token_pos) {
99 ASSERT(token_pos_ >= 0); 99 ASSERT(token_pos_ >= 0);
100 } 100 }
101 virtual ~AstNode() { }
101 102
102 intptr_t token_pos() const { return token_pos_; } 103 intptr_t token_pos() const { return token_pos_; }
103 104
104 #define AST_TYPE_CHECK(BaseName) \ 105 #define AST_TYPE_CHECK(BaseName) \
105 virtual bool Is##BaseName##Node() const { return false; } \ 106 virtual bool Is##BaseName##Node() const { return false; } \
106 virtual BaseName##Node* As##BaseName##Node() { return NULL; } 107 virtual BaseName##Node* As##BaseName##Node() { return NULL; }
107 108
108 FOR_EACH_NODE(AST_TYPE_CHECK) 109 FOR_EACH_NODE(AST_TYPE_CHECK)
109 #undef AST_TYPE_CHECK 110 #undef AST_TYPE_CHECK
110 111
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 const intptr_t try_index_; 1803 const intptr_t try_index_;
1803 1804
1804 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); 1805 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode);
1805 }; 1806 };
1806 1807
1807 } // namespace dart 1808 } // namespace dart
1808 1809
1809 #undef DECLARE_COMMON_NODE_FUNCTIONS 1810 #undef DECLARE_COMMON_NODE_FUNCTIONS
1810 1811
1811 #endif // VM_AST_H_ 1812 #endif // VM_AST_H_
OLDNEW
« no previous file with comments | « runtime/vm/allocation.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698