OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.library_loader; | 5 library dart2js.library_loader; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'common/names.dart' show Uris; | 9 import 'common/names.dart' show Uris; |
10 import 'common/tasks.dart' show CompilerTask, Measurer; | 10 import 'common/tasks.dart' show CompilerTask, Measurer; |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 KernelWorldBuilder _worldBuilder; | 847 KernelWorldBuilder _worldBuilder; |
848 | 848 |
849 List<LibraryEntity> _allLoadedLibraries; | 849 List<LibraryEntity> _allLoadedLibraries; |
850 | 850 |
851 _DillLibraryLoaderTask( | 851 _DillLibraryLoaderTask( |
852 this.uriTranslator, this.scriptLoader, this.reporter, Measurer measurer) | 852 this.uriTranslator, this.scriptLoader, this.reporter, Measurer measurer) |
853 : _allLoadedLibraries = new List<LibraryEntity>(), | 853 : _allLoadedLibraries = new List<LibraryEntity>(), |
854 super(measurer); | 854 super(measurer); |
855 | 855 |
856 /// Loads an entire Kernel [Program] from a file on disk (note, not just a | 856 /// Loads an entire Kernel [Program] from a file on disk (note, not just a |
857 /// library, so this name is actuall a bit of a misnomer). | 857 /// library, so this name is actually a bit of a misnomer). |
858 // TODO(efortuna): Rename this once the Element library loader class goes | 858 // TODO(efortuna): Rename this once the Element library loader class goes |
859 // away. | 859 // away. |
860 Future<LoadedLibraries> loadLibrary(Uri resolvedUri, | 860 Future<LoadedLibraries> loadLibrary(Uri resolvedUri, |
861 {bool skipFileWithPartOfTag: false}) { | 861 {bool skipFileWithPartOfTag: false}) { |
862 assert(resolvedUri.pathSegments.last.endsWith('.dill')); | 862 assert(resolvedUri.pathSegments.last.endsWith('.dill')); |
863 Uri readableUri = uriTranslator.translate(null, resolvedUri, null); | 863 Uri readableUri = uriTranslator.translate(null, resolvedUri, null); |
864 return measure(() async { | 864 return measure(() async { |
865 Script script = await scriptLoader.readScript(readableUri, null); | 865 Script script = await scriptLoader.readScript(readableUri, null); |
866 ir.Program program = new ir.Program(); | 866 ir.Program program = new ir.Program(); |
867 // Hack because the existing file has a terminating 0 and the | 867 // Hack because the existing file has a terminating 0 and the |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 } | 1678 } |
1679 | 1679 |
1680 /// API used by the library loader to synchronously scan a library or | 1680 /// API used by the library loader to synchronously scan a library or |
1681 /// compilation unit and ensure that their library tags are computed. | 1681 /// compilation unit and ensure that their library tags are computed. |
1682 abstract class ElementScanner { | 1682 abstract class ElementScanner { |
1683 void scanLibrary(LibraryElement library); | 1683 void scanLibrary(LibraryElement library); |
1684 void scanUnit(CompilationUnitElement unit); | 1684 void scanUnit(CompilationUnitElement unit); |
1685 } | 1685 } |
1686 | 1686 |
1687 const _reuseLibrarySubtaskName = "Reuse library"; | 1687 const _reuseLibrarySubtaskName = "Reuse library"; |
OLD | NEW |