| Index: src/types.h
|
| diff --git a/src/types.h b/src/types.h
|
| index 0af790a5ad8cb860006e5955e3fa7e213f698809..c7bbfedf72d704623cfea32518c9a7690a6f2991 100644
|
| --- a/src/types.h
|
| +++ b/src/types.h
|
| @@ -286,7 +286,7 @@ class TypeImpl : public Config::Base {
|
| return ClassType::New(map, region);
|
| }
|
| static TypeHandle Constant(i::Handle<i::Object> value, Region* region) {
|
| - // TODO(neis): return RangeType for numerical values
|
| + // TODO(neis): Return RangeType for numerical values.
|
| return ConstantType::New(value, region);
|
| }
|
| static TypeHandle Range(double min, double max, Region* region) {
|
| @@ -515,6 +515,7 @@ class TypeImpl<Config>::BitsetType : public TypeImpl<Config> {
|
| static int Lub(int32_t value);
|
| static int Lub(uint32_t value);
|
| static int Lub(i::Map* map);
|
| + static int Lub(double min, double max);
|
| static int InherentLub(TypeImpl* type);
|
|
|
| static const char* Name(int bitset);
|
| @@ -687,8 +688,7 @@ class TypeImpl<Config>::RangeType : public StructuralType {
|
|
|
| static RangeHandle New(
|
| double min, double max, TypeHandle bound, Region* region) {
|
| - DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::kNumber));
|
| - DCHECK(!std::isnan(min) && !std::isnan(max) && min <= max);
|
| + DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::Lub(min, max)));
|
| RangeHandle type = Config::template cast<RangeType>(
|
| StructuralType::New(StructuralType::kRangeTag, 3, region));
|
| type->Set(0, bound);
|
| @@ -701,7 +701,7 @@ class TypeImpl<Config>::RangeType : public StructuralType {
|
| }
|
|
|
| static RangeHandle New(double min, double max, Region* region) {
|
| - TypeHandle bound = BitsetType::New(BitsetType::kNumber, region);
|
| + TypeHandle bound = BitsetType::New(BitsetType::Lub(min, max), region);
|
| return New(min, max, bound, region);
|
| }
|
|
|
|
|