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_ZONE_TYPE_CACHE_H_ | 5 #ifndef V8_ZONE_TYPE_CACHE_H_ |
6 #define V8_ZONE_TYPE_CACHE_H_ | 6 #define V8_ZONE_TYPE_CACHE_H_ |
7 | 7 |
8 | 8 |
9 #include "src/types.h" | 9 #include "src/types.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 CreateNative(CreateRange<uint16_t>(), Type::UntaggedUnsigned16()); | 30 CreateNative(CreateRange<uint16_t>(), Type::UntaggedUnsigned16()); |
31 Type* const kInt32 = CreateNative(Type::Signed32(), Type::UntaggedSigned32()); | 31 Type* const kInt32 = CreateNative(Type::Signed32(), Type::UntaggedSigned32()); |
32 Type* const kUint32 = | 32 Type* const kUint32 = |
33 CreateNative(Type::Unsigned32(), Type::UntaggedUnsigned32()); | 33 CreateNative(Type::Unsigned32(), Type::UntaggedUnsigned32()); |
34 Type* const kFloat32 = CreateNative(Type::Number(), Type::UntaggedFloat32()); | 34 Type* const kFloat32 = CreateNative(Type::Number(), Type::UntaggedFloat32()); |
35 Type* const kFloat64 = CreateNative(Type::Number(), Type::UntaggedFloat64()); | 35 Type* const kFloat64 = CreateNative(Type::Number(), Type::UntaggedFloat64()); |
36 | 36 |
37 Type* const kSingletonZero = CreateRange(0.0, 0.0); | 37 Type* const kSingletonZero = CreateRange(0.0, 0.0); |
38 Type* const kSingletonOne = CreateRange(1.0, 1.0); | 38 Type* const kSingletonOne = CreateRange(1.0, 1.0); |
39 Type* const kZeroOrOne = CreateRange(0.0, 1.0); | 39 Type* const kZeroOrOne = CreateRange(0.0, 1.0); |
| 40 Type* const kZeroToThirtyTwo = CreateRange(0.0, 32.0); |
40 Type* const kZeroish = | 41 Type* const kZeroish = |
41 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); | 42 Type::Union(kSingletonZero, Type::MinusZeroOrNaN(), zone()); |
42 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); | 43 Type* const kInteger = CreateRange(-V8_INFINITY, V8_INFINITY); |
43 Type* const kWeakint = Type::Union(kInteger, Type::MinusZeroOrNaN(), zone()); | 44 Type* const kWeakint = Type::Union(kInteger, Type::MinusZeroOrNaN(), zone()); |
44 Type* const kWeakintFunc1 = Type::Function(kWeakint, Type::Number(), zone()); | |
45 | |
46 Type* const kRandomFunc0 = Type::Function(Type::OrderedNumber(), zone()); | |
47 Type* const kAnyFunc0 = Type::Function(Type::Any(), zone()); | |
48 Type* const kAnyFunc1 = Type::Function(Type::Any(), Type::Any(), zone()); | |
49 Type* const kAnyFunc2 = | |
50 Type::Function(Type::Any(), Type::Any(), Type::Any(), zone()); | |
51 Type* const kAnyFunc3 = Type::Function(Type::Any(), Type::Any(), Type::Any(), | |
52 Type::Any(), zone()); | |
53 Type* const kNumberFunc0 = Type::Function(Type::Number(), zone()); | |
54 Type* const kNumberFunc1 = | |
55 Type::Function(Type::Number(), Type::Number(), zone()); | |
56 Type* const kNumberFunc2 = | |
57 Type::Function(Type::Number(), Type::Number(), Type::Number(), zone()); | |
58 Type* const kImulFunc = Type::Function(Type::Signed32(), Type::Integral32(), | |
59 Type::Integral32(), zone()); | |
60 Type* const kClz32Func = | |
61 Type::Function(CreateRange(0, 32), Type::Number(), zone()); | |
62 | 45 |
63 #define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \ | 46 #define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \ |
64 Type* const k##TypeName##Array = CreateArray(k##TypeName); | 47 Type* const k##TypeName##Array = CreateArray(k##TypeName); |
65 TYPED_ARRAYS(TYPED_ARRAY) | 48 TYPED_ARRAYS(TYPED_ARRAY) |
66 #undef TYPED_ARRAY | 49 #undef TYPED_ARRAY |
67 | 50 |
68 private: | 51 private: |
69 Type* CreateArray(Type* element) { return Type::Array(element, zone()); } | 52 Type* CreateArray(Type* element) { return Type::Array(element, zone()); } |
70 | 53 |
71 Type* CreateArrayFunction(Type* array) { | 54 Type* CreateArrayFunction(Type* array) { |
(...skipping 17 matching lines...) Expand all Loading... |
89 return Type::Range(min, max, zone()); | 72 return Type::Range(min, max, zone()); |
90 } | 73 } |
91 | 74 |
92 Zone* zone() { return &zone_; } | 75 Zone* zone() { return &zone_; } |
93 }; | 76 }; |
94 | 77 |
95 } // namespace internal | 78 } // namespace internal |
96 } // namespace v8 | 79 } // namespace v8 |
97 | 80 |
98 #endif // V8_ZONE_TYPE_CACHE_H_ | 81 #endif // V8_ZONE_TYPE_CACHE_H_ |
OLD | NEW |