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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/types.dart

Issue 87783003: Add UInt32 and UInt31 types to better infer bit operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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: sdk/lib/_internal/compiler/implementation/types/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/types.dart (revision 30666)
+++ sdk/lib/_internal/compiler/implementation/types/types.dart (working copy)
@@ -53,8 +53,11 @@
}
TypeMask dynamicTypeCache;
+ TypeMask nonNullTypeCache;
TypeMask nullTypeCache;
TypeMask intTypeCache;
+ TypeMask uint32TypeCache;
+ TypeMask uint31TypeCache;
TypeMask doubleTypeCache;
TypeMask numTypeCache;
TypeMask boolTypeCache;
@@ -75,14 +78,37 @@
return dynamicTypeCache;
}
+ TypeMask get nonNullType {
+ if (nonNullTypeCache == null) {
+ nonNullTypeCache = new TypeMask.nonNullSubclass(compiler.objectClass);
+ }
+ return nonNullTypeCache;
+ }
+
TypeMask get intType {
if (intTypeCache == null) {
- intTypeCache = new TypeMask.nonNullExact(
+ intTypeCache = new TypeMask.nonNullSubclass(
compiler.backend.intImplementation);
}
return intTypeCache;
}
+ TypeMask get uint32Type {
+ if (uint32TypeCache == null) {
+ uint32TypeCache = new TypeMask.nonNullSubclass(
+ compiler.backend.uint32Implementation);
+ }
+ return uint32TypeCache;
+ }
+
+ TypeMask get uint31Type {
+ if (uint31TypeCache == null) {
+ uint31TypeCache = new TypeMask.nonNullExact(
+ compiler.backend.uint31Implementation);
+ }
+ return uint31TypeCache;
+ }
+
TypeMask get doubleType {
if (doubleTypeCache == null) {
doubleTypeCache = new TypeMask.nonNullExact(
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart ('k') | sdk/lib/_internal/lib/js_number.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698