| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 public: | 351 public: |
| 352 TypeNode(intptr_t token_pos, const AbstractType& type) | 352 TypeNode(intptr_t token_pos, const AbstractType& type) |
| 353 : AstNode(token_pos), type_(type) { | 353 : AstNode(token_pos), type_(type) { |
| 354 ASSERT(type_.IsZoneHandle()); | 354 ASSERT(type_.IsZoneHandle()); |
| 355 ASSERT(!type_.IsNull()); | 355 ASSERT(!type_.IsNull()); |
| 356 ASSERT(type_.IsFinalized()); | 356 ASSERT(type_.IsFinalized()); |
| 357 } | 357 } |
| 358 | 358 |
| 359 const AbstractType& type() const { return type_; } | 359 const AbstractType& type() const { return type_; } |
| 360 | 360 |
| 361 virtual const char* Name() const; |
| 362 |
| 361 virtual const Instance* EvalConstExpr() const { | 363 virtual const Instance* EvalConstExpr() const { |
| 362 if (!type_.IsInstantiated() || type_.IsMalformed()) { | 364 if (!type_.IsInstantiated() || type_.IsMalformed()) { |
| 363 return NULL; | 365 return NULL; |
| 364 } | 366 } |
| 365 return &type(); | 367 return &type(); |
| 366 } | 368 } |
| 367 | 369 |
| 368 virtual void VisitChildren(AstNodeVisitor* visitor) const { } | 370 virtual void VisitChildren(AstNodeVisitor* visitor) const { } |
| 369 | 371 |
| 370 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); | 372 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 public: | 958 public: |
| 957 LoadLocalNode(intptr_t token_pos, const LocalVariable* local) | 959 LoadLocalNode(intptr_t token_pos, const LocalVariable* local) |
| 958 : AstNode(token_pos), local_(*local) { | 960 : AstNode(token_pos), local_(*local) { |
| 959 ASSERT(local != NULL); | 961 ASSERT(local != NULL); |
| 960 } | 962 } |
| 961 | 963 |
| 962 const LocalVariable& local() const { return local_; } | 964 const LocalVariable& local() const { return local_; } |
| 963 | 965 |
| 964 virtual void VisitChildren(AstNodeVisitor* visitor) const { } | 966 virtual void VisitChildren(AstNodeVisitor* visitor) const { } |
| 965 | 967 |
| 968 virtual const char* Name() const; |
| 966 virtual const Instance* EvalConstExpr() const; | 969 virtual const Instance* EvalConstExpr() const; |
| 967 virtual bool IsPotentiallyConst() const; | 970 virtual bool IsPotentiallyConst() const; |
| 968 virtual AstNode* MakeAssignmentNode(AstNode* rhs); | 971 virtual AstNode* MakeAssignmentNode(AstNode* rhs); |
| 969 | 972 |
| 970 DECLARE_COMMON_NODE_FUNCTIONS(LoadLocalNode); | 973 DECLARE_COMMON_NODE_FUNCTIONS(LoadLocalNode); |
| 971 | 974 |
| 972 private: | 975 private: |
| 973 const LocalVariable& local_; | 976 const LocalVariable& local_; |
| 974 | 977 |
| 975 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadLocalNode); | 978 DISALLOW_IMPLICIT_CONSTRUCTORS(LoadLocalNode); |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 const LocalVariable& context_var_; | 1694 const LocalVariable& context_var_; |
| 1692 | 1695 |
| 1693 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1696 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
| 1694 }; | 1697 }; |
| 1695 | 1698 |
| 1696 } // namespace dart | 1699 } // namespace dart |
| 1697 | 1700 |
| 1698 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1701 #undef DECLARE_COMMON_NODE_FUNCTIONS |
| 1699 | 1702 |
| 1700 #endif // VM_AST_H_ | 1703 #endif // VM_AST_H_ |
| OLD | NEW |