Index: sdk/lib/_internal/compiler/implementation/compiler.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart |
index 4bd9a7f12907895d24d383a6cf4053ed140831e1..cf364ec96883fb3ec038ec86710eaa72873c420b 100644 |
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart |
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart |
@@ -508,10 +508,6 @@ abstract class Compiler implements DiagnosticListener { |
static final Uri DART_INTERNAL = new Uri(scheme: 'dart', path: '_internal'); |
static final Uri DART_ASYNC = new Uri(scheme: 'dart', path: 'async'); |
- // TODO(johnniwinther): Move this to [LibraryLoaderTask] and hange to map from |
- // [Uri] to [LibraryElement]. |
- final Map<String, LibraryElement> libraries = |
- new Map<String, LibraryElement>(); |
final Stopwatch totalCompileTime = new Stopwatch(); |
int nextFreeClassId = 0; |
World world; |
@@ -1316,9 +1312,9 @@ abstract class Compiler implements DiagnosticListener { |
phase = PHASE_RESOLVING; |
if (analyzeAll) { |
- libraries.forEach((uri, lib) { |
- log('Enqueuing $uri'); |
- fullyEnqueueLibrary(lib, enqueuer.resolution); |
+ libraryLoader.libraries.forEach((LibraryElement library) { |
+ log('Enqueuing ${library.canonicalUri}'); |
+ fullyEnqueueLibrary(library, enqueuer.resolution); |
}); |
} else if (analyzeMain && mainApp != null) { |
fullyEnqueueLibrary(mainApp, enqueuer.resolution); |
@@ -1388,8 +1384,9 @@ abstract class Compiler implements DiagnosticListener { |
backend.enableNoSuchMethod(enqueuer.codegen); |
} |
if (compileAll) { |
- libraries.forEach((_, lib) => fullyEnqueueLibrary(lib, |
- enqueuer.codegen)); |
+ libraryLoader.libraries.forEach((LibraryElement library) { |
+ fullyEnqueueLibrary(library, enqueuer.codegen); |
+ }); |
} |
processQueue(enqueuer.codegen, main); |
enqueuer.codegen.logSummary(log); |
@@ -1431,7 +1428,7 @@ abstract class Compiler implements DiagnosticListener { |
// resolve metadata classes referenced only from metadata on library tags. |
// TODO(ahe): Figure out how to do this lazily. |
void resolveLibraryMetadata() { |
- for (LibraryElement library in libraries.values) { |
+ for (LibraryElement library in libraryLoader.libraries) { |
if (library.metadata != null) { |
for (MetadataAnnotation metadata in library.metadata) { |
metadata.ensureResolved(this); |
@@ -1441,7 +1438,7 @@ abstract class Compiler implements DiagnosticListener { |
} |
void processQueue(Enqueuer world, Element main) { |
- world.nativeEnqueuer.processNativeClasses(libraries.values); |
+ world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries); |
if (main != null) { |
FunctionElement mainMethod = main; |
if (mainMethod.computeSignature(this).parameterCount != 0) { |
@@ -1799,7 +1796,7 @@ abstract class Compiler implements DiagnosticListener { |
} |
} |
} |
- libraries.forEach((_, library) { |
+ libraryLoader.libraries.forEach((LibraryElement library) { |
// TODO(ahe): Implement better heuristics to discover entry points of |
// packages and use that to discover unused implementation details in |
// packages. |