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 28 matching lines...) Loading... | |
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 kZeroToThirtyTwo = CreateRange(0.0, 32.0); | 45 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); |
46 Type* const kZeroish = | 46 Type* const kZeroish = |
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 kWeakint = Type::Union(kInteger, Type::MinusZeroOrNaN(), zone()); | 49 Type* const kPositiveInteger = CreateRange(0.0, V8_INFINITY); |
50 Type* const kIntegerish = Type::Union(kInteger, Type::MinusZero(), zone()); | |
Jarin
2015/11/05 09:25:29
I think we need better names for this. How about k
Benedikt Meurer
2015/11/05 09:30:05
Done.
| |
51 Type* const kWeakint = Type::Union(kIntegerish, Type::NaN(), zone()); | |
52 | |
53 Type* const kPositiveSafeInteger = CreateRange(0.0, kMaxSafeInteger); | |
50 | 54 |
51 Type* const kIntegral32 = Type::Union(kInt32, kUint32, zone()); | 55 Type* const kIntegral32 = Type::Union(kInt32, kUint32, zone()); |
52 | 56 |
53 // The FixedArray::length property always containts a smi in the range | 57 // The FixedArray::length property always containts a smi in the range |
54 // [0, FixedArray::kMaxLength]. | 58 // [0, FixedArray::kMaxLength]. |
55 Type* const kFixedArrayLengthType = CreateNative( | 59 Type* const kFixedArrayLengthType = CreateNative( |
56 CreateRange(0.0, FixedArray::kMaxLength), Type::TaggedSigned()); | 60 CreateRange(0.0, FixedArray::kMaxLength), Type::TaggedSigned()); |
57 | 61 |
58 // The FixedDoubleArray::length property always containts a smi in the range | 62 // The FixedDoubleArray::length property always containts a smi in the range |
59 // [0, FixedDoubleArray::kMaxLength]. | 63 // [0, FixedDoubleArray::kMaxLength]. |
(...skipping 39 matching lines...) Loading... | |
99 return Type::Range(min, max, zone()); | 103 return Type::Range(min, max, zone()); |
100 } | 104 } |
101 | 105 |
102 Zone* zone() { return &zone_; } | 106 Zone* zone() { return &zone_; } |
103 }; | 107 }; |
104 | 108 |
105 } // namespace internal | 109 } // namespace internal |
106 } // namespace v8 | 110 } // namespace v8 |
107 | 111 |
108 #endif // V8_TYPE_CACHE_H_ | 112 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |