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 24 matching lines...) Expand all Loading... |
35 Type* const kUint32 = | 35 Type* const kUint32 = |
36 CreateNative(Type::Unsigned32(), Type::UntaggedIntegral32()); | 36 CreateNative(Type::Unsigned32(), Type::UntaggedIntegral32()); |
37 Type* const kFloat32 = CreateNative(Type::Number(), Type::UntaggedFloat32()); | 37 Type* const kFloat32 = CreateNative(Type::Number(), Type::UntaggedFloat32()); |
38 Type* const kFloat64 = CreateNative(Type::Number(), Type::UntaggedFloat64()); | 38 Type* const kFloat64 = CreateNative(Type::Number(), Type::UntaggedFloat64()); |
39 | 39 |
40 Type* const kSmi = CreateNative(Type::SignedSmall(), Type::TaggedSigned()); | 40 Type* const kSmi = CreateNative(Type::SignedSmall(), Type::TaggedSigned()); |
41 Type* const kHeapNumber = CreateNative(Type::Number(), Type::TaggedPointer()); | 41 Type* const kHeapNumber = CreateNative(Type::Number(), Type::TaggedPointer()); |
42 | 42 |
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 kSingletonMinusOne = CreateRange(-1.0, -1.0); | 46 Type* const kSingletonMinusOne = CreateRange(-1.0, -1.0); |
| 47 Type* const kZeroOrUndefined = |
| 48 Type::Union(kSingletonZero, Type::Undefined(), zone()); |
| 49 Type* const kTenOrUndefined = |
| 50 Type::Union(kSingletonTen, Type::Undefined(), zone()); |
46 Type* const kMinusOneOrZero = CreateRange(-1.0, 0.0); | 51 Type* const kMinusOneOrZero = CreateRange(-1.0, 0.0); |
47 Type* const kZeroOrOne = CreateRange(0.0, 1.0); | 52 Type* const kZeroOrOne = CreateRange(0.0, 1.0); |
48 Type* const kZeroToThirtyOne = CreateRange(0.0, 31.0); | 53 Type* const kZeroToThirtyOne = CreateRange(0.0, 31.0); |
49 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); | 54 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); |
50 Type* const kZeroish = | 55 Type* const kZeroish = |
51 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); | 56 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); |
52 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); | 57 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); |
53 Type* const kIntegerOrMinusZero = | 58 Type* const kIntegerOrMinusZero = |
54 Type::Union(kInteger, Type::MinusZero(), zone()); | 59 Type::Union(kInteger, Type::MinusZero(), zone()); |
55 Type* const kIntegerOrMinusZeroOrNaN = | 60 Type* const kIntegerOrMinusZeroOrNaN = |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return Type::Range(min, max, zone()); | 160 return Type::Range(min, max, zone()); |
156 } | 161 } |
157 | 162 |
158 Zone* zone() { return &zone_; } | 163 Zone* zone() { return &zone_; } |
159 }; | 164 }; |
160 | 165 |
161 } // namespace internal | 166 } // namespace internal |
162 } // namespace v8 | 167 } // namespace v8 |
163 | 168 |
164 #endif // V8_TYPE_CACHE_H_ | 169 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |