Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/constants.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/constants.dart (revision 30705) |
| +++ sdk/lib/_internal/compiler/implementation/constants.dart (working copy) |
| @@ -164,6 +164,7 @@ |
| bool isInt() => true; |
| bool isUInt31() => value >= 0 && value < (1 << 31); |
| bool isUInt32() => value >= 0 && value < (1 << 32); |
| + bool isPositive() => value >= 0; |
|
kasperl
2013/11/28 09:09:47
Stephen would probably insist on this being isNonN
|
| DartType computeType(Compiler compiler) { |
| return compiler.intClass.computeType(compiler); |
| @@ -172,6 +173,7 @@ |
| ti.TypeMask computeMask(Compiler compiler) { |
| if (isUInt31()) return compiler.typesTask.uint31Type; |
| if (isUInt32()) return compiler.typesTask.uint32Type; |
| + if (isPositive()) return compiler.typesTask.positiveIntType; |
| return compiler.typesTask.intType; |
| } |