OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_TYPES_H_ | 5 #ifndef V8_TYPES_H_ |
6 #define V8_TYPES_H_ | 6 #define V8_TYPES_H_ |
7 | 7 |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 | 780 |
781 template<class Config> | 781 template<class Config> |
782 class TypeImpl<Config>::RangeType : public StructuralType { | 782 class TypeImpl<Config>::RangeType : public StructuralType { |
783 public: | 783 public: |
784 int BitsetLub() { return this->Get(0)->AsBitset(); } | 784 int BitsetLub() { return this->Get(0)->AsBitset(); } |
785 i::Handle<i::Object> Min() { return this->template GetValue<i::Object>(1); } | 785 i::Handle<i::Object> Min() { return this->template GetValue<i::Object>(1); } |
786 i::Handle<i::Object> Max() { return this->template GetValue<i::Object>(2); } | 786 i::Handle<i::Object> Max() { return this->template GetValue<i::Object>(2); } |
787 | 787 |
788 static RangeHandle New( | 788 static RangeHandle New( |
789 i::Handle<i::Object> min, i::Handle<i::Object> max, Region* region) { | 789 i::Handle<i::Object> min, i::Handle<i::Object> max, Region* region) { |
| 790 DCHECK(IsInteger(min->Number()) && IsInteger(max->Number())); |
790 DCHECK(min->Number() <= max->Number()); | 791 DCHECK(min->Number() <= max->Number()); |
791 RangeHandle type = Config::template cast<RangeType>( | 792 RangeHandle type = Config::template cast<RangeType>( |
792 StructuralType::New(StructuralType::kRangeTag, 3, region)); | 793 StructuralType::New(StructuralType::kRangeTag, 3, region)); |
793 type->Set(0, BitsetType::New( | 794 type->Set(0, BitsetType::New( |
794 BitsetType::Lub(min->Number(), max->Number()), region)); | 795 BitsetType::Lub(min->Number(), max->Number()), region)); |
795 type->SetValue(1, min); | 796 type->SetValue(1, min); |
796 type->SetValue(2, max); | 797 type->SetValue(2, max); |
797 return type; | 798 return type; |
798 } | 799 } |
799 | 800 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 bool Narrows(BoundsImpl that) { | 1057 bool Narrows(BoundsImpl that) { |
1057 return that.lower->Is(this->lower) && this->upper->Is(that.upper); | 1058 return that.lower->Is(this->lower) && this->upper->Is(that.upper); |
1058 } | 1059 } |
1059 }; | 1060 }; |
1060 | 1061 |
1061 typedef BoundsImpl<ZoneTypeConfig> Bounds; | 1062 typedef BoundsImpl<ZoneTypeConfig> Bounds; |
1062 | 1063 |
1063 } } // namespace v8::internal | 1064 } } // namespace v8::internal |
1064 | 1065 |
1065 #endif // V8_TYPES_H_ | 1066 #endif // V8_TYPES_H_ |
OLD | NEW |