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

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

Issue 1393763004: dart2js cps_ir: BuiltinOperation improvements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/type_mask_system.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
index b8167b7447c522df44380ece440b2acdb3ae4d1a..c2d704291545fe865a83285849b38ed31c4afc94 100644
--- a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
@@ -38,6 +38,10 @@ class TypeMaskSystem {
TypeMask get nullType => inferrer.nullType;
TypeMask get extendableNativeListType => backend.extendableArrayType;
+ TypeMask get uint31Type => inferrer.uint31Type;
+ TypeMask get uint32Type => inferrer.uint32Type;
+ TypeMask get uintType => inferrer.positiveIntType;
+
TypeMask numStringBoolType;
TypeMask interceptorType;
@@ -199,6 +203,21 @@ class TypeMaskSystem {
return t.satisfies(backend.jsIntClass, classWorld);
}
+ bool isDefinitelyUint31(TypeMask t, {bool allowNull: false}) {
+ if (!allowNull && t.isNullable) return false;
+ return t.satisfies(backend.jsUInt31Class, classWorld);
+ }
+
+ bool isDefinitelyUint32(TypeMask t, {bool allowNull: false}) {
+ if (!allowNull && t.isNullable) return false;
+ return t.satisfies(backend.jsUInt32Class, classWorld);
+ }
+
+ bool isDefinitelyUint(TypeMask t, {bool allowNull: false}) {
+ if (!allowNull && t.isNullable) return false;
+ return t.satisfies(backend.jsPositiveIntClass, classWorld);
+ }
+
// TODO(sra): Find a better name. 'NativeList' is a bad name because there
// are many native classes in dart:html that implement List but are not (and
// should not be) included in this predicate.
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/builtin_operator.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