| 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 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 element.supertypeLoadState = STATE_DONE; | 938 element.supertypeLoadState = STATE_DONE; |
| 939 element.resolutionState = STATE_DONE; | 939 element.resolutionState = STATE_DONE; |
| 940 // TODO(johnniwinther): Check matching type variables and | 940 // TODO(johnniwinther): Check matching type variables and |
| 941 // empty extends/implements clauses. | 941 // empty extends/implements clauses. |
| 942 } | 942 } |
| 943 } | 943 } |
| 944 | 944 |
| 945 void _postProcessClassElement(BaseClassElementX element) { | 945 void _postProcessClassElement(BaseClassElementX element) { |
| 946 for (MetadataAnnotation metadata in element.metadata) { | 946 for (MetadataAnnotation metadata in element.metadata) { |
| 947 metadata.ensureResolved(compiler); | 947 metadata.ensureResolved(compiler); |
| 948 if (!element.isProxy && | 948 if (!element.isProxy) { |
| 949 metadata.constant.value == compiler.proxyConstant) { | 949 ConstantExpression constantExpression = metadata.constant; |
| 950 element.isProxy = true; | 950 if (constantExpression != null) { |
| 951 ConstantValue constant = constantExpression.value; |
| 952 if (constant.isConstructedObject) { |
| 953 ObjectConstantValue object = constant; |
| 954 if (object.type.element == compiler.proxyClass) { |
| 955 element.isProxy = true; |
| 956 } |
| 957 } |
| 958 } |
| 951 } | 959 } |
| 952 } | 960 } |
| 953 | 961 |
| 954 // Force resolution of metadata on non-instance members since they may be | 962 // Force resolution of metadata on non-instance members since they may be |
| 955 // inspected by the backend while emitting. Metadata on instance members is | 963 // inspected by the backend while emitting. Metadata on instance members is |
| 956 // handled as a result of processing instantiated class members in the | 964 // handled as a result of processing instantiated class members in the |
| 957 // enqueuer. | 965 // enqueuer. |
| 958 // TODO(ahe): Avoid this eager resolution. | 966 // TODO(ahe): Avoid this eager resolution. |
| 959 element.forEachMember((_, Element member) { | 967 element.forEachMember((_, Element member) { |
| 960 if (!member.isInstanceMember) { | 968 if (!member.isInstanceMember) { |
| (...skipping 4092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5053 } | 5061 } |
| 5054 | 5062 |
| 5055 /// The result for the resolution of the `assert` method. | 5063 /// The result for the resolution of the `assert` method. |
| 5056 class AssertResult implements ResolutionResult { | 5064 class AssertResult implements ResolutionResult { |
| 5057 const AssertResult(); | 5065 const AssertResult(); |
| 5058 | 5066 |
| 5059 Element get element => null; | 5067 Element get element => null; |
| 5060 | 5068 |
| 5061 String toString() => 'AssertResult()'; | 5069 String toString() => 'AssertResult()'; |
| 5062 } | 5070 } |
| OLD | NEW |