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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); | 47 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); |
48 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); | 48 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); |
49 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); | 49 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); |
50 Type* const kIntegerOrMinusZero = | 50 Type* const kIntegerOrMinusZero = |
51 Type::Union(kInteger, Type::MinusZero(), zone()); | 51 Type::Union(kInteger, Type::MinusZero(), zone()); |
52 Type* const kIntegerOrMinusZeroOrNaN = | 52 Type* const kIntegerOrMinusZeroOrNaN = |
53 Type::Union(kIntegerOrMinusZero, Type::NaN(), zone()); | 53 Type::Union(kIntegerOrMinusZero, Type::NaN(), zone()); |
54 | 54 |
55 Type* const kPositiveSafeInteger = CreateRange(0.0, kMaxSafeInteger); | 55 Type* const kPositiveSafeInteger = CreateRange(0.0, kMaxSafeInteger); |
56 | 56 |
57 Type* const kIntegral32 = Type::Union(kInt32, kUint32, zone()); | 57 // Asm.js related types. |
| 58 Type* const kAsmSigned = kInt32; |
| 59 Type* const kAsmUnsigned = kUint32; |
| 60 Type* const kAsmInt = Type::Union(kAsmSigned, kAsmUnsigned, zone()); |
| 61 Type* const kAsmFixnum = Type::Intersect(kAsmSigned, kAsmUnsigned, zone()); |
| 62 Type* const kAsmFloat = kFloat32; |
| 63 Type* const kAsmDouble = kFloat64; |
| 64 // Asm.js size unions. |
| 65 Type* const kAsmSize8 = Type::Union(kInt8, kUint8, zone()); |
| 66 Type* const kAsmSize16 = Type::Union(kInt16, kUint16, zone()); |
| 67 Type* const kAsmSize32 = |
| 68 Type::Union(Type::Union(kInt32, kUint32, zone()), kAsmFloat, zone()); |
| 69 Type* const kAsmSize64 = kFloat64; |
| 70 // Asm.js other types. |
| 71 Type* const kAsmComparable = Type::Union( |
| 72 kAsmSigned, |
| 73 Type::Union(kAsmUnsigned, Type::Union(kAsmDouble, kAsmFloat, zone()), |
| 74 zone()), |
| 75 zone()); |
58 | 76 |
59 // The FixedArray::length property always containts a smi in the range | 77 // The FixedArray::length property always containts a smi in the range |
60 // [0, FixedArray::kMaxLength]. | 78 // [0, FixedArray::kMaxLength]. |
61 Type* const kFixedArrayLengthType = CreateNative( | 79 Type* const kFixedArrayLengthType = CreateNative( |
62 CreateRange(0.0, FixedArray::kMaxLength), Type::TaggedSigned()); | 80 CreateRange(0.0, FixedArray::kMaxLength), Type::TaggedSigned()); |
63 | 81 |
64 // The FixedDoubleArray::length property always containts a smi in the range | 82 // The FixedDoubleArray::length property always containts a smi in the range |
65 // [0, FixedDoubleArray::kMaxLength]. | 83 // [0, FixedDoubleArray::kMaxLength]. |
66 Type* const kFixedDoubleArrayLengthType = CreateNative( | 84 Type* const kFixedDoubleArrayLengthType = CreateNative( |
67 CreateRange(0.0, FixedDoubleArray::kMaxLength), Type::TaggedSigned()); | 85 CreateRange(0.0, FixedDoubleArray::kMaxLength), Type::TaggedSigned()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return Type::Range(min, max, zone()); | 123 return Type::Range(min, max, zone()); |
106 } | 124 } |
107 | 125 |
108 Zone* zone() { return &zone_; } | 126 Zone* zone() { return &zone_; } |
109 }; | 127 }; |
110 | 128 |
111 } // namespace internal | 129 } // namespace internal |
112 } // namespace v8 | 130 } // namespace v8 |
113 | 131 |
114 #endif // V8_TYPE_CACHE_H_ | 132 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |