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/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/types-inl.h" | 10 #include "src/types-inl.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 map == heap->no_interceptor_result_sentinel_map() || | 224 map == heap->no_interceptor_result_sentinel_map() || |
225 map == heap->termination_exception_map() || | 225 map == heap->termination_exception_map() || |
226 map == heap->arguments_marker_map()); | 226 map == heap->arguments_marker_map()); |
227 return kInternal & kTaggedPointer; | 227 return kInternal & kTaggedPointer; |
228 } | 228 } |
229 case HEAP_NUMBER_TYPE: | 229 case HEAP_NUMBER_TYPE: |
230 return kNumber & kTaggedPointer; | 230 return kNumber & kTaggedPointer; |
231 case SIMD128_VALUE_TYPE: | 231 case SIMD128_VALUE_TYPE: |
232 return kSimd; | 232 return kSimd; |
233 case JS_VALUE_TYPE: | 233 case JS_VALUE_TYPE: |
234 case JS_MESSAGE_OBJECT_TYPE: | |
234 case JS_DATE_TYPE: | 235 case JS_DATE_TYPE: |
235 case JS_OBJECT_TYPE: | 236 case JS_OBJECT_TYPE: |
236 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 237 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
237 case JS_GENERATOR_OBJECT_TYPE: | 238 case JS_GENERATOR_OBJECT_TYPE: |
238 case JS_MODULE_TYPE: | 239 case JS_MODULE_TYPE: |
239 case JS_BUILTINS_OBJECT_TYPE: | 240 case JS_BUILTINS_OBJECT_TYPE: |
240 case JS_GLOBAL_OBJECT_TYPE: | 241 case JS_GLOBAL_OBJECT_TYPE: |
241 case JS_GLOBAL_PROXY_TYPE: | 242 case JS_GLOBAL_PROXY_TYPE: |
242 case JS_ARRAY_BUFFER_TYPE: | 243 case JS_ARRAY_BUFFER_TYPE: |
243 case JS_ARRAY_TYPE: | 244 case JS_ARRAY_TYPE: |
244 case JS_TYPED_ARRAY_TYPE: | 245 case JS_TYPED_ARRAY_TYPE: |
245 case JS_DATA_VIEW_TYPE: | 246 case JS_DATA_VIEW_TYPE: |
246 case JS_SET_TYPE: | 247 case JS_SET_TYPE: |
247 case JS_MAP_TYPE: | 248 case JS_MAP_TYPE: |
248 case JS_SET_ITERATOR_TYPE: | 249 case JS_SET_ITERATOR_TYPE: |
249 case JS_MAP_ITERATOR_TYPE: | 250 case JS_MAP_ITERATOR_TYPE: |
251 case JS_ITERATOR_RESULT_TYPE: | |
250 case JS_WEAK_MAP_TYPE: | 252 case JS_WEAK_MAP_TYPE: |
251 case JS_WEAK_SET_TYPE: | 253 case JS_WEAK_SET_TYPE: |
252 if (map->is_undetectable()) return kUndetectable; | 254 if (map->is_undetectable()) return kUndetectable; |
253 return kOtherObject; | 255 return kOtherObject; |
254 case JS_FUNCTION_TYPE: | 256 case JS_FUNCTION_TYPE: |
255 return kOtherObject; // TODO(rossberg): there should be a Function type. | 257 return kOtherObject; // TODO(rossberg): there should be a Function type. |
256 case JS_REGEXP_TYPE: | 258 case JS_REGEXP_TYPE: |
257 return kOtherObject; // TODO(rossberg): there should be a RegExp type. | 259 return kOtherObject; // TODO(rossberg): there should be a RegExp type. |
258 case JS_PROXY_TYPE: | 260 case JS_PROXY_TYPE: |
259 case JS_FUNCTION_PROXY_TYPE: | 261 case JS_FUNCTION_PROXY_TYPE: |
260 return kProxy; | 262 return kProxy; |
261 case MAP_TYPE: | 263 case MAP_TYPE: |
262 // When compiling stub templates, the meta map is used as a place holder | 264 // When compiling stub templates, the meta map is used as a place holder |
263 // for the actual map with which the template is later instantiated. | 265 // for the actual map with which the template is later instantiated. |
264 // We treat it as a kind of type variable whose upper bound is Any. | 266 // We treat it as a kind of type variable whose upper bound is Any. |
265 // TODO(rossberg): for caching of CompareNilIC stubs to work correctly, | 267 // TODO(rossberg): for caching of CompareNilIC stubs to work correctly, |
266 // we must exclude Undetectable here. This makes no sense, really, | 268 // we must exclude Undetectable here. This makes no sense, really, |
267 // because it means that the template isn't actually parametric. | 269 // because it means that the template isn't actually parametric. |
268 // Also, it doesn't apply elsewhere. 8-( | 270 // Also, it doesn't apply elsewhere. 8-( |
269 // We ought to find a cleaner solution for compiling stubs parameterised | 271 // We ought to find a cleaner solution for compiling stubs parameterised |
270 // over type or class variables, esp ones with bounds... | 272 // over type or class variables, esp ones with bounds... |
271 return kDetectable & kTaggedPointer; | 273 return kDetectable & kTaggedPointer; |
272 case DECLARED_ACCESSOR_INFO_TYPE: | 274 case DECLARED_ACCESSOR_INFO_TYPE: |
273 case EXECUTABLE_ACCESSOR_INFO_TYPE: | 275 case EXECUTABLE_ACCESSOR_INFO_TYPE: |
274 case SHARED_FUNCTION_INFO_TYPE: | 276 case SHARED_FUNCTION_INFO_TYPE: |
275 case ACCESSOR_PAIR_TYPE: | 277 case ACCESSOR_PAIR_TYPE: |
276 case FIXED_ARRAY_TYPE: | 278 case FIXED_ARRAY_TYPE: |
279 case FIXED_DOUBLE_ARRAY_TYPE: | |
277 case BYTE_ARRAY_TYPE: | 280 case BYTE_ARRAY_TYPE: |
278 case BYTECODE_ARRAY_TYPE: | 281 case BYTECODE_ARRAY_TYPE: |
279 case FOREIGN_TYPE: | 282 case FOREIGN_TYPE: |
280 case SCRIPT_TYPE: | 283 case SCRIPT_TYPE: |
281 case CODE_TYPE: | 284 case CODE_TYPE: |
282 case PROPERTY_CELL_TYPE: | 285 case PROPERTY_CELL_TYPE: |
283 return kInternal & kTaggedPointer; | 286 return kInternal & kTaggedPointer; |
284 default: | 287 |
288 // Remaining instance types are unsupported for now. If any of them do | |
289 // require bit set types, they should get kInternal & kTaggedPointer. | |
290 case MUTABLE_HEAP_NUMBER_TYPE: | |
291 case FREE_SPACE_TYPE: | |
292 #define FIXED_TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | |
293 case FIXED_##TYPE##_ARRAY_TYPE: | |
Jakob Kummerow
2015/09/04 11:19:11
clang-format insists on this indentation :-/
| |
294 | |
295 TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE) | |
296 #undef FIXED_TYPED_ARRAY_CASE | |
297 case FILLER_TYPE: | |
298 case DECLARED_ACCESSOR_DESCRIPTOR_TYPE: | |
299 case ACCESS_CHECK_INFO_TYPE: | |
300 case INTERCEPTOR_INFO_TYPE: | |
301 case CALL_HANDLER_INFO_TYPE: | |
302 case FUNCTION_TEMPLATE_INFO_TYPE: | |
303 case OBJECT_TEMPLATE_INFO_TYPE: | |
304 case SIGNATURE_INFO_TYPE: | |
305 case TYPE_SWITCH_INFO_TYPE: | |
306 case ALLOCATION_SITE_TYPE: | |
307 case ALLOCATION_MEMENTO_TYPE: | |
308 case CODE_CACHE_TYPE: | |
309 case POLYMORPHIC_CODE_CACHE_TYPE: | |
310 case TYPE_FEEDBACK_INFO_TYPE: | |
311 case ALIASED_ARGUMENTS_ENTRY_TYPE: | |
312 case BOX_TYPE: | |
313 case DEBUG_INFO_TYPE: | |
314 case BREAK_POINT_INFO_TYPE: | |
315 case CELL_TYPE: | |
316 case WEAK_CELL_TYPE: | |
317 case PROTOTYPE_INFO_TYPE: | |
318 case SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE: | |
285 UNREACHABLE(); | 319 UNREACHABLE(); |
286 return kNone; | 320 return kNone; |
287 } | 321 } |
322 UNREACHABLE(); | |
323 return kNone; | |
288 } | 324 } |
289 | 325 |
290 | 326 |
291 template<class Config> | 327 template<class Config> |
292 typename TypeImpl<Config>::bitset | 328 typename TypeImpl<Config>::bitset |
293 TypeImpl<Config>::BitsetType::Lub(i::Object* value) { | 329 TypeImpl<Config>::BitsetType::Lub(i::Object* value) { |
294 DisallowHeapAllocation no_allocation; | 330 DisallowHeapAllocation no_allocation; |
295 if (value->IsNumber()) { | 331 if (value->IsNumber()) { |
296 return Lub(value->Number()) & | 332 return Lub(value->Number()) & |
297 (value->IsSmi() ? kTaggedSigned : kTaggedPointer); | 333 (value->IsSmi() ? kTaggedSigned : kTaggedPointer); |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1364 | 1400 |
1365 template TypeImpl<ZoneTypeConfig>::TypeHandle | 1401 template TypeImpl<ZoneTypeConfig>::TypeHandle |
1366 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 1402 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
1367 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 1403 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
1368 template TypeImpl<HeapTypeConfig>::TypeHandle | 1404 template TypeImpl<HeapTypeConfig>::TypeHandle |
1369 TypeImpl<HeapTypeConfig>::Convert<Type>( | 1405 TypeImpl<HeapTypeConfig>::Convert<Type>( |
1370 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 1406 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
1371 | 1407 |
1372 } // namespace internal | 1408 } // namespace internal |
1373 } // namespace v8 | 1409 } // namespace v8 |
OLD | NEW |