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

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

Issue 1279093003: dart2js: dump info about dependencies added by the enqueuer (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | 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/dump_info.dart
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 49180d92bf6901bbf8efc45d407814aeeea9348f..2b096a4f4955e25a2f8a03599a319440692ba1f8 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -367,6 +367,11 @@ class DumpInfoTask extends CompilerTask {
}
}
+ final Map<Element, List<Element>> _dependencies = {};
+ void registerDependency(Element source, Element target) {
+ _dependencies.putIfAbsent(source, () => new Set()).add(target);
+ }
+
/**
* Returns an iterable of [Selection]s that are used by
* [element]. Each [Selection] contains an element that is
@@ -496,6 +501,16 @@ class DumpInfoTask extends CompilerTask {
}
AllInfo result = infoCollector.result;
+
+ for (Element element in _dependencies.keys) {
+ var a = infoCollector._elementToInfo[element];
+ if (a == null) continue;
+ result.dependencies[a] = _dependencies[element]
+ .map((o) => infoCollector._elementToInfo[o])
+ .where((o) => o != null)
+ .toList();
+ }
+
result.deferredFiles = compiler.deferredLoadTask.computeDeferredMap();
stopwatch.stop();
result.program = new ProgramInfo(
« no previous file with comments | « no previous file | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698