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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart

Issue 1759653003: Tool for visualizing type inference graph. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove use of dart:io Created 4 years, 9 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/inferrer/type_graph_dump.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/inferrer/type_graph_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index 418bd2d23728c6eecf5e6c962f299c5350a4f014..14d904a8b821a7506d30bbdf06473f0e2db5496e 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -59,6 +59,7 @@ import 'closure_tracer.dart';
import 'list_tracer.dart';
import 'map_tracer.dart';
import 'type_graph_nodes.dart';
+import 'type_graph_dump.dart';
import 'debug.dart' as debug;
@@ -89,6 +90,14 @@ class TypeInformationSystem extends TypeSystem<TypeInformation> {
/// narrowing, phis, and containers).
final List<TypeInformation> allocatedTypes = <TypeInformation>[];
+ Iterable<TypeInformation> get allTypes =>
+ [typeInformations.values,
+ allocatedLists.values,
+ allocatedMaps.values,
+ allocatedClosures,
+ concreteTypes.values,
+ allocatedTypes].expand((x) => x);
+
TypeInformationSystem(Compiler compiler)
: this.compiler = compiler,
this.classWorld = compiler.world {
@@ -715,6 +724,9 @@ class TypeGraphInferrerEngine
});
reporter.log('Added $addedInGraph elements in inferencing graph.');
+ TypeGraphDump dump = debug.PRINT_GRAPH ? new TypeGraphDump(this) : null;
+
+ dump?.beforeAnalysis();
buildWorkQueue();
refine();
@@ -799,6 +811,8 @@ class TypeGraphInferrerEngine
}
});
+ dump?.beforeTracing();
+
// Reset all nodes that use lists/maps that have been inferred, as well
// as nodes that use elements fetched from these lists/maps. The
// workset for a new run of the analysis will be these nodes.
@@ -856,6 +870,7 @@ class TypeGraphInferrerEngine
print('${elem} :: ${type} from ${type.assignments} ');
});
}
+ dump?.afterAnalysis();
reporter.log('Inferred $overallRefineCount types.');
@@ -1306,7 +1321,7 @@ class TypeGraphInferrerEngine
analyzedElements.clear();
generativeConstructorsExposingThis.clear();
-
+
types.allocatedMaps.values.forEach(cleanup);
types.allocatedLists.values.forEach(cleanup);
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_dump.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698