| 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 'common.dart'; | 7 import 'common.dart'; |
| 8 import 'common/backend_api.dart' show | 8 import 'common/backend_api.dart' show |
| 9 Backend; | 9 Backend; |
| 10 import 'common/tasks.dart' show | 10 import 'common/tasks.dart' show |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 AstElement analyzableElement = element.analyzableElement.declaration; | 312 AstElement analyzableElement = element.analyzableElement.declaration; |
| 313 if (!compiler.enqueuer.resolution.hasBeenProcessed(analyzableElement)) { | 313 if (!compiler.enqueuer.resolution.hasBeenProcessed(analyzableElement)) { |
| 314 return; | 314 return; |
| 315 } | 315 } |
| 316 | 316 |
| 317 WorldImpact worldImpact = | 317 WorldImpact worldImpact = |
| 318 compiler.resolution.getWorldImpact(analyzableElement); | 318 compiler.resolution.getWorldImpact(analyzableElement); |
| 319 worldImpact.staticUses.forEach((StaticUse staticUse) { | 319 worldImpact.staticUses.forEach((StaticUse staticUse) { |
| 320 elements.add(staticUse.element); | 320 elements.add(staticUse.element); |
| 321 }); | 321 }); |
| 322 elements.addAll(worldImpact.closures); | |
| 323 for (TypeUse typeUse in worldImpact.typeUses) { | 322 for (TypeUse typeUse in worldImpact.typeUses) { |
| 324 DartType type = typeUse.type; | 323 DartType type = typeUse.type; |
| 325 switch (typeUse.kind) { | 324 switch (typeUse.kind) { |
| 326 case TypeUseKind.TYPE_LITERAL: | 325 case TypeUseKind.TYPE_LITERAL: |
| 327 if (type.isTypedef || type.isInterfaceType) { | 326 if (type.isTypedef || type.isInterfaceType) { |
| 328 elements.add(type.element); | 327 elements.add(type.element); |
| 329 } | 328 } |
| 330 break; | 329 break; |
| 331 case TypeUseKind.INSTANTIATION: | 330 case TypeUseKind.INSTANTIATION: |
| 332 case TypeUseKind.IS_CHECK: | 331 case TypeUseKind.IS_CHECK: |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 return result; | 996 return result; |
| 998 } | 997 } |
| 999 | 998 |
| 1000 bool operator ==(other) { | 999 bool operator ==(other) { |
| 1001 if (other is! _DeclaredDeferredImport) return false; | 1000 if (other is! _DeclaredDeferredImport) return false; |
| 1002 return declaration == other.declaration; | 1001 return declaration == other.declaration; |
| 1003 } | 1002 } |
| 1004 | 1003 |
| 1005 int get hashCode => declaration.hashCode * 17; | 1004 int get hashCode => declaration.hashCode * 17; |
| 1006 } | 1005 } |
| OLD | NEW |