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

Unified Diff: pkg/compiler/lib/src/info/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 | « pkg/compiler/lib/src/enqueue.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/info/info.dart
diff --git a/pkg/compiler/lib/src/info/info.dart b/pkg/compiler/lib/src/info/info.dart
index 843d69c14436eb5f2bbf2dba63decf24154771fa..00908bae3ec32af864e7621fb6d19c98a48d6746 100644
--- a/pkg/compiler/lib/src/info/info.dart
+++ b/pkg/compiler/lib/src/info/info.dart
@@ -119,6 +119,12 @@ class AllInfo {
// the same map that is created for the `--deferred-map` flag.
Map<String, Map<String, dynamic>> deferredFiles;
+ /// A new representation of dependencies form one info to another. An entry in
+ /// this map indicates that an Info depends on another (e.g. a function
+ /// invokes another). Please note that the data in this field might not be
+ /// accurate yet (this is work in progress).
+ Map<Info, List<Info>> dependencies = {};
+
/// Major version indicating breaking changes in the format. A new version
/// means that an old deserialization algorithm will not work with the new
/// format.
@@ -129,7 +135,7 @@ class AllInfo {
/// previous will continue to work after the change. This is typically
/// increased when adding new entries to the file format.
// Note: the dump-info.viewer app was written using a json parser version 3.2.
- final int minorVersion = 4;
+ final int minorVersion = 5;
AllInfo();
@@ -154,6 +160,14 @@ class AllInfo {
return map;
}
+ Map _extractDependencies() {
+ var map = <String, List>{};
+ dependencies.forEach((k, v) {
+ map[k.serializedId] = v.map((i) => i.serializedId).toList();
+ });
+ return map;
+ }
+
Map toJson() => {
'elements': {
'library': _listAsJsonMap(libraries),
@@ -163,6 +177,7 @@ class AllInfo {
'field': _listAsJsonMap(fields),
},
'holding': _extractHoldingInfo(),
+ 'dependencies': _extractDependencies(),
'outputUnits': outputUnits.map((u) => u.toJson()).toList(),
'dump_version': version,
'deferredFiles': deferredFiles,
@@ -240,6 +255,10 @@ class _ParseHelper {
}
});
+ json['dependencies']?.forEach((k, deps) {
+ result.deps[idMap[k]] = deps.map((d) => idMap[d]).toList();
+ });
+
result.program = parseProgram(json['program']);
// todo: version, etc
return result;
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698