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

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

Issue 2936233003: Remove Compiler.mainApp and Compiler.mainFunction (Closed)
Patch Set: Created 3 years, 6 months 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/compiler.dart ('k') | pkg/compiler/lib/src/dump_info.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 77d9266b5a19fd28d376ec1dcd017154bb4fb5d6..d233398127bc1fcc50a7ee289ba2a9f2067c53cd 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -791,11 +791,11 @@ class DeferredLoadTask extends CompilerTask {
compiler.impactStrategy.onImpactUsed(IMPACT_USE);
}
- void beforeResolution(Compiler compiler) {
- if (compiler.mainApp == null) return;
+ void beforeResolution(LibraryEntity mainLibrary) {
+ if (mainLibrary == null) return;
// TODO(johnniwinther): Support deferred load for kernel based elements.
if (compiler.options.loadFromDill) return;
- _allDeferredImports[_fakeMainImport] = compiler.mainApp;
+ _allDeferredImports[_fakeMainImport] = mainLibrary;
var lastDeferred;
// When detecting duplicate prefixes of deferred libraries there are 4
// cases of duplicate prefixes:
@@ -855,8 +855,9 @@ class DeferredLoadTask extends CompilerTask {
import, MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX);
} else {
prefixDeferredImport[prefix] = import;
+ Uri mainLibraryUri = compiler.mainLibraryUri;
_deferredImportDescriptions[key] =
- new ImportDescription(import, library, compiler);
+ new ImportDescription(import, library, mainLibraryUri);
}
isProgramSplit = true;
lastDeferred = import;
@@ -1031,9 +1032,9 @@ class ImportDescription {
final LibraryElement _importingLibrary;
ImportDescription(
- ImportElement import, LibraryElement importingLibrary, Compiler compiler)
- : importingUri = uri_extras.relativize(compiler.mainApp.canonicalUri,
- importingLibrary.canonicalUri, false),
+ ImportElement import, LibraryElement importingLibrary, Uri mainLibraryUri)
+ : importingUri = uri_extras.relativize(
+ mainLibraryUri, importingLibrary.canonicalUri, false),
prefix = import.prefix.name,
_importingLibrary = importingLibrary;
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/dump_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698