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

Unified Diff: pkg/compiler/tool/util.dart

Issue 1298553002: dart2js: switch to use dart2js_info/info.dart (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/tool/library_size_split.dart ('k') | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/tool/util.dart
diff --git a/pkg/compiler/tool/util.dart b/pkg/compiler/tool/util.dart
deleted file mode 100644
index c3091f5b9f6911893cf460e998b45da4fcea69d7..0000000000000000000000000000000000000000
--- a/pkg/compiler/tool/util.dart
+++ /dev/null
@@ -1,96 +0,0 @@
-library compiler.tool.util;
-
-import 'package:compiler/src/info/info.dart';
-import 'graph.dart';
-
-/// Computes a graph of dependencies from [info].
-Graph<Info> graphFromInfo(AllInfo info) {
- // Note: currently we build two graphs to debug the differences between to
- // places where we collect this information in dump-info.
- // TODO(sigmund): fix inconsistencies between graphs, stick with one of them.
- // TODO(sigmund): create a concrete implementation of InfoGraph, instead of
- // using the EdgeListGraph.
- var g1 = new EdgeListGraph<Info>();
- var g2 = new EdgeListGraph<Info>();
- var g3 = new EdgeListGraph<Info>();
- for (var f in info.functions) {
- g1.addNode(f);
- g3.addNode(f);
- for (var g in f.uses) {
- g1.addEdge(f, g.target);
- g3.addEdge(f, g.target);
- }
- g2.addNode(f);
- if (info.dependencies[f] != null) {
- for (var g in info.dependencies[f]) {
- g2.addEdge(f, g);
- g3.addEdge(f, g);
- }
- }
- }
-
- for (var f in info.fields) {
- g1.addNode(f);
- g3.addNode(f);
- for (var g in f.uses) {
- g1.addEdge(f, g.target);
- g3.addEdge(f, g.target);
- }
- g2.addNode(f);
- if (info.dependencies[f] != null) {
- for (var g in info.dependencies[f]) {
- g2.addEdge(f, g);
- g3.addEdge(f, g);
- }
- }
- }
-
- // Note: these checks right now show that 'uses' links are computed
- // differently than 'deps' links
- int more1 = 0;
- int more2 = 0;
- int more1b = 0;
- int more2b = 0;
- _sameEdges(f) {
- var targets1 = g1.targetsOf(f).toSet();
- var targets2 = g2.targetsOf(f).toSet();
- var len1 = targets1.length;
- var len2 = targets2.length;
- if (len1 > len2) more1b++;
- if (len1 < len2) more2b++;
- var diff1 = targets1.difference(targets2);
- var diff2 = targets2.difference(targets1);
- if (diff1.isNotEmpty) {
- more1++;
- }
- if (diff2.isNotEmpty) {
- more2++;
- }
- return true;
- }
- info.functions.forEach(_sameEdges);
- info.fields.forEach(_sameEdges);
- if (more1 > 0 || more2 > 0 || more1b > 0 || more2b > 0) {
- print("Dep graph is not consistent: $more1 $more2");
- }
-
- return g3;
-}
-
-/// Provide a unique long name associated with [info].
-// TODO(sigmund): guarantee that the name is actually unique.
-String longName(Info info) {
- var sb = new StringBuffer();
- helper(i) {
- if (i.parent == null) {
- // TODO(sigmund): ensure `i is LibraryInfo`, we still don't set parents
- // for closure classes correctly.
- sb.write('${i.name}..');
- } else {
- helper(i.parent);
- sb.write('.${i.name}');
- }
- }
- helper(info);
- return sb.toString();
-}
« no previous file with comments | « pkg/compiler/tool/library_size_split.dart ('k') | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698