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 #include <iomanip> | 5 #include <iomanip> |
6 | 6 |
7 #include "src/types.h" | 7 #include "src/types.h" |
8 | 8 |
9 #include "src/handles-inl.h" | 9 #include "src/handles-inl.h" |
10 #include "src/ostreams.h" | 10 #include "src/ostreams.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 map == heap->uninitialized_map() || | 191 map == heap->uninitialized_map() || |
192 map == heap->no_interceptor_result_sentinel_map() || | 192 map == heap->no_interceptor_result_sentinel_map() || |
193 map == heap->termination_exception_map() || | 193 map == heap->termination_exception_map() || |
194 map == heap->arguments_marker_map()); | 194 map == heap->arguments_marker_map()); |
195 return kInternal & kTaggedPointer; | 195 return kInternal & kTaggedPointer; |
196 } | 196 } |
197 case HEAP_NUMBER_TYPE: | 197 case HEAP_NUMBER_TYPE: |
198 return kNumber & kTaggedPointer; | 198 return kNumber & kTaggedPointer; |
199 case SIMD128_VALUE_TYPE: | 199 case SIMD128_VALUE_TYPE: |
200 return kSimd; | 200 return kSimd; |
201 case JS_OBJECT_TYPE: | |
202 case JS_GLOBAL_OBJECT_TYPE: | |
203 case JS_GLOBAL_PROXY_TYPE: | |
204 if (map->is_undetectable()) return kOtherUndetectable; | |
205 return kOtherObject; | |
206 case JS_VALUE_TYPE: | 201 case JS_VALUE_TYPE: |
207 case JS_MESSAGE_OBJECT_TYPE: | 202 case JS_MESSAGE_OBJECT_TYPE: |
208 case JS_DATE_TYPE: | 203 case JS_DATE_TYPE: |
| 204 case JS_OBJECT_TYPE: |
209 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 205 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
210 case JS_GENERATOR_OBJECT_TYPE: | 206 case JS_GENERATOR_OBJECT_TYPE: |
211 case JS_MODULE_TYPE: | 207 case JS_MODULE_TYPE: |
| 208 case JS_GLOBAL_OBJECT_TYPE: |
| 209 case JS_GLOBAL_PROXY_TYPE: |
212 case JS_ARRAY_BUFFER_TYPE: | 210 case JS_ARRAY_BUFFER_TYPE: |
213 case JS_ARRAY_TYPE: | 211 case JS_ARRAY_TYPE: |
214 case JS_REGEXP_TYPE: // TODO(rossberg): there should be a RegExp type. | |
215 case JS_TYPED_ARRAY_TYPE: | 212 case JS_TYPED_ARRAY_TYPE: |
216 case JS_DATA_VIEW_TYPE: | 213 case JS_DATA_VIEW_TYPE: |
217 case JS_SET_TYPE: | 214 case JS_SET_TYPE: |
218 case JS_MAP_TYPE: | 215 case JS_MAP_TYPE: |
219 case JS_SET_ITERATOR_TYPE: | 216 case JS_SET_ITERATOR_TYPE: |
220 case JS_MAP_ITERATOR_TYPE: | 217 case JS_MAP_ITERATOR_TYPE: |
221 case JS_WEAK_MAP_TYPE: | 218 case JS_WEAK_MAP_TYPE: |
222 case JS_WEAK_SET_TYPE: | 219 case JS_WEAK_SET_TYPE: |
223 case JS_PROMISE_TYPE: | 220 case JS_PROMISE_TYPE: |
224 case JS_BOUND_FUNCTION_TYPE: | 221 case JS_BOUND_FUNCTION_TYPE: |
225 DCHECK(!map->is_undetectable()); | 222 if (map->is_undetectable()) return kUndetectable; |
226 return kOtherObject; | 223 return kOtherObject; |
227 case JS_FUNCTION_TYPE: | 224 case JS_FUNCTION_TYPE: |
228 DCHECK(!map->is_undetectable()); | 225 if (map->is_undetectable()) return kUndetectable; |
229 return kFunction; | 226 return kFunction; |
| 227 case JS_REGEXP_TYPE: |
| 228 return kOtherObject; // TODO(rossberg): there should be a RegExp type. |
230 case JS_PROXY_TYPE: | 229 case JS_PROXY_TYPE: |
231 DCHECK(!map->is_undetectable()); | |
232 return kProxy; | 230 return kProxy; |
233 case MAP_TYPE: | 231 case MAP_TYPE: |
| 232 // When compiling stub templates, the meta map is used as a place holder |
| 233 // for the actual map with which the template is later instantiated. |
| 234 // We treat it as a kind of type variable whose upper bound is Any. |
| 235 // TODO(rossberg): for caching of CompareNilIC stubs to work correctly, |
| 236 // we must exclude Undetectable here. This makes no sense, really, |
| 237 // because it means that the template isn't actually parametric. |
| 238 // Also, it doesn't apply elsewhere. 8-( |
| 239 // We ought to find a cleaner solution for compiling stubs parameterised |
| 240 // over type or class variables, esp ones with bounds... |
| 241 return kDetectable & kTaggedPointer; |
234 case ALLOCATION_SITE_TYPE: | 242 case ALLOCATION_SITE_TYPE: |
235 case ACCESSOR_INFO_TYPE: | 243 case ACCESSOR_INFO_TYPE: |
236 case SHARED_FUNCTION_INFO_TYPE: | 244 case SHARED_FUNCTION_INFO_TYPE: |
237 case ACCESSOR_PAIR_TYPE: | 245 case ACCESSOR_PAIR_TYPE: |
238 case FIXED_ARRAY_TYPE: | 246 case FIXED_ARRAY_TYPE: |
239 case FIXED_DOUBLE_ARRAY_TYPE: | 247 case FIXED_DOUBLE_ARRAY_TYPE: |
240 case BYTE_ARRAY_TYPE: | 248 case BYTE_ARRAY_TYPE: |
241 case BYTECODE_ARRAY_TYPE: | 249 case BYTECODE_ARRAY_TYPE: |
242 case TRANSITION_ARRAY_TYPE: | 250 case TRANSITION_ARRAY_TYPE: |
243 case FOREIGN_TYPE: | 251 case FOREIGN_TYPE: |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 #undef CONSTRUCT_SIMD_TYPE | 1274 #undef CONSTRUCT_SIMD_TYPE |
1267 | 1275 |
1268 // ----------------------------------------------------------------------------- | 1276 // ----------------------------------------------------------------------------- |
1269 // Instantiations. | 1277 // Instantiations. |
1270 | 1278 |
1271 template class Type::Iterator<i::Map>; | 1279 template class Type::Iterator<i::Map>; |
1272 template class Type::Iterator<i::Object>; | 1280 template class Type::Iterator<i::Object>; |
1273 | 1281 |
1274 } // namespace internal | 1282 } // namespace internal |
1275 } // namespace v8 | 1283 } // namespace v8 |
OLD | NEW |