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

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

Issue 1512303002: dart2js cps: Add instruction for bounds checks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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_fragment.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
index ada5d1a44a637b49ca7c1d68d1f15b192e437c35..5d56560bed9ac0c9b8b3183ad528a8376c401374 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
@@ -104,6 +104,7 @@ class CpsFragment {
Primitive makeZero() => makeConstant(new IntConstantValue(0));
Primitive makeOne() => makeConstant(new IntConstantValue(1));
+ Primitive makeMinusOne() => makeConstant(new IntConstantValue(-1));
Primitive makeNull() => makeConstant(new NullConstantValue());
Primitive makeTrue() => makeConstant(new TrueConstantValue());
Primitive makeFalse() => makeConstant(new FalseConstantValue());
@@ -113,6 +114,10 @@ class CpsFragment {
return letPrim(new ApplyBuiltinOperator(op, args, sourceInformation));
}
+ Primitive refine(Primitive value, TypeMask type) {
+ return letPrim(new Refinement(value, type));
+ }
+
Primitive invokeBuiltin(BuiltinMethod method,
Primitive receiver,
List<Primitive> arguments,

Powered by Google App Engine
This is Rietveld 408576698