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

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

Issue 2511403002: Compute [WorldImpact] for main method as entrypoint (Closed)
Patch Set: Updated cf. comments. Created 4 years, 1 month 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/backend_api.dart ('k') | pkg/compiler/lib/src/js_backend/backend.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 ef0e7510beedbbe0846c0e4b637aa4821284da4b..c7bdcdf6191a3a88555adec831f84472a405456d 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -683,6 +683,10 @@ abstract class Compiler implements LibraryLoaderListener {
backend.enqueueHelpers(enqueuer.resolution);
resolveLibraryMetadata();
reporter.log('Resolving...');
+ if (mainFunction != null && !mainFunction.isMalformed) {
+ mainFunction.computeType(resolution);
+ }
+
processQueue(enqueuer.resolution, mainFunction);
enqueuer.resolution.logSummary(reporter.log);
@@ -847,28 +851,15 @@ abstract class Compiler implements LibraryLoaderListener {
});
}
- void processQueue(Enqueuer enqueuer, Element main) {
+ void processQueue(Enqueuer enqueuer, MethodElement mainMethod) {
selfTask.measureSubtask("Compiler.processQueue", () {
enqueuer.applyImpact(
impactStrategy,
enqueuer.nativeEnqueuer
.processNativeClasses(libraryLoader.libraries));
- if (main != null && !main.isMalformed) {
- FunctionElement mainMethod = main;
- mainMethod.computeType(resolution);
- if (mainMethod.functionSignature.parameterCount != 0) {
- // The first argument could be a list of strings.
- backend.backendClasses.listImplementation.ensureResolved(resolution);
- enqueuer.registerInstantiatedType(
- backend.backendClasses.listImplementation.rawType);
- backend.backendClasses.stringImplementation
- .ensureResolved(resolution);
- enqueuer.registerInstantiatedType(
- backend.backendClasses.stringImplementation.rawType);
-
- backend.registerMainHasArguments(enqueuer);
- }
- enqueuer.addToWorkList(main);
+ if (mainMethod != null && !mainMethod.isMalformed) {
+ enqueuer.applyImpact(
+ impactStrategy, backend.computeMainImpact(enqueuer, mainMethod));
}
if (options.verbose) {
progress.reset();
« no previous file with comments | « pkg/compiler/lib/src/common/backend_api.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698