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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } | 373 } |
374 | 374 |
375 const AbstractType& type() const { return type_; } | 375 const AbstractType& type() const { return type_; } |
376 | 376 |
377 const char* TypeName() const; | 377 const char* TypeName() const; |
378 | 378 |
379 virtual const Instance* EvalConstExpr() const { | 379 virtual const Instance* EvalConstExpr() const { |
380 // TODO(regis): What if the type is malbounded? | 380 if (!type_.IsInstantiated() || |
381 if (!type_.IsInstantiated() || type_.IsMalformed()) { | 381 type_.IsMalformed() || type_.IsMalbounded()) { |
382 return NULL; | 382 return NULL; |
383 } | 383 } |
384 return &type(); | 384 return &type(); |
385 } | 385 } |
386 | 386 |
387 virtual void VisitChildren(AstNodeVisitor* visitor) const { } | 387 virtual void VisitChildren(AstNodeVisitor* visitor) const { } |
388 | 388 |
389 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); | 389 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); |
390 | 390 |
391 private: | 391 private: |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 const intptr_t try_index_; | 1778 const intptr_t try_index_; |
1779 | 1779 |
1780 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1780 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1781 }; | 1781 }; |
1782 | 1782 |
1783 } // namespace dart | 1783 } // namespace dart |
1784 | 1784 |
1785 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1785 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1786 | 1786 |
1787 #endif // VM_AST_H_ | 1787 #endif // VM_AST_H_ |
OLD | NEW |