| 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 66e73c309adc9454905ccbf67559661f267a9644..3f003a5b6bbc7d3d80d4522543bab95cb813a382 100644
|
| --- a/pkg/compiler/lib/src/deferred_load.dart
|
| +++ b/pkg/compiler/lib/src/deferred_load.dart
|
| @@ -32,6 +32,7 @@ import 'elements/elements.dart'
|
| PrefixElement,
|
| ResolvedAstKind,
|
| TypedefElement;
|
| +import 'elements/entities.dart';
|
| import 'js_backend/js_backend.dart' show JavaScriptBackend;
|
| import 'js_backend/backend_usage.dart' show BackendUsage;
|
| import 'resolution/resolution.dart' show AnalyzableElementX;
|
| @@ -661,13 +662,14 @@ class DeferredLoadTask extends CompilerTask {
|
| }
|
| }
|
|
|
| - void onResolutionComplete(FunctionElement main) {
|
| + void onResolutionComplete(FunctionEntity main) {
|
| if (!isProgramSplit) {
|
| allOutputUnits.add(mainOutputUnit);
|
| return;
|
| }
|
| if (main == null) return;
|
| - LibraryElement mainLibrary = main.library;
|
| + MethodElement mainMethod = main;
|
| + LibraryElement mainLibrary = mainMethod.library;
|
| _importedDeferredBy = new Map<_DeferredImport, Set<Element>>();
|
| _constantsDeferredBy = new Map<_DeferredImport, Set<ConstantValue>>();
|
| _importedDeferredBy[_fakeMainImport] = _mainElements;
|
| @@ -677,8 +679,7 @@ class DeferredLoadTask extends CompilerTask {
|
| () => measure(() {
|
| // Starting from main, traverse the program and find all
|
| // dependencies.
|
| - _mapDependencies(
|
| - element: compiler.mainFunction, import: _fakeMainImport);
|
| + _mapDependencies(element: mainMethod, import: _fakeMainImport);
|
|
|
| // Also add "global" dependencies to the main OutputUnit. These
|
| // are things that the backend needs but cannot associate with a
|
| @@ -771,6 +772,8 @@ class DeferredLoadTask extends CompilerTask {
|
|
|
| void beforeResolution(Compiler compiler) {
|
| if (compiler.mainApp == null) return;
|
| + // TODO(johnniwinther): Support deferred load for kernel based elements.
|
| + if (compiler.options.loadFromDill) return;
|
| _allDeferredImports[_fakeMainImport] = compiler.mainApp;
|
| var lastDeferred;
|
| // When detecting duplicate prefixes of deferred libraries there are 4
|
|
|