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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 }; | 363 }; |
364 | 364 |
365 | 365 |
366 class TypeNode : public AstNode { | 366 class TypeNode : public AstNode { |
367 public: | 367 public: |
368 TypeNode(intptr_t token_pos, const AbstractType& type) | 368 TypeNode(intptr_t token_pos, const AbstractType& type) |
369 : AstNode(token_pos), type_(type) { | 369 : AstNode(token_pos), type_(type) { |
370 ASSERT(type_.IsZoneHandle()); | 370 ASSERT(type_.IsZoneHandle()); |
371 ASSERT(!type_.IsNull()); | 371 ASSERT(!type_.IsNull()); |
372 ASSERT(type_.IsFinalized()); | 372 ASSERT(type_.IsFinalized()); |
| 373 // A wellformed literal Type must be canonical. |
| 374 ASSERT(!type_.IsType() || |
| 375 type_.IsMalformedOrMalbounded() || |
| 376 type_.IsCanonical()); |
373 } | 377 } |
374 | 378 |
375 const AbstractType& type() const { return type_; } | 379 const AbstractType& type() const { return type_; } |
376 | 380 |
377 const char* TypeName() const; | 381 const char* TypeName() const; |
378 | 382 |
379 virtual const Instance* EvalConstExpr() const { | 383 virtual const Instance* EvalConstExpr() const { |
380 if (!type_.IsInstantiated() || type_.IsMalformedOrMalbounded()) { | 384 if (!type_.IsInstantiated() || type_.IsMalformedOrMalbounded()) { |
381 return NULL; | 385 return NULL; |
382 } | 386 } |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 const intptr_t try_index_; | 1773 const intptr_t try_index_; |
1770 | 1774 |
1771 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1775 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1772 }; | 1776 }; |
1773 | 1777 |
1774 } // namespace dart | 1778 } // namespace dart |
1775 | 1779 |
1776 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1780 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1777 | 1781 |
1778 #endif // VM_AST_H_ | 1782 #endif // VM_AST_H_ |
OLD | NEW |