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 Setlet<Node> get superUses; | 9 Setlet<Node> get superUses; |
10 | 10 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 // Stepwise assignment to ensure invariant. | 729 // Stepwise assignment to ensure invariant. |
730 element.supertypeLoadState = STATE_STARTED; | 730 element.supertypeLoadState = STATE_STARTED; |
731 element.supertypeLoadState = STATE_DONE; | 731 element.supertypeLoadState = STATE_DONE; |
732 element.resolutionState = STATE_DONE; | 732 element.resolutionState = STATE_DONE; |
733 // TODO(johnniwinther): Check matching type variables and | 733 // TODO(johnniwinther): Check matching type variables and |
734 // empty extends/implements clauses. | 734 // empty extends/implements clauses. |
735 } | 735 } |
736 for (MetadataAnnotation metadata in element.metadata) { | 736 for (MetadataAnnotation metadata in element.metadata) { |
737 metadata.ensureResolved(compiler); | 737 metadata.ensureResolved(compiler); |
738 } | 738 } |
| 739 |
| 740 // Force resolution of metadata on non-instance members since they may be |
| 741 // inspected by the backend while emitting. Metadata on instance members is |
| 742 // handled as a result of processing instantiated class members in the |
| 743 // enqueuer. |
| 744 // TODO(ahe): Avoid this eager resolution. |
| 745 element.forEachMember((_, Element member) { |
| 746 if (!member.isInstanceMember()) { |
| 747 compiler.withCurrentElement(member, () { |
| 748 for (MetadataAnnotation metadata in member.metadata) { |
| 749 metadata.ensureResolved(compiler); |
| 750 } |
| 751 }); |
| 752 } |
| 753 }); |
739 } | 754 } |
740 | 755 |
741 void checkClass(ClassElement element) { | 756 void checkClass(ClassElement element) { |
742 if (element.isMixinApplication) { | 757 if (element.isMixinApplication) { |
743 checkMixinApplication(element); | 758 checkMixinApplication(element); |
744 } else { | 759 } else { |
745 checkClassMembers(element); | 760 checkClassMembers(element); |
746 } | 761 } |
747 } | 762 } |
748 | 763 |
(...skipping 3911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4660 return finishConstructorReference(visit(expression), | 4675 return finishConstructorReference(visit(expression), |
4661 expression, expression); | 4676 expression, expression); |
4662 } | 4677 } |
4663 } | 4678 } |
4664 | 4679 |
4665 /// Looks up [name] in [scope] and unwraps the result. | 4680 /// Looks up [name] in [scope] and unwraps the result. |
4666 Element lookupInScope(Compiler compiler, Node node, | 4681 Element lookupInScope(Compiler compiler, Node node, |
4667 Scope scope, SourceString name) { | 4682 Scope scope, SourceString name) { |
4668 return Elements.unwrap(scope.lookup(name), compiler, node); | 4683 return Elements.unwrap(scope.lookup(name), compiler, node); |
4669 } | 4684 } |
OLD | NEW |