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

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

Issue 2716713003: Move main and isolate handling to enqueuer listeners. (Closed)
Patch Set: Created 3 years, 10 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/common_elements.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/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 1bd7532dec2009703829b8fa1c9505f1a943f3cd..3632c774ddcf819b54f5a768ae377d13033da30a 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -620,16 +620,15 @@ abstract class Compiler implements LibraryLoaderListener {
enqueuer.resolution
.applyImpact(backend.computeDeferredLoadingImpact());
}
- // Elements required by enqueueHelpers are global dependencies
- // that are not pulled in by a particular element.
- enqueuer.resolution.applyImpact(backend.computeHelpersImpact());
resolveLibraryMetadata();
reporter.log('Resolving...');
+ MethodElement mainMethod;
if (mainFunction != null && !mainFunction.isMalformed) {
mainFunction.computeType(resolution);
+ mainMethod = mainFunction;
}
- processQueue(enqueuer.resolution, mainFunction,
+ processQueue(enqueuer.resolution, mainMethod, libraryLoader.libraries,
onProgress: showResolutionProgress);
enqueuer.resolution.logSummary(reporter.log);
@@ -687,7 +686,7 @@ abstract class Compiler implements LibraryLoaderListener {
enqueuer.codegen.applyImpact(computeImpactForLibrary(library));
});
}
- processQueue(enqueuer.codegen, mainFunction,
+ processQueue(enqueuer.codegen, mainMethod, libraryLoader.libraries,
onProgress: showCodegenProgress);
enqueuer.codegen.logSummary(reporter.log);
@@ -808,15 +807,10 @@ abstract class Compiler implements LibraryLoaderListener {
}
void processQueue(Enqueuer enqueuer, MethodElement mainMethod,
+ Iterable<LibraryEntity> libraries,
{void onProgress()}) {
selfTask.measureSubtask("Compiler.processQueue", () {
- enqueuer.open(impactStrategy);
- enqueuer.applyImpact(enqueuer.nativeEnqueuer
- .processNativeClasses(libraryLoader.libraries));
- if (mainMethod != null && !mainMethod.isMalformed) {
- enqueuer.applyImpact(backend.computeMainImpact(mainMethod,
- forResolution: enqueuer.isResolutionQueue));
- }
+ enqueuer.open(impactStrategy, mainMethod, libraries);
if (options.verbose) {
progress.reset();
}
@@ -1928,6 +1922,12 @@ class _CompilerElementEnvironment implements ElementEnvironment {
Resolution get _resolution => _compiler.resolution;
@override
+ LibraryEntity get mainLibrary => _compiler.mainApp;
+
+ @override
+ FunctionEntity get mainFunction => _compiler.mainFunction;
+
+ @override
ResolutionInterfaceType getThisType(ClassElement cls) {
cls.ensureResolved(_resolution);
return cls.thisType;
« no previous file with comments | « pkg/compiler/lib/src/common_elements.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698