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

Side by Side Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 2494093002: Refactor enqueuers (Closed)
Patch Set: Updated cf. comments. Created 4 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/backend_api.dart' show Backend; 7 import 'common/backend_api.dart' show Backend;
8 import 'common/tasks.dart' show CompilerTask; 8 import 'common/tasks.dart' show CompilerTask;
9 import 'common.dart'; 9 import 'common.dart';
10 import 'compiler.dart' show Compiler; 10 import 'compiler.dart' show Compiler;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 339 }
340 }, visitTypeUse: (TypeUse typeUse) { 340 }, visitTypeUse: (TypeUse typeUse) {
341 DartType type = typeUse.type; 341 DartType type = typeUse.type;
342 switch (typeUse.kind) { 342 switch (typeUse.kind) {
343 case TypeUseKind.TYPE_LITERAL: 343 case TypeUseKind.TYPE_LITERAL:
344 if (type.isTypedef || type.isInterfaceType) { 344 if (type.isTypedef || type.isInterfaceType) {
345 elements.add(type.element); 345 elements.add(type.element);
346 } 346 }
347 break; 347 break;
348 case TypeUseKind.INSTANTIATION: 348 case TypeUseKind.INSTANTIATION:
349 case TypeUseKind.MIRROR_INSTANTIATION:
350 case TypeUseKind.NATIVE_INSTANTIATION:
349 case TypeUseKind.IS_CHECK: 351 case TypeUseKind.IS_CHECK:
350 case TypeUseKind.AS_CAST: 352 case TypeUseKind.AS_CAST:
351 case TypeUseKind.CATCH_TYPE: 353 case TypeUseKind.CATCH_TYPE:
352 collectTypeDependencies(type); 354 collectTypeDependencies(type);
353 break; 355 break;
354 case TypeUseKind.CHECKED_MODE_CHECK: 356 case TypeUseKind.CHECKED_MODE_CHECK:
355 if (compiler.options.enableTypeAssertions) { 357 if (compiler.options.enableTypeAssertions) {
356 collectTypeDependencies(type); 358 collectTypeDependencies(type);
357 } 359 }
358 break; 360 break;
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 reporter.reportErrorMessage(failingImport.prefix, 837 reporter.reportErrorMessage(failingImport.prefix,
836 MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX); 838 MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX);
837 } 839 }
838 usedPrefixes.add(prefix); 840 usedPrefixes.add(prefix);
839 } 841 }
840 } 842 }
841 }); 843 });
842 } 844 }
843 if (isProgramSplit) { 845 if (isProgramSplit) {
844 isProgramSplit = compiler.backend.enableDeferredLoadingIfSupported( 846 isProgramSplit = compiler.backend.enableDeferredLoadingIfSupported(
845 lastDeferred, compiler.globalDependencies); 847 compiler.enqueuer.resolution, lastDeferred);
846 } 848 }
847 } 849 }
848 850
849 /// If [send] is a static send with a deferred element, returns the 851 /// If [send] is a static send with a deferred element, returns the
850 /// [PrefixElement] that the first prefix of the send resolves to. 852 /// [PrefixElement] that the first prefix of the send resolves to.
851 /// Otherwise returns null. 853 /// Otherwise returns null.
852 /// 854 ///
853 /// Precondition: send must be static. 855 /// Precondition: send must be static.
854 /// 856 ///
855 /// Example: 857 /// Example:
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 1052
1051 bool operator ==(other) { 1053 bool operator ==(other) {
1052 if (other is! _DeclaredDeferredImport) return false; 1054 if (other is! _DeclaredDeferredImport) return false;
1053 return declaration == other.declaration; 1055 return declaration == other.declaration;
1054 } 1056 }
1055 1057
1056 int get hashCode => declaration.hashCode * 17; 1058 int get hashCode => declaration.hashCode * 17;
1057 1059
1058 String toString() => '$declaration'; 1060 String toString() => '$declaration';
1059 } 1061 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698