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 20 matching lines...) Expand all Loading... |
31 Type* const kUint16 = | 31 Type* const kUint16 = |
32 CreateNative(CreateRange<uint16_t>(), Type::UntaggedIntegral16()); | 32 CreateNative(CreateRange<uint16_t>(), Type::UntaggedIntegral16()); |
33 Type* const kInt32 = | 33 Type* const kInt32 = |
34 CreateNative(Type::Signed32(), Type::UntaggedIntegral32()); | 34 CreateNative(Type::Signed32(), Type::UntaggedIntegral32()); |
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 kHoleySmi = Type::Union(kSmi, Type::Hole(), zone()); |
41 Type* const kHeapNumber = CreateNative(Type::Number(), Type::TaggedPointer()); | 42 Type* const kHeapNumber = CreateNative(Type::Number(), Type::TaggedPointer()); |
42 | 43 |
43 Type* const kSingletonZero = CreateRange(0.0, 0.0); | 44 Type* const kSingletonZero = CreateRange(0.0, 0.0); |
44 Type* const kSingletonOne = CreateRange(1.0, 1.0); | 45 Type* const kSingletonOne = CreateRange(1.0, 1.0); |
45 Type* const kSingletonTen = CreateRange(10.0, 10.0); | 46 Type* const kSingletonTen = CreateRange(10.0, 10.0); |
46 Type* const kSingletonMinusOne = CreateRange(-1.0, -1.0); | 47 Type* const kSingletonMinusOne = CreateRange(-1.0, -1.0); |
47 Type* const kZeroOrUndefined = | 48 Type* const kZeroOrUndefined = |
48 Type::Union(kSingletonZero, Type::Undefined(), zone()); | 49 Type::Union(kSingletonZero, Type::Undefined(), zone()); |
49 Type* const kTenOrUndefined = | 50 Type* const kTenOrUndefined = |
50 Type::Union(kSingletonTen, Type::Undefined(), zone()); | 51 Type::Union(kSingletonTen, Type::Undefined(), zone()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 return Type::Range(min, max, zone()); | 165 return Type::Range(min, max, zone()); |
165 } | 166 } |
166 | 167 |
167 Zone* zone() { return &zone_; } | 168 Zone* zone() { return &zone_; } |
168 }; | 169 }; |
169 | 170 |
170 } // namespace internal | 171 } // namespace internal |
171 } // namespace v8 | 172 } // namespace v8 |
172 | 173 |
173 #endif // V8_TYPE_CACHE_H_ | 174 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |