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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // The FixedDoubleArray::length property always containts a smi in the range | 118 // The FixedDoubleArray::length property always containts a smi in the range |
119 // [0, FixedDoubleArray::kMaxLength]. | 119 // [0, FixedDoubleArray::kMaxLength]. |
120 Type* const kFixedDoubleArrayLengthType = CreateNative( | 120 Type* const kFixedDoubleArrayLengthType = CreateNative( |
121 CreateRange(0.0, FixedDoubleArray::kMaxLength), Type::TaggedSigned()); | 121 CreateRange(0.0, FixedDoubleArray::kMaxLength), Type::TaggedSigned()); |
122 | 122 |
123 // The JSArray::length property always contains a tagged number in the range | 123 // The JSArray::length property always contains a tagged number in the range |
124 // [0, kMaxUInt32]. | 124 // [0, kMaxUInt32]. |
125 Type* const kJSArrayLengthType = | 125 Type* const kJSArrayLengthType = |
126 CreateNative(Type::Unsigned32(), Type::Tagged()); | 126 CreateNative(Type::Unsigned32(), Type::Tagged()); |
127 | 127 |
| 128 // The JSTyped::length property always contains a tagged number in the range |
| 129 // [0, kMaxSmiValue]. |
| 130 Type* const kJSTypedArrayLengthType = |
| 131 CreateNative(Type::UnsignedSmall(), Type::TaggedSigned()); |
| 132 |
128 // The String::length property always contains a smi in the range | 133 // The String::length property always contains a smi in the range |
129 // [0, String::kMaxLength]. | 134 // [0, String::kMaxLength]. |
130 Type* const kStringLengthType = | 135 Type* const kStringLengthType = |
131 CreateNative(CreateRange(0.0, String::kMaxLength), Type::TaggedSigned()); | 136 CreateNative(CreateRange(0.0, String::kMaxLength), Type::TaggedSigned()); |
132 | 137 |
133 #define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \ | 138 #define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \ |
134 Type* const k##TypeName##Array = CreateArray(k##TypeName); | 139 Type* const k##TypeName##Array = CreateArray(k##TypeName); |
135 TYPED_ARRAYS(TYPED_ARRAY) | 140 TYPED_ARRAYS(TYPED_ARRAY) |
136 #undef TYPED_ARRAY | 141 #undef TYPED_ARRAY |
137 | 142 |
(...skipping 21 matching lines...) Expand all Loading... |
159 return Type::Range(min, max, zone()); | 164 return Type::Range(min, max, zone()); |
160 } | 165 } |
161 | 166 |
162 Zone* zone() { return &zone_; } | 167 Zone* zone() { return &zone_; } |
163 }; | 168 }; |
164 | 169 |
165 } // namespace internal | 170 } // namespace internal |
166 } // namespace v8 | 171 } // namespace v8 |
167 | 172 |
168 #endif // V8_TYPE_CACHE_H_ | 173 #endif // V8_TYPE_CACHE_H_ |
OLD | NEW |