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

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') | pkg/compiler/lib/src/enqueue.dart » ('J')
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 b5bb9598645c09d35f4866459e71eafae06c8e49..dc4fd9fb8adcb8e3b0feffe547a217a6247757b0 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -363,6 +363,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
@@ -492,6 +497,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.deps[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') | pkg/compiler/lib/src/enqueue.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698