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

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

Issue 2709043002: remove old way of collecting dependencies for dump-info (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 | « no previous file | 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/dump_info.dart
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 9f1efbc8824981909919fbab88743c0fdfbdc5d4..619329b40b7c27659558a5cb2960b6c3d61250b0 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -418,21 +418,18 @@ class DumpInfoTask extends CompilerTask implements InfoReporter {
}
void reportInlined(Element element, Element inlinedFrom) {
+ if (element.isPatch) {
Johnni Winther 2017/02/22 13:29:38 Equivalent to `element = element.declaration`.
Harry Terkelsen 2017/02/22 20:53:14 Done.
+ element = element.origin;
+ }
+ if (inlinedFrom.isPatch) {
+ inlinedFrom = inlinedFrom.origin;
+ }
inlineCount.putIfAbsent(element, () => 0);
inlineCount[element] += 1;
inlineMap.putIfAbsent(inlinedFrom, () => new List<Element>());
inlineMap[inlinedFrom].add(element);
}
- final Map<Element, Set<Element>> _dependencies = {};
- void registerDependency(Element target) {
- if (compiler.options.dumpInfo) {
- _dependencies
- .putIfAbsent(compiler.currentElement, () => new Set())
- .add(target);
- }
- }
-
void registerImpact(Element element, WorldImpact impact) {
if (compiler.options.dumpInfo) {
impacts[element] = impact;
@@ -550,6 +547,8 @@ class DumpInfoTask extends CompilerTask implements InfoReporter {
Stopwatch stopwatch = new Stopwatch();
stopwatch.start();
+ AllInfo result = infoCollector.result;
+
// Recursively build links to function uses
Iterable<Element> functionElements =
infoCollector._elementToInfo.keys.where((k) => k is FunctionElement);
@@ -564,6 +563,21 @@ class DumpInfoTask extends CompilerTask implements InfoReporter {
info.uses.add(new DependencyInfo(useInfo, '${selection.mask}'));
}
}
+
+ // Recursively build links to field uses
+ Iterable<Element> fieldElements =
+ infoCollector._elementToInfo.keys.where((k) => k is FieldElement);
+ for (FieldElement element in fieldElements) {
+ FieldInfo info = infoCollector._elementToInfo[element];
+ Iterable<Selection> uses = getRetaining(element, closedWorld);
+ // Don't bother recording an empty list of dependencies.
+ for (Selection selection in uses) {
+ Info useInfo = infoCollector._elementToInfo[selection.selectedElement];
+ if (useInfo == null) continue;
+ info.uses.add(new DependencyInfo(useInfo, '${selection.mask}'));
+ }
+ }
+
// Notify the impact strategy impacts are no longer needed for dump info.
compiler.impactStrategy.onImpactUsed(IMPACT_USE);
@@ -578,17 +592,6 @@ class DumpInfoTask extends CompilerTask implements InfoReporter {
}
}
- 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/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698