| Index: src/types.h | 
| diff --git a/src/types.h b/src/types.h | 
| index 55c7e6c4692d8e19c89177a97128bd8ee222cd8b..b43ac6c3a4dd15377c5c1f004ef99d0b403d74c7 100644 | 
| --- a/src/types.h | 
| +++ b/src/types.h | 
| @@ -349,6 +349,16 @@ class TypeImpl : public Config::Base { | 
| PROPER_BITSET_TYPE_LIST(DEFINE_TYPE_CONSTRUCTOR) | 
| #undef DEFINE_TYPE_CONSTRUCTOR | 
|  | 
| +#define DEFINE_TYPE_CONSTRUCTOR(type, value)                 \ | 
| +  static TypeImpl* Mask##type##ForTesting() {                \ | 
| +    return BitsetType::New(BitsetType::k##type);             \ | 
| +  }                                                          \ | 
| +  static TypeHandle Mask##type##ForTesting(Region* region) { \ | 
| +    return BitsetType::New(BitsetType::k##type, region);     \ | 
| +  } | 
| +  MASK_BITSET_TYPE_LIST(DEFINE_TYPE_CONSTRUCTOR) | 
| +#undef DEFINE_TYPE_CONSTRUCTOR | 
| + | 
| static TypeImpl* SignedSmall() { | 
| return BitsetType::New(BitsetType::SignedSmall()); | 
| } | 
| @@ -535,6 +545,7 @@ class TypeImpl : public Config::Base { | 
| #endif | 
|  | 
| bool IsUnionForTesting() { return IsUnion(); } | 
| +  bitset GetRepresentationForTesting() { return GetRepresentation(); } | 
|  | 
| protected: | 
| // Friends. | 
| @@ -563,12 +574,16 @@ class TypeImpl : public Config::Base { | 
| } | 
| UnionType* AsUnion() { return UnionType::cast(this); } | 
|  | 
| +  bitset GetRepresentation(); | 
| + | 
| // Auxiliary functions. | 
| +  bool SemanticMaybe(TypeImpl* that); | 
|  | 
| bitset BitsetGlb() { return BitsetType::Glb(this); } | 
| bitset BitsetLub() { return BitsetType::Lub(this); } | 
|  | 
| bool SlowIs(TypeImpl* that); | 
| +  bool SemanticIs(TypeImpl* that); | 
|  | 
| static bool IsInteger(double x) { | 
| return nearbyint(x) == x && !i::IsMinusZero(x);  // Allows for infinities. | 
| @@ -580,16 +595,9 @@ class TypeImpl : public Config::Base { | 
| struct Limits { | 
| double min; | 
| double max; | 
| -    bitset representation; | 
| -    Limits(double min, double max, bitset representation) | 
| -        : min(min), max(max), representation(representation) {} | 
| -    explicit Limits(RangeType* range) | 
| -        : min(range->Min()), | 
| -          max(range->Max()), | 
| -          representation(REPRESENTATION(range->Bound())) {} | 
| -    static Limits Empty(Region* region) { | 
| -      return Limits(1, 0, BitsetType::kNone); | 
| -    } | 
| +    Limits(double min, double max) : min(min), max(max) {} | 
| +    explicit Limits(RangeType* range) : min(range->Min()), max(range->Max()) {} | 
| +    static Limits Empty(Region* region) { return Limits(1, 0); } | 
| }; | 
|  | 
| static bool IsEmpty(Limits lim); | 
| @@ -649,11 +657,13 @@ class TypeImpl<Config>::BitsetType : public TypeImpl<Config> { | 
| if (FLAG_enable_slow_asserts) CheckNumberBits(bits); | 
| return Config::from_bitset(bits, region); | 
| } | 
| -  // TODO(neis): Eventually allow again for types with empty semantics | 
| -  // part and modify intersection and possibly subtyping accordingly. | 
|  | 
| static bool IsInhabited(bitset bits) { | 
| -    return bits & kSemantic; | 
| +    return SEMANTIC(bits) != kNone && REPRESENTATION(bits) != kNone; | 
| +  } | 
| + | 
| +  static bool SemanticIsInhabited(bitset bits) { | 
| +    return SEMANTIC(bits) != kNone; | 
| } | 
|  | 
| static bool Is(bitset bits1, bitset bits2) { | 
| @@ -855,8 +865,8 @@ class TypeImpl<Config>::RangeType : public TypeImpl<Config> { | 
| return Config::template cast<RangeType>(Config::from_range(range)); | 
| } | 
|  | 
| -  static RangeHandle New(Limits lim, Region* region) { | 
| -    return New(lim.min, lim.max, BitsetType::New(lim.representation, region), | 
| +  static RangeHandle New(Limits lim, bitset representation, Region* region) { | 
| +    return New(lim.min, lim.max, BitsetType::New(representation, region), | 
| region); | 
| } | 
|  | 
| @@ -866,7 +876,6 @@ class TypeImpl<Config>::RangeType : public TypeImpl<Config> { | 
| } | 
| }; | 
| // TODO(neis): Also cache min and max values. | 
| -// TODO(neis): Allow restricting the representation. | 
|  | 
|  | 
| // ----------------------------------------------------------------------------- | 
|  |