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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart

Issue 898463002: Rename ClosureVariable, use separate IR forms for declaration and assignment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
index 23e6b3bb7f45476018d3bb2af97c162a6901d17e..2fc8597df24155e9dfac334c7c8d856d368fac7e 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -120,6 +120,12 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
visit(node.body);
}
+ visitLetMutable(cps_ir.LetMutable node) {
+ String id = names.name(node.variable);
+ printStmt(id, "${node.runtimeType} $id = ${formatReference(node.value)}");
+ visit(node.body);
+ }
+
visitInvokeStatic(cps_ir.InvokeStatic node) {
String dummy = names.name(node);
String callName = node.selector.name;
@@ -208,17 +214,17 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
printStmt(dummy, "Branch $condition ($trueCont, $falseCont)");
}
- visitSetClosureVariable(cps_ir.SetClosureVariable node) {
+ visitSetMutableVariable(cps_ir.SetMutableVariable node) {
String dummy = names.name(node);
String variable = names.name(node.variable.definition);
String value = formatReference(node.value);
- printStmt(dummy, 'SetClosureVariable $variable = $value');
+ printStmt(dummy, '${node.runtimeType} $variable := $value');
visit(node.body);
}
visitDeclareFunction(cps_ir.DeclareFunction node) {
String dummy = names.name(node);
- String variable = names.name(node.variable.definition);
+ String variable = names.name(node.variable);
printStmt(dummy, 'DeclareFunction $variable');
visit(node.body);
}
@@ -242,8 +248,8 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
return "Parameter ${names.name(node)}";
}
- visitClosureVariable(cps_ir.ClosureVariable node) {
- return "ClosureVariable ${names.name(node)}";
+ visitMutableVariable(cps_ir.MutableVariable node) {
+ return "${node.runtimeType} ${names.name(node)}";
}
visitContinuation(cps_ir.Continuation node) {
@@ -301,9 +307,9 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
return "CreateFunction ${node.definition.element.name}";
}
- visitGetClosureVariable(cps_ir.GetClosureVariable node) {
+ visitGetMutableVariable(cps_ir.GetMutableVariable node) {
String variable = names.name(node.variable.definition);
- return 'GetClosureVariable $variable';
+ return '${node.runtimeType} $variable';
}
visitRunnableBody(cps_ir.RunnableBody node) {}
@@ -337,7 +343,7 @@ class Names {
if (x is cps_ir.Parameter) return 'r';
if (x is cps_ir.Continuation || x is cps_ir.FunctionDefinition) return 'B';
if (x is cps_ir.Primitive) return 'v';
- if (x is cps_ir.ClosureVariable) return 'c';
+ if (x is cps_ir.MutableVariable) return 'c';
return 'x';
}
@@ -456,7 +462,7 @@ class BlockCollector extends cps_ir.Visitor {
addEdgeToContinuation(exp.continuation);
}
- visitSetClosureVariable(cps_ir.SetClosureVariable exp) {
+ visitSetMutableVariable(cps_ir.SetMutableVariable exp) {
visit(exp.body);
}

Powered by Google App Engine
This is Rietveld 408576698