| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 Element get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 // Stepwise assignment to ensure invariant. | 709 // Stepwise assignment to ensure invariant. |
| 710 element.supertypeLoadState = STATE_STARTED; | 710 element.supertypeLoadState = STATE_STARTED; |
| 711 element.supertypeLoadState = STATE_DONE; | 711 element.supertypeLoadState = STATE_DONE; |
| 712 element.resolutionState = STATE_DONE; | 712 element.resolutionState = STATE_DONE; |
| 713 // TODO(johnniwinther): Check matching type variables and | 713 // TODO(johnniwinther): Check matching type variables and |
| 714 // empty extends/implements clauses. | 714 // empty extends/implements clauses. |
| 715 } | 715 } |
| 716 for (MetadataAnnotation metadata in element.metadata) { | 716 for (MetadataAnnotation metadata in element.metadata) { |
| 717 metadata.ensureResolved(compiler); | 717 metadata.ensureResolved(compiler); |
| 718 } | 718 } |
| 719 |
| 720 // Force resolution of metadata on non-instance members since they may be |
| 721 // inspected by the backend while emitting. Metadata on instance members is |
| 722 // handled as a result of processing instantiated class members in the |
| 723 // enqueuer. |
| 724 // TODO(ahe): Avoid this eager resolution. |
| 725 element.forEachMember((_, Element member) { |
| 726 if (!member.isInstanceMember()) { |
| 727 compiler.withCurrentElement(member, () { |
| 728 for (MetadataAnnotation metadata in member.metadata) { |
| 729 metadata.ensureResolved(compiler); |
| 730 } |
| 731 }); |
| 732 } |
| 733 }); |
| 719 } | 734 } |
| 720 | 735 |
| 721 void checkClass(ClassElement element) { | 736 void checkClass(ClassElement element) { |
| 722 if (element.isMixinApplication) { | 737 if (element.isMixinApplication) { |
| 723 checkMixinApplication(element); | 738 checkMixinApplication(element); |
| 724 } else { | 739 } else { |
| 725 checkClassMembers(element); | 740 checkClassMembers(element); |
| 726 } | 741 } |
| 727 } | 742 } |
| 728 | 743 |
| (...skipping 3913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4642 return finishConstructorReference(visit(expression), | 4657 return finishConstructorReference(visit(expression), |
| 4643 expression, expression); | 4658 expression, expression); |
| 4644 } | 4659 } |
| 4645 } | 4660 } |
| 4646 | 4661 |
| 4647 /// Looks up [name] in [scope] and unwraps the result. | 4662 /// Looks up [name] in [scope] and unwraps the result. |
| 4648 Element lookupInScope(Compiler compiler, Node node, | 4663 Element lookupInScope(Compiler compiler, Node node, |
| 4649 Scope scope, SourceString name) { | 4664 Scope scope, SourceString name) { |
| 4650 return Elements.unwrap(scope.lookup(name), compiler, node); | 4665 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4651 } | 4666 } |
| OLD | NEW |