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

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

Issue 1153603006: dart2js cps: Type casts and related changes to type propagation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Another typo in SExpression unstrngifier Created 5 years, 6 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 c0097e962d6b3b4e1bcb5363667a3133b15ab6ac..5dbf8c749a8982a9ce603d7a353a808781dd4ed7 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -193,6 +193,11 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
printStmt(dummy, "Rethrow");
}
+ visitUnreachable(cps_ir.Unreachable node) {
+ String dummy = names.name(node);
+ printStmt(dummy, 'Unreachable');
+ }
+
visitLiteralList(cps_ir.LiteralList node) {
String dummy = names.name(node);
String values = node.values.map(formatReference).join(', ');
@@ -210,13 +215,12 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
printStmt(dummy, "LiteralMap (${entries.join(', ')})");
}
- visitTypeOperator(cps_ir.TypeOperator node) {
+ visitTypeCast(cps_ir.TypeCast node) {
String dummy = names.name(node);
- String operator = node.isTypeTest ? 'is' : 'as';
- List<String> entries = new List<String>();
String value = formatReference(node.value);
+ String args = node.typeArguments.map(formatReference).join(', ');
String kont = formatReference(node.continuation);
- printStmt(dummy, "TypeOperator ($operator $value ${node.type}) $kont");
+ printStmt(dummy, "TypeCast ($value ${node.type} ($args)) $kont");
}
visitInvokeContinuation(cps_ir.InvokeContinuation node) {
@@ -361,6 +365,12 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
String args = node.arguments.map(formatReference).join(', ');
return "CreateInvocationMirror(${node.selector.name}, $args)";
}
+
+ visitTypeTest(cps_ir.TypeTest node) {
+ String value = formatReference(node.value);
+ String args = node.typeArguments.map(formatReference).join(', ');
+ return "TypeTest ($value ${node.type} ($args))";
+ }
}
/**
@@ -497,6 +507,9 @@ class BlockCollector implements cps_ir.Visitor {
visitRethrow(cps_ir.Rethrow exp) {
}
+ visitUnreachable(cps_ir.Unreachable node) {
+ }
+
visitSetMutableVariable(cps_ir.SetMutableVariable exp) {
visit(exp.body);
}
@@ -524,7 +537,7 @@ class BlockCollector implements cps_ir.Visitor {
}
}
- visitTypeOperator(cps_ir.TypeOperator exp) {
+ visitTypeCast(cps_ir.TypeCast exp) {
addEdgeToContinuation(exp.continuation);
}
@@ -603,4 +616,8 @@ class BlockCollector implements cps_ir.Visitor {
visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) {
unexpectedNode(node);
}
+
+ visitTypeTest(cps_ir.TypeTest node) {
+ unexpectedNode(node);
+ }
}
« 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