| 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 | 312 |
| 313 WorldImpact worldImpact = | 313 WorldImpact worldImpact = |
| 314 compiler.resolution.getWorldImpact(analyzableElement); | 314 compiler.resolution.getWorldImpact(analyzableElement); |
| 315 elements.addAll(worldImpact.staticUses); | 315 elements.addAll(worldImpact.staticUses); |
| 316 elements.addAll(worldImpact.closures); | 316 elements.addAll(worldImpact.closures); |
| 317 for (DartType type in worldImpact.typeLiterals) { | 317 for (DartType type in worldImpact.typeLiterals) { |
| 318 if (type.isTypedef || type.isInterfaceType) { | 318 if (type.isTypedef || type.isInterfaceType) { |
| 319 elements.add(type.element); | 319 elements.add(type.element); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 for (InterfaceType type in worldImpact.instantiatedTypes) { | 322 worldImpact.instantiatedTypes.forEach(collectTypeDependencies); |
| 323 elements.add(type.element); | 323 worldImpact.isChecks.forEach(collectTypeDependencies); |
| 324 worldImpact.asCasts.forEach(collectTypeDependencies); |
| 325 worldImpact.onCatchTypes.forEach(collectTypeDependencies); |
| 326 if (compiler.enableTypeAssertions) { |
| 327 worldImpact.checkedModeChecks.forEach(collectTypeDependencies); |
| 324 } | 328 } |
| 325 | 329 |
| 326 TreeElements treeElements = analyzableElement.resolvedAst.elements; | 330 TreeElements treeElements = analyzableElement.resolvedAst.elements; |
| 327 assert(treeElements != null); | 331 assert(treeElements != null); |
| 328 | 332 |
| 329 for (DartType type in treeElements.requiredTypes) { | |
| 330 collectTypeDependencies(type); | |
| 331 } | |
| 332 | |
| 333 treeElements.forEachConstantNode((Node node, _) { | 333 treeElements.forEachConstantNode((Node node, _) { |
| 334 // Explicitly depend on the backend constants. | 334 // Explicitly depend on the backend constants. |
| 335 ConstantValue value = | 335 ConstantValue value = |
| 336 backend.constants.getConstantValueForNode(node, treeElements); | 336 backend.constants.getConstantValueForNode(node, treeElements); |
| 337 if (value != null) { | 337 if (value != null) { |
| 338 // TODO(johnniwinther): Assert that all constants have values when | 338 // TODO(johnniwinther): Assert that all constants have values when |
| 339 // these are directly evaluated. | 339 // these are directly evaluated. |
| 340 constants.add(value); | 340 constants.add(value); |
| 341 } | 341 } |
| 342 }); | 342 }); |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 return result; | 982 return result; |
| 983 } | 983 } |
| 984 | 984 |
| 985 bool operator ==(other) { | 985 bool operator ==(other) { |
| 986 if (other is! _DeclaredDeferredImport) return false; | 986 if (other is! _DeclaredDeferredImport) return false; |
| 987 return declaration == other.declaration; | 987 return declaration == other.declaration; |
| 988 } | 988 } |
| 989 | 989 |
| 990 int get hashCode => declaration.hashCode * 17; | 990 int get hashCode => declaration.hashCode * 17; |
| 991 } | 991 } |
| OLD | NEW |