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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ed8d685ea31e5d8bced6e8c7becbee65a202b5da..ff7dea70f46d259f1cc1b1930c617b29c8e61507 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
@@ -202,6 +202,10 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
return '$indentation(Branch $condition $trueCont $falseCont)';
}
+ String visitUnreachable(Unreachable node) {
+ return '$indentation(Unreachable)';
+ }
+
String visitConstant(Constant node) {
String value = node.value.accept(new ConstantStringifier(), null);
return '(Constant $value)';
@@ -229,13 +233,17 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
'$value\n$body)';
}
- String visitTypeOperator(TypeOperator node) {
+ String visitTypeCast(TypeCast node) {
String value = access(node.value);
String cont = access(node.continuation);
- String operator = node.isTypeTest ? 'is' : 'as';
String typeArguments = node.typeArguments.map(access).join(' ');
- return '$indentation(TypeOperator $operator $value ${node.type} '
- '($typeArguments) $cont)';
+ return '$indentation(TypeCast $value ${node.type} ($typeArguments) $cont)';
+ }
+
+ String visitTypeTest(TypeTest node) {
+ String value = access(node.value);
+ String typeArguments = node.typeArguments.map(access).join(' ');
+ return '(TypeTest $value ${node.type} ($typeArguments))';
}
String visitLiteralList(LiteralList node) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698