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 CreateNative(Type::Unsigned32(), Type::UntaggedIntegral32()); | 35 CreateNative(Type::Unsigned32(), Type::UntaggedIntegral32()); |
36 Type* const kFloat32 = CreateNative(Type::Number(), Type::UntaggedFloat32()); | 36 Type* const kFloat32 = CreateNative(Type::Number(), Type::UntaggedFloat32()); |
37 Type* const kFloat64 = CreateNative(Type::Number(), Type::UntaggedFloat64()); | 37 Type* const kFloat64 = CreateNative(Type::Number(), Type::UntaggedFloat64()); |
38 | 38 |
39 Type* const kSmi = CreateNative(Type::SignedSmall(), Type::TaggedSigned()); | 39 Type* const kSmi = CreateNative(Type::SignedSmall(), Type::TaggedSigned()); |
40 Type* const kHeapNumber = CreateNative(Type::Number(), Type::TaggedPointer()); | 40 Type* const kHeapNumber = CreateNative(Type::Number(), Type::TaggedPointer()); |
41 | 41 |
42 Type* const kSingletonZero = CreateRange(0.0, 0.0); | 42 Type* const kSingletonZero = CreateRange(0.0, 0.0); |
43 Type* const kSingletonOne = CreateRange(1.0, 1.0); | 43 Type* const kSingletonOne = CreateRange(1.0, 1.0); |
44 Type* const kZeroOrOne = CreateRange(0.0, 1.0); | 44 Type* const kZeroOrOne = CreateRange(0.0, 1.0); |
| 45 Type* const kZeroToThirtyOne = CreateRange(0.0, 31.0); |
45 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); | 46 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); |
46 Type* const kZeroish = | 47 Type* const kZeroish = |
47 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); | 48 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); |
48 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); | 49 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); |
49 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); | 50 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); |
50 Type* const kIntegerOrMinusZero = | 51 Type* const kIntegerOrMinusZero = |
51 Type::Union(kInteger, Type::MinusZero(), zone()); | 52 Type::Union(kInteger, Type::MinusZero(), zone()); |
52 Type* const kIntegerOrMinusZeroOrNaN = | 53 Type* const kIntegerOrMinusZeroOrNaN = |
53 Type::Union(kIntegerOrMinusZero, Type::NaN(), zone()); | 54 Type::Union(kIntegerOrMinusZero, Type::NaN(), zone()); |
54 | 55 |
| 56 Type* const kAdditiveSafeInteger = |
| 57 CreateRange(-4503599627370496.0, 4503599627370496.0); |
| 58 Type* const kSafeInteger = CreateRange(-kMaxSafeInteger, kMaxSafeInteger); |
55 Type* const kPositiveSafeInteger = CreateRange(0.0, kMaxSafeInteger); | 59 Type* const kPositiveSafeInteger = CreateRange(0.0, kMaxSafeInteger); |
56 | 60 |
57 // Asm.js related types. | 61 // Asm.js related types. |
58 Type* const kAsmSigned = kInt32; | 62 Type* const kAsmSigned = kInt32; |
59 Type* const kAsmUnsigned = kUint32; | 63 Type* const kAsmUnsigned = kUint32; |
60 Type* const kAsmInt = Type::Union(kAsmSigned, kAsmUnsigned, zone()); | 64 Type* const kAsmInt = Type::Union(kAsmSigned, kAsmUnsigned, zone()); |
61 Type* const kAsmFixnum = Type::Intersect(kAsmSigned, kAsmUnsigned, zone()); | 65 Type* const kAsmFixnum = Type::Intersect(kAsmSigned, kAsmUnsigned, zone()); |
62 Type* const kAsmFloat = kFloat32; | 66 Type* const kAsmFloat = kFloat32; |
63 Type* const kAsmDouble = kFloat64; | 67 Type* const kAsmDouble = kFloat64; |
64 // Asm.js size unions. | 68 // Asm.js size unions. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 return Type::Range(min, max, zone()); | 131 return Type::Range(min, max, zone()); |
128 } | 132 } |
129 | 133 |
130 Zone* zone() { return &zone_; } | 134 Zone* zone() { return &zone_; } |
131 }; | 135 }; |
132 | 136 |
133 } // namespace internal | 137 } // namespace internal |
134 } // namespace v8 | 138 } // namespace v8 |
135 | 139 |
136 #endif // V8_TYPE_CACHE_H_ | 140 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |