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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 public: | 338 public: |
339 TypeNode(intptr_t token_pos, const AbstractType& type) | 339 TypeNode(intptr_t token_pos, const AbstractType& type) |
340 : AstNode(token_pos), type_(type) { | 340 : AstNode(token_pos), type_(type) { |
341 ASSERT(type_.IsZoneHandle()); | 341 ASSERT(type_.IsZoneHandle()); |
342 ASSERT(!type_.IsNull()); | 342 ASSERT(!type_.IsNull()); |
343 ASSERT(type_.IsFinalized()); | 343 ASSERT(type_.IsFinalized()); |
344 } | 344 } |
345 | 345 |
346 const AbstractType& type() const { return type_; } | 346 const AbstractType& type() const { return type_; } |
347 | 347 |
348 virtual const Instance* EvalConstExpr() const { | |
349 return &type(); | |
350 } | |
regis
2012/12/22 00:04:50
You need to check if the type is instantiated and
Tom Ball
2012/12/27 22:13:44
Done.
| |
351 | |
348 virtual void VisitChildren(AstNodeVisitor* visitor) const { } | 352 virtual void VisitChildren(AstNodeVisitor* visitor) const { } |
349 | 353 |
350 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); | 354 DECLARE_COMMON_NODE_FUNCTIONS(TypeNode); |
351 | 355 |
352 private: | 356 private: |
353 const AbstractType& type_; | 357 const AbstractType& type_; |
354 | 358 |
355 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeNode); | 359 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeNode); |
356 }; | 360 }; |
357 | 361 |
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1690 const LocalVariable& context_var_; | 1694 const LocalVariable& context_var_; |
1691 | 1695 |
1692 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); | 1696 DISALLOW_IMPLICIT_CONSTRUCTORS(InlinedFinallyNode); |
1693 }; | 1697 }; |
1694 | 1698 |
1695 } // namespace dart | 1699 } // namespace dart |
1696 | 1700 |
1697 #undef DECLARE_COMMON_NODE_FUNCTIONS | 1701 #undef DECLARE_COMMON_NODE_FUNCTIONS |
1698 | 1702 |
1699 #endif // VM_AST_H_ | 1703 #endif // VM_AST_H_ |
OLD | NEW |