Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 1422623014: Add TypeUse. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/dart_backend.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index ab4f1cad961ce585453b5ebe6636f775a580bc51..7ababab27fd66e290efde20c05ca85c85ea54bc4 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -48,7 +48,9 @@ import 'tree/tree.dart' show
NewExpression,
Node;
import 'universe/use.dart' show
- StaticUse;
+ StaticUse,
+ TypeUse,
+ TypeUseKind;
import 'universe/world_impact.dart' show
WorldImpact;
import 'util/setlet.dart' show
@@ -318,18 +320,27 @@ class DeferredLoadTask extends CompilerTask {
elements.add(staticUse.element);
});
elements.addAll(worldImpact.closures);
- for (DartType type in worldImpact.typeLiterals) {
- if (type.isTypedef || type.isInterfaceType) {
- elements.add(type.element);
+ for (TypeUse typeUse in worldImpact.typeUses) {
+ DartType type = typeUse.type;
+ switch (typeUse.kind) {
+ case TypeUseKind.TYPE_LITERAL:
+ if (type.isTypedef || type.isInterfaceType) {
+ elements.add(type.element);
+ }
+ break;
+ case TypeUseKind.INSTANTIATION:
+ case TypeUseKind.IS_CHECK:
+ case TypeUseKind.AS_CAST:
+ case TypeUseKind.CATCH_TYPE:
+ collectTypeDependencies(type);
+ break;
+ case TypeUseKind.CHECKED_MODE_CHECK:
+ if (compiler.enableTypeAssertions) {
+ collectTypeDependencies(type);
+ }
+ break;
}
}
- worldImpact.instantiatedTypes.forEach(collectTypeDependencies);
- worldImpact.isChecks.forEach(collectTypeDependencies);
- worldImpact.asCasts.forEach(collectTypeDependencies);
- worldImpact.onCatchTypes.forEach(collectTypeDependencies);
- if (compiler.enableTypeAssertions) {
- worldImpact.checkedModeChecks.forEach(collectTypeDependencies);
- }
TreeElements treeElements = analyzableElement.resolvedAst.elements;
assert(treeElements != null);
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/dart_backend.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698