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/factory.h" | 8 #include "src/factory.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/ostreams.h" | 10 #include "src/ostreams.h" |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 | 679 |
680 static RangeHandle New( | 680 static RangeHandle New( |
681 double min, double max, TypeHandle bound, Region* region) { | 681 double min, double max, TypeHandle bound, Region* region) { |
682 ASSERT(SEMANTIC(bound->AsBitset() | BitsetType::kNumber) | 682 ASSERT(SEMANTIC(bound->AsBitset() | BitsetType::kNumber) |
683 == SEMANTIC(BitsetType::kNumber)); | 683 == SEMANTIC(BitsetType::kNumber)); |
684 ASSERT(!std::isnan(min) && !std::isnan(max) && min <= max); | 684 ASSERT(!std::isnan(min) && !std::isnan(max) && min <= max); |
685 RangeHandle type = Config::template cast<RangeType>( | 685 RangeHandle type = Config::template cast<RangeType>( |
686 StructuralType::New(StructuralType::kRangeTag, 3, region)); | 686 StructuralType::New(StructuralType::kRangeTag, 3, region)); |
687 type->Set(0, bound); | 687 type->Set(0, bound); |
688 Factory* factory = Config::isolate(region)->factory(); | 688 Factory* factory = Config::isolate(region)->factory(); |
689 type->SetValue(1, factory->NewHeapNumber(min)); | 689 Handle<HeapNumber> minV = factory->NewHeapNumber(min); |
690 type->SetValue(2, factory->NewHeapNumber(max)); | 690 Handle<HeapNumber> maxV = factory->NewHeapNumber(max); |
| 691 type->SetValue(1, minV); |
| 692 type->SetValue(2, maxV); |
691 return type; | 693 return type; |
692 } | 694 } |
693 | 695 |
694 static RangeHandle New(double min, double max, Region* region) { | 696 static RangeHandle New(double min, double max, Region* region) { |
695 TypeHandle bound = BitsetType::New(BitsetType::kNumber, region); | 697 TypeHandle bound = BitsetType::New(BitsetType::kNumber, region); |
696 return New(min, max, bound, region); | 698 return New(min, max, bound, region); |
697 } | 699 } |
698 | 700 |
699 static RangeType* cast(TypeImpl* type) { | 701 static RangeType* cast(TypeImpl* type) { |
700 ASSERT(type->IsRange()); | 702 ASSERT(type->IsRange()); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 bool Narrows(BoundsImpl that) { | 983 bool Narrows(BoundsImpl that) { |
982 return that.lower->Is(this->lower) && this->upper->Is(that.upper); | 984 return that.lower->Is(this->lower) && this->upper->Is(that.upper); |
983 } | 985 } |
984 }; | 986 }; |
985 | 987 |
986 typedef BoundsImpl<ZoneTypeConfig> Bounds; | 988 typedef BoundsImpl<ZoneTypeConfig> Bounds; |
987 | 989 |
988 } } // namespace v8::internal | 990 } } // namespace v8::internal |
989 | 991 |
990 #endif // V8_TYPES_H_ | 992 #endif // V8_TYPES_H_ |
OLD | NEW |