Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1107 private: | 1107 private: |
| 1108 const Field& field_; | 1108 const Field& field_; |
| 1109 AstNode* value_; | 1109 AstNode* value_; |
| 1110 | 1110 |
| 1111 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreStaticFieldNode); | 1111 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreStaticFieldNode); |
| 1112 }; | 1112 }; |
| 1113 | 1113 |
| 1114 | 1114 |
| 1115 class LoadIndexedNode : public AstNode { | 1115 class LoadIndexedNode : public AstNode { |
| 1116 public: | 1116 public: |
| 1117 LoadIndexedNode(intptr_t token_pos, AstNode* array, AstNode* index) | 1117 LoadIndexedNode(intptr_t token_pos, |
| 1118 : AstNode(token_pos), array_(array), index_expr_(index) { | 1118 AstNode* array, |
| 1119 AstNode* index, | |
| 1120 const Class& super_class) | |
| 1121 : AstNode(token_pos), | |
| 1122 array_(array), | |
| 1123 index_expr_(index), | |
| 1124 super_class_(super_class) { | |
| 1119 ASSERT(array_ != NULL); | 1125 ASSERT(array_ != NULL); |
| 1120 ASSERT(index_expr_ != NULL); | 1126 ASSERT(index_expr_ != NULL); |
|
regis
2012/10/26 22:04:37
ASSERT(super_class_.IsZoneHandle());
hausner
2012/10/26 22:25:14
Done.
| |
| 1121 } | 1127 } |
| 1122 | 1128 |
| 1123 AstNode* array() const { return array_; } | 1129 AstNode* array() const { return array_; } |
| 1124 AstNode* index_expr() const { return index_expr_; } | 1130 AstNode* index_expr() const { return index_expr_; } |
| 1131 const Class& super_class() const { return super_class_; } | |
| 1132 bool IsSuperLoad() const { return !super_class_.IsNull(); } | |
| 1125 | 1133 |
| 1126 virtual void VisitChildren(AstNodeVisitor* visitor) const { | 1134 virtual void VisitChildren(AstNodeVisitor* visitor) const { |
| 1127 array()->Visit(visitor); | 1135 array()->Visit(visitor); |
| 1128 index_expr()->Visit(visitor); | 1136 index_expr()->Visit(visitor); |
| 1129 } | 1137 } |
| 1130 | 1138 |
| 1131 virtual AstNode* MakeAssignmentNode(AstNode* rhs); | 1139 virtual AstNode* MakeAssignmentNode(AstNode* rhs); |
| 1132 | 1140 |
| 1133 DECLARE_COMMON_NODE_FUNCTIONS(LoadIndexedNode); | 1141 DECLARE_COMMON_NODE_FUNCTIONS(LoadIndexedNode); |
| 1134 | 1142 |
| 1135 private: | 1143 private: |
| 1136 AstNode* array_; | 1144 AstNode* array_; |
| 1137 AstNode* index_expr_; | 1145 AstNode* index_expr_; |
| 1146 const Class& super_class_; | |
| 1138 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadIndexedNode); | 1147 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadIndexedNode); |
| 1139 }; | 1148 }; |
| 1140 | 1149 |
| 1141 | 1150 |
| 1142 class StoreIndexedNode : public AstNode { | 1151 class StoreIndexedNode : public AstNode { |
| 1143 public: | 1152 public: |
| 1144 StoreIndexedNode(intptr_t token_pos, | 1153 StoreIndexedNode(intptr_t token_pos, |
| 1145 AstNode* array, AstNode* index, AstNode* value) | 1154 AstNode* array, |
| 1146 : AstNode(token_pos), array_(array), index_expr_(index), value_(value) { | 1155 AstNode* index, |
| 1156 AstNode* value, | |
| 1157 const Class& super_class) | |
| 1158 : AstNode(token_pos), | |
| 1159 array_(array), | |
| 1160 index_expr_(index), | |
| 1161 value_(value), | |
| 1162 super_class_(super_class) { | |
| 1147 ASSERT(array_ != NULL); | 1163 ASSERT(array_ != NULL); |
| 1148 ASSERT(index_expr_ != NULL); | 1164 ASSERT(index_expr_ != NULL); |
| 1149 ASSERT(value_ != NULL); | 1165 ASSERT(value_ != NULL); |
|
regis
2012/10/26 22:04:37
ASSERT(super_class_.IsZoneHandle());
hausner
2012/10/26 22:25:14
Done.
| |
| 1150 } | 1166 } |
| 1151 | 1167 |
| 1152 AstNode* array() const { return array_; } | 1168 AstNode* array() const { return array_; } |
| 1153 AstNode* index_expr() const { return index_expr_; } | 1169 AstNode* index_expr() const { return index_expr_; } |
| 1154 AstNode* value() const { return value_; } | 1170 AstNode* value() const { return value_; } |
| 1171 const Class& super_class() const { return super_class_; } | |
| 1172 bool IsSuperStore() const { return !super_class_.IsNull(); } | |
| 1155 | 1173 |
| 1156 virtual void VisitChildren(AstNodeVisitor* visitor) const { | 1174 virtual void VisitChildren(AstNodeVisitor* visitor) const { |
| 1157 array()->Visit(visitor); | 1175 array()->Visit(visitor); |
| 1158 index_expr()->Visit(visitor); | 1176 index_expr()->Visit(visitor); |
| 1159 value()->Visit(visitor); | 1177 value()->Visit(visitor); |
| 1160 } | 1178 } |
| 1161 | 1179 |
| 1162 DECLARE_COMMON_NODE_FUNCTIONS(StoreIndexedNode); | 1180 DECLARE_COMMON_NODE_FUNCTIONS(StoreIndexedNode); |
| 1163 | 1181 |
| 1164 private: | 1182 private: |
| 1165 AstNode* array_; | 1183 AstNode* array_; |
| 1166 AstNode* index_expr_; | 1184 AstNode* index_expr_; |
| 1167 AstNode* value_; | 1185 AstNode* value_; |
| 1186 const Class& super_class_; | |
| 1168 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreIndexedNode); | 1187 DISALLOW_IMPLICIT_CONSTRUCTORS(StoreIndexedNode); |
| 1169 }; | 1188 }; |
| 1170 | 1189 |
| 1171 | 1190 |
| 1172 class InstanceCallNode : public AstNode { | 1191 class InstanceCallNode : public AstNode { |
| 1173 public: | 1192 public: |
| 1174 InstanceCallNode(intptr_t token_pos, | 1193 InstanceCallNode(intptr_t token_pos, |
| 1175 AstNode* receiver, | 1194 AstNode* receiver, |
| 1176 const String& function_name, | 1195 const String& function_name, |
| 1177 ArgumentListNode* arguments) | 1196 ArgumentListNode* arguments) |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1689 const LocalVariable& context_var_; | 1708 const LocalVariable& context_var_; |
| 1690 | 1709 |
| 1691 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1710 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1692 }; | 1711 }; |
| 1693 | 1712 |
| 1694 } // namespace dart | 1713 } // namespace dart |
| 1695 | 1714 |
| 1696 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1715 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1697 | 1716 |
| 1698 #endif // VM_AST_H_ | 1717 #endif // VM_AST_H_ |
| OLD | NEW |