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

Unified Diff: sdk/lib/_internal/compiler/implementation/ir/ir_tracer.dart

Issue 312793002: dart2dart: Preserve variable names throughout the IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
Index: sdk/lib/_internal/compiler/implementation/ir/ir_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ir/ir_tracer.dart b/sdk/lib/_internal/compiler/implementation/ir/ir_tracer.dart
index 38a4ae9713ccd0a2990dbe4779464332b26cdb77..f0794daee6db3a5aad7bf3a6272cc0d8ff9c57f4 100644
--- a/sdk/lib/_internal/compiler/implementation/ir/ir_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ir/ir_tracer.dart
@@ -44,6 +44,16 @@ class IRTracer extends TracerUtil implements ir.Visitor {
names = null;
}
+ int countUses(ir.Definition definition) {
+ int count = 0;
+ ir.Reference ref = definition.firstRef;
+ while (ref != null) {
+ ++count;
+ ref = ref.nextRef;
+ }
+ return count;
+ }
+
printNode(Block block) {
tag("block", () {
printProperty("name", block.name);
@@ -57,11 +67,13 @@ class IRTracer extends TracerUtil implements ir.Visitor {
tag("locals", () {
printProperty("size", 0);
printProperty("method", "None");
- // We could print parameters here,
- // but does the hydra tool actually use this info??
});
});
tag("HIR", () {
+ for (ir.Parameter param in block.parameters) {
+ String name = names.name(param);
+ printStmt(name, "Parameter $name [useCount=${countUses(param)}]");
+ }
visit(block.body);
});
});
@@ -183,7 +195,7 @@ class IRTracer extends TracerUtil implements ir.Visitor {
}
visitIsTrue(ir.IsTrue node) {
- return "IsTrue(${names.name(node)})";
+ return "IsTrue(${names.name(node.value.definition)})";
}
visitCondition(ir.Condition c) {}

Powered by Google App Engine
This is Rietveld 408576698