| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library deferred_load; | 5 library deferred_load; |
| 6 | 6 |
| 7 import 'constants/expressions.dart'; | 7 import 'constants/expressions.dart'; |
| 8 import 'constants/values.dart' show | 8 import 'constants/values.dart' show |
| 9 ConstantValue, | 9 ConstantValue, |
| 10 ConstructedConstantValue, | 10 ConstructedConstantValue, |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 backend.constants.getConstantForMetadata(metadata); | 289 backend.constants.getConstantForMetadata(metadata); |
| 290 if (constant != null) { | 290 if (constant != null) { |
| 291 addConstants(constant.value); | 291 addConstants(constant.value); |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 if (element.isClass) { | 294 if (element.isClass) { |
| 295 // If we see a class, add everything its live instance members refer | 295 // If we see a class, add everything its live instance members refer |
| 296 // to. Static members are not relevant, unless we are processing | 296 // to. Static members are not relevant, unless we are processing |
| 297 // extra dependencies due to mirrors. | 297 // extra dependencies due to mirrors. |
| 298 void addLiveInstanceMember(Element element) { | 298 void addLiveInstanceMember(Element element) { |
| 299 if (!compiler.enqueuer.resolution.isLive(element)) return; | 299 if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return; |
| 300 if (!isMirrorUsage && !element.isInstanceMember) return; | 300 if (!isMirrorUsage && !element.isInstanceMember) return; |
| 301 collectDependencies(element.implementation); | 301 collectDependencies(element.implementation); |
| 302 } | 302 } |
| 303 ClassElement cls = element.declaration; | 303 ClassElement cls = element.declaration; |
| 304 cls.forEachLocalMember(addLiveInstanceMember); | 304 cls.forEachLocalMember(addLiveInstanceMember); |
| 305 if (cls.implementation != cls) { | 305 if (cls.implementation != cls) { |
| 306 // TODO(ahe): Why doesn't ClassElement.forEachLocalMember do this? | 306 // TODO(ahe): Why doesn't ClassElement.forEachLocalMember do this? |
| 307 cls.implementation.forEachLocalMember(addLiveInstanceMember); | 307 cls.implementation.forEachLocalMember(addLiveInstanceMember); |
| 308 } | 308 } |
| 309 for (var type in cls.implementation.allSupertypes) { | 309 for (var type in cls.implementation.allSupertypes) { |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 Element maybePrefix = elements[identifier]; | 758 Element maybePrefix = elements[identifier]; |
| 759 if (maybePrefix != null && maybePrefix.isPrefix) { | 759 if (maybePrefix != null && maybePrefix.isPrefix) { |
| 760 PrefixElement prefixElement = maybePrefix; | 760 PrefixElement prefixElement = maybePrefix; |
| 761 if (prefixElement.isDeferred) { | 761 if (prefixElement.isDeferred) { |
| 762 return prefixElement; | 762 return prefixElement; |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 return null; | 765 return null; |
| 766 } | 766 } |
| 767 } | 767 } |
| OLD | NEW |