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_TYPE_CACHE_H_ | 5 #ifndef V8_TYPE_CACHE_H_ |
6 #define V8_TYPE_CACHE_H_ | 6 #define V8_TYPE_CACHE_H_ |
7 | 7 |
8 #include "src/types.h" | 8 #include "src/types.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 Type* const kSingletonZero = CreateRange(0.0, 0.0); | 43 Type* const kSingletonZero = CreateRange(0.0, 0.0); |
44 Type* const kSingletonOne = CreateRange(1.0, 1.0); | 44 Type* const kSingletonOne = CreateRange(1.0, 1.0); |
45 Type* const kSingletonTen = CreateRange(10.0, 10.0); | 45 Type* const kSingletonTen = CreateRange(10.0, 10.0); |
46 Type* const kSingletonMinusOne = CreateRange(-1.0, -1.0); | 46 Type* const kSingletonMinusOne = CreateRange(-1.0, -1.0); |
47 Type* const kZeroOrUndefined = | 47 Type* const kZeroOrUndefined = |
48 Type::Union(kSingletonZero, Type::Undefined(), zone()); | 48 Type::Union(kSingletonZero, Type::Undefined(), zone()); |
49 Type* const kTenOrUndefined = | 49 Type* const kTenOrUndefined = |
50 Type::Union(kSingletonTen, Type::Undefined(), zone()); | 50 Type::Union(kSingletonTen, Type::Undefined(), zone()); |
51 Type* const kMinusOneOrZero = CreateRange(-1.0, 0.0); | 51 Type* const kMinusOneOrZero = CreateRange(-1.0, 0.0); |
52 Type* const kZeroOrOne = CreateRange(0.0, 1.0); | 52 Type* const kZeroOrOne = CreateRange(0.0, 1.0); |
| 53 Type* const kZeroOrOneOrNaN = Type::Union(kZeroOrOne, Type::NaN(), zone()); |
53 Type* const kZeroToThirtyOne = CreateRange(0.0, 31.0); | 54 Type* const kZeroToThirtyOne = CreateRange(0.0, 31.0); |
54 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); | 55 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); |
55 Type* const kZeroish = | 56 Type* const kZeroish = |
56 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); | 57 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); |
57 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); | 58 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); |
58 Type* const kIntegerOrMinusZero = | 59 Type* const kIntegerOrMinusZero = |
59 Type::Union(kInteger, Type::MinusZero(), zone()); | 60 Type::Union(kInteger, Type::MinusZero(), zone()); |
60 Type* const kIntegerOrMinusZeroOrNaN = | 61 Type* const kIntegerOrMinusZeroOrNaN = |
61 Type::Union(kIntegerOrMinusZero, Type::NaN(), zone()); | 62 Type::Union(kIntegerOrMinusZero, Type::NaN(), zone()); |
62 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); | 63 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return Type::Range(min, max, zone()); | 163 return Type::Range(min, max, zone()); |
163 } | 164 } |
164 | 165 |
165 Zone* zone() { return &zone_; } | 166 Zone* zone() { return &zone_; } |
166 }; | 167 }; |
167 | 168 |
168 } // namespace internal | 169 } // namespace internal |
169 } // namespace v8 | 170 } // namespace v8 |
170 | 171 |
171 #endif // V8_TYPE_CACHE_H_ | 172 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |