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/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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 : import; | 836 : import; |
837 reporter.reportErrorMessage(failingImport.prefix, | 837 reporter.reportErrorMessage(failingImport.prefix, |
838 MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX); | 838 MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX); |
839 } | 839 } |
840 usedPrefixes.add(prefix); | 840 usedPrefixes.add(prefix); |
841 } | 841 } |
842 } | 842 } |
843 }); | 843 }); |
844 } | 844 } |
845 if (isProgramSplit) { | 845 if (isProgramSplit) { |
846 isProgramSplit = compiler.backend.enableDeferredLoadingIfSupported( | 846 isProgramSplit = |
847 compiler.enqueuer.resolution, lastDeferred); | 847 compiler.backend.enableDeferredLoadingIfSupported(lastDeferred); |
848 } | 848 } |
849 } | 849 } |
850 | 850 |
851 /// 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 |
852 /// [PrefixElement] that the first prefix of the send resolves to. | 852 /// [PrefixElement] that the first prefix of the send resolves to. |
853 /// Otherwise returns null. | 853 /// Otherwise returns null. |
854 /// | 854 /// |
855 /// Precondition: send must be static. | 855 /// Precondition: send must be static. |
856 /// | 856 /// |
857 /// Example: | 857 /// Example: |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 | 1052 |
1053 bool operator ==(other) { | 1053 bool operator ==(other) { |
1054 if (other is! _DeclaredDeferredImport) return false; | 1054 if (other is! _DeclaredDeferredImport) return false; |
1055 return declaration == other.declaration; | 1055 return declaration == other.declaration; |
1056 } | 1056 } |
1057 | 1057 |
1058 int get hashCode => declaration.hashCode * 17; | 1058 int get hashCode => declaration.hashCode * 17; |
1059 | 1059 |
1060 String toString() => '$declaration'; | 1060 String toString() => '$declaration'; |
1061 } | 1061 } |
OLD | NEW |