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

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

Issue 1507313006: dart2js cps: Add instruction for null checks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix true/false misdocumentation about condition and do not emit call Created 5 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 6c7469ee96ce2a25cbc2a9316332ec1402191106..cecec47b6d2d5a9fb1ae881e123705cd1b24c312 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -242,6 +242,7 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
}
String formatReference(cps_ir.Reference ref) {
+ if (ref == null) return 'null';
cps_ir.Definition target = ref.definition;
if (target is cps_ir.Continuation && target.isReturnContinuation) {
return "return"; // Do not generate a name for the return continuation
@@ -389,6 +390,12 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor {
String value = formatReference(node.value);
return 'Refinement $value ${node.refineType}';
}
+
+ visitNullCheck(cps_ir.NullCheck node) {
+ String value = formatReference(node.value);
+ String condition = formatReference(node.condition);
+ return 'NullCheck $value condition:$condition selector:${node.selector}';
+ }
}
/**
@@ -671,4 +678,8 @@ class BlockCollector implements cps_ir.Visitor {
visitRefinement(cps_ir.Refinement node) {
unexpectedNode(node);
}
+
+ visitNullCheck(cps_ir.NullCheck 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/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698