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

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

Issue 2846433003: Run closed_world2_test using the normal compiler pipeline. (Closed)
Patch Set: Updated cf. comments Created 3 years, 8 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/enqueue.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 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698