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

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

Issue 756383004: Refactored treatment of closure variables in dart2js CPS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments Created 6 years 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 5d7c114bb0622042b0f3d689d6c16a166552cc7e..d9efa8322675a962d8558acf7d1b3d882c622718 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -199,7 +199,7 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
visitSetClosureVariable(cps_ir.SetClosureVariable node) {
String dummy = names.name(node);
- String variable = node.variable.name;
+ String variable = names.name(node.variable.definition);
String value = formatReference(node.value);
printStmt(dummy, 'SetClosureVariable $variable = $value');
visit(node.body);
@@ -207,7 +207,7 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
visitDeclareFunction(cps_ir.DeclareFunction node) {
String dummy = names.name(node);
- String variable = node.variable.name;
+ String variable = names.name(node.variable.definition);
printStmt(dummy, 'DeclareFunction $variable');
visit(node.body);
}
@@ -231,6 +231,10 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
return "Parameter ${names.name(node)}";
}
+ visitClosureVariable(cps_ir.ClosureVariable node) {
+ return "ClosureVariable ${names.name(node)}";
+ }
+
visitContinuation(cps_ir.Continuation node) {
return "Continuation ${names.name(node)}";
}
@@ -258,7 +262,7 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
}
visitGetClosureVariable(cps_ir.GetClosureVariable node) {
- String variable = node.variable.name;
+ String variable = names.name(node.variable.definition);
return 'GetClosureVariable $variable';
}
@@ -282,13 +286,15 @@ class Names {
'r': 0,
'B': 0,
'v': 0,
- 'x': 0
+ 'x': 0,
+ 'c': 0
};
String prefix(x) {
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';
return 'x';
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart ('k') | pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698