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

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

Issue 1512303002: dart2js cps: Add instruction for bounds checks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update gvn_test output 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
« 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 dc2768f75ba1c5b833c2c7d20a04237f3b7a6912..bf857f991c19fdf715b9b2cfebf96c2c1ac22610 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
@@ -33,8 +33,8 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
return decorator(r, namer.getName(r.definition));
}
- String optional(Reference<Definition> r) {
- return r == null ? '()' : '(${access(r)})';
+ String optionalAccess(Reference<Definition> reference) {
+ return reference == null ? '()' : '(${access(reference)})';
}
String visitParameter(Parameter node) {
@@ -365,9 +365,16 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
return '(Refinement $value ${node.type})';
}
+ String visitBoundsCheck(BoundsCheck node) {
+ String object = access(node.object);
+ String index = optionalAccess(node.index);
+ String length = optionalAccess(node.length);
+ return '(BoundsCheck $object $index $length ${node.checkString})';
+ }
+
String visitNullCheck(NullCheck node) {
String value = access(node.value);
- String condition = optional(node.condition);
+ String condition = optionalAccess(node.condition);
return '(NullCheck $value $condition (${node.selector ?? ""}))';
}
}
« 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