| 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 14 matching lines...) Expand all Loading... |
| 25 V(UnaryOpNode, "unaryop") \ | 25 V(UnaryOpNode, "unaryop") \ |
| 26 V(ConditionalExprNode, "?:") \ | 26 V(ConditionalExprNode, "?:") \ |
| 27 V(IfNode, "if") \ | 27 V(IfNode, "if") \ |
| 28 V(SwitchNode, "switch") \ | 28 V(SwitchNode, "switch") \ |
| 29 V(CaseNode, "case") \ | 29 V(CaseNode, "case") \ |
| 30 V(WhileNode, "while") \ | 30 V(WhileNode, "while") \ |
| 31 V(DoWhileNode, "dowhile") \ | 31 V(DoWhileNode, "dowhile") \ |
| 32 V(ForNode, "for") \ | 32 V(ForNode, "for") \ |
| 33 V(JumpNode, "jump") \ | 33 V(JumpNode, "jump") \ |
| 34 V(ArgumentListNode, "args") \ | 34 V(ArgumentListNode, "args") \ |
| 35 V(ArgumentDefinitionTestNode, "defined") \ | |
| 36 V(ArrayNode, "array") \ | 35 V(ArrayNode, "array") \ |
| 37 V(ClosureNode, "closure") \ | 36 V(ClosureNode, "closure") \ |
| 38 V(InstanceCallNode, "instance call") \ | 37 V(InstanceCallNode, "instance call") \ |
| 39 V(StaticCallNode, "static call") \ | 38 V(StaticCallNode, "static call") \ |
| 40 V(ClosureCallNode, "closure call") \ | 39 V(ClosureCallNode, "closure call") \ |
| 41 V(CloneContextNode, "clone context") \ | 40 V(CloneContextNode, "clone context") \ |
| 42 V(ConstructorCallNode, "constructor call") \ | 41 V(ConstructorCallNode, "constructor call") \ |
| 43 V(InstanceGetterNode, "instance getter call") \ | 42 V(InstanceGetterNode, "instance getter call") \ |
| 44 V(InstanceSetterNode, "instance setter call") \ | 43 V(InstanceSetterNode, "instance setter call") \ |
| 45 V(StaticGetterNode, "static getter") \ | 44 V(StaticGetterNode, "static getter") \ |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 DECLARE_COMMON_NODE_FUNCTIONS(ArgumentListNode); | 221 DECLARE_COMMON_NODE_FUNCTIONS(ArgumentListNode); |
| 223 | 222 |
| 224 private: | 223 private: |
| 225 GrowableArray<AstNode*> nodes_; | 224 GrowableArray<AstNode*> nodes_; |
| 226 Array& names_; | 225 Array& names_; |
| 227 | 226 |
| 228 DISALLOW_COPY_AND_ASSIGN(ArgumentListNode); | 227 DISALLOW_COPY_AND_ASSIGN(ArgumentListNode); |
| 229 }; | 228 }; |
| 230 | 229 |
| 231 | 230 |
| 232 class ArgumentDefinitionTestNode : public AstNode { | |
| 233 public: | |
| 234 ArgumentDefinitionTestNode(intptr_t token_pos, | |
| 235 intptr_t formal_parameter_index, | |
| 236 const String& formal_parameter_name, | |
| 237 LocalVariable* saved_arguments_descriptor) | |
| 238 : AstNode(token_pos), | |
| 239 formal_parameter_index_(formal_parameter_index), | |
| 240 formal_parameter_name_(formal_parameter_name), | |
| 241 saved_arguments_descriptor_(*saved_arguments_descriptor) { | |
| 242 ASSERT(formal_parameter_index_ >= 0); | |
| 243 ASSERT(formal_parameter_name_.IsZoneHandle()); | |
| 244 ASSERT(formal_parameter_name_.IsSymbol()); | |
| 245 ASSERT(saved_arguments_descriptor != NULL); | |
| 246 } | |
| 247 | |
| 248 virtual void VisitChildren(AstNodeVisitor* visitor) const { } | |
| 249 | |
| 250 intptr_t formal_parameter_index() const { return formal_parameter_index_; } | |
| 251 const String& formal_parameter_name() const { return formal_parameter_name_; } | |
| 252 const LocalVariable& saved_arguments_descriptor() const { | |
| 253 return saved_arguments_descriptor_; | |
| 254 } | |
| 255 | |
| 256 DECLARE_COMMON_NODE_FUNCTIONS(ArgumentDefinitionTestNode); | |
| 257 | |
| 258 private: | |
| 259 const intptr_t formal_parameter_index_; | |
| 260 const String& formal_parameter_name_; | |
| 261 const LocalVariable& saved_arguments_descriptor_; | |
| 262 | |
| 263 DISALLOW_COPY_AND_ASSIGN(ArgumentDefinitionTestNode); | |
| 264 }; | |
| 265 | |
| 266 | |
| 267 class LetNode : public AstNode { | 231 class LetNode : public AstNode { |
| 268 public: | 232 public: |
| 269 explicit LetNode(intptr_t token_pos); | 233 explicit LetNode(intptr_t token_pos); |
| 270 | 234 |
| 271 LocalVariable* TempAt(intptr_t i) const { return vars_[i]; } | 235 LocalVariable* TempAt(intptr_t i) const { return vars_[i]; } |
| 272 AstNode* InitializerAt(intptr_t i) const { return initializers_[i]; } | 236 AstNode* InitializerAt(intptr_t i) const { return initializers_[i]; } |
| 273 | 237 |
| 274 LocalVariable* AddInitializer(AstNode* node); | 238 LocalVariable* AddInitializer(AstNode* node); |
| 275 | 239 |
| 276 const GrowableArray<AstNode*>& nodes() const { return nodes_; } | 240 const GrowableArray<AstNode*>& nodes() const { return nodes_; } |
| (...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1719 const LocalVariable& context_var_; | 1683 const LocalVariable& context_var_; |
| 1720 | 1684 |
| 1721 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1685 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1722 }; | 1686 }; |
| 1723 | 1687 |
| 1724 } // namespace dart | 1688 } // namespace dart |
| 1725 | 1689 |
| 1726 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1690 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1727 | 1691 |
| 1728 #endif // VM_AST_H_ | 1692 #endif // VM_AST_H_ |
| OLD | NEW |