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

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

Issue 800433003: First version of typr propagation in the new IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add type arguments, fix join and tests. 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_nodes_sexpr.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
index d7ec6a950c08a2c129ea352e784b1b2ed492cc72..177d61148bf0aa4ac35ef6cb7461fe6dc1ff2ea2 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
@@ -17,11 +17,17 @@ class SExpressionStringifier extends Visitor<String> with Indentation {
String newValueName(Node node) => namer.defineValueName(node);
String newContinuationName(Node node) => namer.defineContinuationName(node);
- final Decorator decorator;
+ Decorator decorator;
- SExpressionStringifier([this.decorator]);
+ SExpressionStringifier([this.decorator]) {
+ if (this.decorator == null) {
+ this.decorator = (Node node, String s) => s;
+ }
+ }
- String access(Reference<Definition> r) => namer.getName(r.definition);
+ String access(Reference<Definition> r) {
+ return decorator(r.definition, namer.getName(r.definition));
+ }
String visitParameter(Parameter node) {
return namer.useElementName(node);
@@ -75,7 +81,7 @@ class SExpressionStringifier extends Visitor<String> with Indentation {
// should recurse to [visit]. Currently we can't do that, because the
// unstringifier_test produces [LetConts] with dummy arguments on them.
String parameters = node.continuation.parameters
- .map((p) => ' ${newValueName(p)}')
+ .map((p) => ' ${decorator(p, newValueName(p))}')
.join('');
String contBody = indentBlock(() => visit(node.continuation.body));
String body = visit(node.body);

Powered by Google App Engine
This is Rietveld 408576698