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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 11293244: Implement --analyze-all option. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index 268c218e42ed373e2b2ffece060cf29de7604e20..03a63a9b466da4f0b0b444239fab860113f61ea7 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -102,6 +102,7 @@ abstract class Compiler implements DiagnosticListener {
final bool enableTypeAssertions;
final bool enableUserAssertions;
final bool enableConcreteTypeInference;
+ final bool analyzeAll;
bool disableInlining = false;
@@ -213,6 +214,7 @@ abstract class Compiler implements DiagnosticListener {
bool emitJavaScript: true,
bool generateSourceMap: true,
bool disallowUnsafeEval: false,
+ this.analyzeAll: false,
List<String> strips: const []})
: libraries = new Map<String, LibraryElement>(),
progress = new Stopwatch() {
@@ -524,6 +526,7 @@ abstract class Compiler implements DiagnosticListener {
log('Resolving...');
phase = PHASE_RESOLVING;
+ if (analyzeAll) libraries.forEach(fullyEnqueueLibrary);
backend.enqueueHelpers(enqueuer.resolution);
processQueue(enqueuer.resolution, main);
log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.');
@@ -549,6 +552,23 @@ abstract class Compiler implements DiagnosticListener {
checkQueues();
}
+ void fullyEnqueueLibrary(_, LibraryElement library) {
karlklose 2012/11/13 08:33:47 The ignored first argument looks a bit strange. Yo
ahe 2012/11/13 13:13:43 Done.
+ library.forEachLocalMember(fullyEnqueueTopLevelElement);
+ }
+
+ void fullyEnqueueTopLevelElement(Element element) {
+ element.computeType(this);
karlklose 2012/11/13 08:33:47 Move this computation to ensureResolved?
ahe 2012/11/13 13:13:43 Well, that wouldn't work. But making sure that al
+ if (element.isClass()) {
+ resolver.resolve(element);
karlklose 2012/11/13 08:33:47 Why do you not use ensureResolved here? Is it to m
ahe 2012/11/13 13:13:43 Done.
+ ClassElement cls = element;
+ for (Element member in cls.localMembers) {
+ enqueuer.resolution.addToWorkList(member);
+ }
+ } else {
+ enqueuer.resolution.addToWorkList(element);
+ }
+ }
+
void processQueue(Enqueuer world, Element main) {
backend.processNativeClasses(world, libraries.values);
world.addToWorkList(main);

Powered by Google App Engine
This is Rietveld 408576698