Chromium Code Reviews| 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. | |
|
kasperl
2013/10/18 08:53:07
Maybe update the comment so it's clear where we de
Johnni Winther
2013/10/18 09:09:00
Done.
| |
| 742 // TODO(ahe): Avoid this eager resolution. | |
| 743 element.forEachMember((_, Element member) { | |
| 744 if (!member.isInstanceMember()) { | |
| 745 compiler.withCurrentElement(member, () { | |
| 746 for (MetadataAnnotation metadata in member.metadata) { | |
| 747 metadata.ensureResolved(compiler); | |
| 748 } | |
| 749 }); | |
| 750 } | |
| 751 }); | |
| 752 | |
|
kasperl
2013/10/18 08:53:07
Remove newline.
Johnni Winther
2013/10/18 09:09:00
Done.
| |
| 739 } | 753 } |
| 740 | 754 |
| 741 void checkClass(ClassElement element) { | 755 void checkClass(ClassElement element) { |
| 742 if (element.isMixinApplication) { | 756 if (element.isMixinApplication) { |
| 743 checkMixinApplication(element); | 757 checkMixinApplication(element); |
| 744 } else { | 758 } else { |
| 745 checkClassMembers(element); | 759 checkClassMembers(element); |
| 746 } | 760 } |
| 747 } | 761 } |
| 748 | 762 |
| (...skipping 3911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4660 return finishConstructorReference(visit(expression), | 4674 return finishConstructorReference(visit(expression), |
| 4661 expression, expression); | 4675 expression, expression); |
| 4662 } | 4676 } |
| 4663 } | 4677 } |
| 4664 | 4678 |
| 4665 /// Looks up [name] in [scope] and unwraps the result. | 4679 /// Looks up [name] in [scope] and unwraps the result. |
| 4666 Element lookupInScope(Compiler compiler, Node node, | 4680 Element lookupInScope(Compiler compiler, Node node, |
| 4667 Scope scope, SourceString name) { | 4681 Scope scope, SourceString name) { |
| 4668 return Elements.unwrap(scope.lookup(name), compiler, node); | 4682 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4669 } | 4683 } |
| OLD | NEW |