Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: src/objects.h

Issue 2578573002: Add unittests to keep InstanceType lists in sync (Closed)
Patch Set: fix merge artifacts Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/types.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // 313 //
314 // NOTE: The following things are some that depend on the string types having 314 // NOTE: The following things are some that depend on the string types having
315 // instance_types that are less than those of all other types: 315 // instance_types that are less than those of all other types:
316 // HeapObject::Size, HeapObject::IterateBody, the typeof operator, and 316 // HeapObject::Size, HeapObject::IterateBody, the typeof operator, and
317 // Object::IsString. 317 // Object::IsString.
318 // 318 //
319 // NOTE: Everything following JS_VALUE_TYPE is considered a 319 // NOTE: Everything following JS_VALUE_TYPE is considered a
320 // JSObject for GC purposes. The first four entries here have typeof 320 // JSObject for GC purposes. The first four entries here have typeof
321 // 'object', whereas JS_FUNCTION_TYPE has typeof 'function'. 321 // 'object', whereas JS_FUNCTION_TYPE has typeof 'function'.
322 #define INSTANCE_TYPE_LIST(V) \ 322 #define INSTANCE_TYPE_LIST(V) \
323 V(INTERNALIZED_STRING_TYPE) \
324 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \
325 V(ONE_BYTE_INTERNALIZED_STRING_TYPE) \
326 V(EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \
327 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
328 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \
329 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \
330 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
323 V(STRING_TYPE) \ 331 V(STRING_TYPE) \
332 V(CONS_STRING_TYPE) \
333 V(EXTERNAL_STRING_TYPE) \
334 V(SLICED_STRING_TYPE) \
324 V(ONE_BYTE_STRING_TYPE) \ 335 V(ONE_BYTE_STRING_TYPE) \
325 V(CONS_STRING_TYPE) \
326 V(CONS_ONE_BYTE_STRING_TYPE) \ 336 V(CONS_ONE_BYTE_STRING_TYPE) \
327 V(SLICED_STRING_TYPE) \ 337 V(EXTERNAL_ONE_BYTE_STRING_TYPE) \
328 V(SLICED_ONE_BYTE_STRING_TYPE) \ 338 V(SLICED_ONE_BYTE_STRING_TYPE) \
329 V(EXTERNAL_STRING_TYPE) \
330 V(EXTERNAL_ONE_BYTE_STRING_TYPE) \
331 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ 339 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \
332 V(SHORT_EXTERNAL_STRING_TYPE) \ 340 V(SHORT_EXTERNAL_STRING_TYPE) \
333 V(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE) \ 341 V(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE) \
334 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ 342 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \
335 \ 343 \
336 V(INTERNALIZED_STRING_TYPE) \
337 V(ONE_BYTE_INTERNALIZED_STRING_TYPE) \
338 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \
339 V(EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \
340 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
341 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \
342 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \
343 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
344 \
345 V(SYMBOL_TYPE) \ 344 V(SYMBOL_TYPE) \
345 V(HEAP_NUMBER_TYPE) \
346 V(SIMD128_VALUE_TYPE) \ 346 V(SIMD128_VALUE_TYPE) \
347 V(ODDBALL_TYPE) \
347 \ 348 \
348 V(MAP_TYPE) \ 349 V(MAP_TYPE) \
349 V(CODE_TYPE) \ 350 V(CODE_TYPE) \
350 V(ODDBALL_TYPE) \
351 V(CELL_TYPE) \
352 V(PROPERTY_CELL_TYPE) \
353 \
354 V(HEAP_NUMBER_TYPE) \
355 V(MUTABLE_HEAP_NUMBER_TYPE) \ 351 V(MUTABLE_HEAP_NUMBER_TYPE) \
356 V(FOREIGN_TYPE) \ 352 V(FOREIGN_TYPE) \
357 V(BYTE_ARRAY_TYPE) \ 353 V(BYTE_ARRAY_TYPE) \
358 V(BYTECODE_ARRAY_TYPE) \ 354 V(BYTECODE_ARRAY_TYPE) \
359 V(FREE_SPACE_TYPE) \ 355 V(FREE_SPACE_TYPE) \
360 \ 356 \
361 V(FIXED_INT8_ARRAY_TYPE) \ 357 V(FIXED_INT8_ARRAY_TYPE) \
362 V(FIXED_UINT8_ARRAY_TYPE) \ 358 V(FIXED_UINT8_ARRAY_TYPE) \
363 V(FIXED_INT16_ARRAY_TYPE) \ 359 V(FIXED_INT16_ARRAY_TYPE) \
364 V(FIXED_UINT16_ARRAY_TYPE) \ 360 V(FIXED_UINT16_ARRAY_TYPE) \
365 V(FIXED_INT32_ARRAY_TYPE) \ 361 V(FIXED_INT32_ARRAY_TYPE) \
366 V(FIXED_UINT32_ARRAY_TYPE) \ 362 V(FIXED_UINT32_ARRAY_TYPE) \
367 V(FIXED_FLOAT32_ARRAY_TYPE) \ 363 V(FIXED_FLOAT32_ARRAY_TYPE) \
368 V(FIXED_FLOAT64_ARRAY_TYPE) \ 364 V(FIXED_FLOAT64_ARRAY_TYPE) \
369 V(FIXED_UINT8_CLAMPED_ARRAY_TYPE) \ 365 V(FIXED_UINT8_CLAMPED_ARRAY_TYPE) \
370 \ 366 \
367 V(FIXED_DOUBLE_ARRAY_TYPE) \
371 V(FILLER_TYPE) \ 368 V(FILLER_TYPE) \
372 \ 369 \
373 V(ACCESSOR_INFO_TYPE) \ 370 V(ACCESSOR_INFO_TYPE) \
374 V(ACCESSOR_PAIR_TYPE) \ 371 V(ACCESSOR_PAIR_TYPE) \
375 V(ACCESS_CHECK_INFO_TYPE) \ 372 V(ACCESS_CHECK_INFO_TYPE) \
376 V(INTERCEPTOR_INFO_TYPE) \ 373 V(INTERCEPTOR_INFO_TYPE) \
377 V(CALL_HANDLER_INFO_TYPE) \ 374 V(CALL_HANDLER_INFO_TYPE) \
378 V(FUNCTION_TEMPLATE_INFO_TYPE) \ 375 V(FUNCTION_TEMPLATE_INFO_TYPE) \
379 V(OBJECT_TEMPLATE_INFO_TYPE) \ 376 V(OBJECT_TEMPLATE_INFO_TYPE) \
380 V(SIGNATURE_INFO_TYPE) \ 377 V(ALLOCATION_SITE_TYPE) \
381 V(TYPE_SWITCH_INFO_TYPE) \
382 V(ALLOCATION_MEMENTO_TYPE) \ 378 V(ALLOCATION_MEMENTO_TYPE) \
383 V(ALLOCATION_SITE_TYPE) \
384 V(SCRIPT_TYPE) \ 379 V(SCRIPT_TYPE) \
385 V(TYPE_FEEDBACK_INFO_TYPE) \ 380 V(TYPE_FEEDBACK_INFO_TYPE) \
386 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ 381 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
387 V(BOX_TYPE) \ 382 V(BOX_TYPE) \
388 V(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE) \ 383 V(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE) \
389 V(PROMISE_REACTION_JOB_INFO_TYPE) \ 384 V(PROMISE_REACTION_JOB_INFO_TYPE) \
385 V(DEBUG_INFO_TYPE) \
386 V(BREAK_POINT_INFO_TYPE) \
390 V(PROTOTYPE_INFO_TYPE) \ 387 V(PROTOTYPE_INFO_TYPE) \
391 V(TUPLE2_TYPE) \ 388 V(TUPLE2_TYPE) \
392 V(TUPLE3_TYPE) \ 389 V(TUPLE3_TYPE) \
393 V(CONTEXT_EXTENSION_TYPE) \ 390 V(CONTEXT_EXTENSION_TYPE) \
394 V(CONSTANT_ELEMENTS_PAIR_TYPE) \ 391 V(CONSTANT_ELEMENTS_PAIR_TYPE) \
395 V(MODULE_TYPE) \ 392 V(MODULE_TYPE) \
396 V(MODULE_INFO_ENTRY_TYPE) \ 393 V(MODULE_INFO_ENTRY_TYPE) \
394 V(FIXED_ARRAY_TYPE) \
395 V(TRANSITION_ARRAY_TYPE) \
396 V(SHARED_FUNCTION_INFO_TYPE) \
397 V(CELL_TYPE) \
398 V(WEAK_CELL_TYPE) \
399 V(PROPERTY_CELL_TYPE) \
397 \ 400 \
398 V(FIXED_ARRAY_TYPE) \ 401 V(JS_PROXY_TYPE) \
399 V(FIXED_DOUBLE_ARRAY_TYPE) \ 402 V(JS_GLOBAL_OBJECT_TYPE) \
400 V(SHARED_FUNCTION_INFO_TYPE) \ 403 V(JS_GLOBAL_PROXY_TYPE) \
401 V(WEAK_CELL_TYPE) \ 404 V(JS_SPECIAL_API_OBJECT_TYPE) \
402 V(TRANSITION_ARRAY_TYPE) \ 405 V(JS_VALUE_TYPE) \
403 \
404 V(JS_MESSAGE_OBJECT_TYPE) \ 406 V(JS_MESSAGE_OBJECT_TYPE) \
405 \
406 V(JS_VALUE_TYPE) \
407 V(JS_DATE_TYPE) \ 407 V(JS_DATE_TYPE) \
408 V(JS_API_OBJECT_TYPE) \
408 V(JS_OBJECT_TYPE) \ 409 V(JS_OBJECT_TYPE) \
409 V(JS_ARGUMENTS_TYPE) \ 410 V(JS_ARGUMENTS_TYPE) \
410 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ 411 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
411 V(JS_GENERATOR_OBJECT_TYPE) \ 412 V(JS_GENERATOR_OBJECT_TYPE) \
412 V(JS_MODULE_NAMESPACE_TYPE) \ 413 V(JS_MODULE_NAMESPACE_TYPE) \
413 V(JS_GLOBAL_OBJECT_TYPE) \
414 V(JS_GLOBAL_PROXY_TYPE) \
415 V(JS_API_OBJECT_TYPE) \
416 V(JS_SPECIAL_API_OBJECT_TYPE) \
417 V(JS_ARRAY_TYPE) \ 414 V(JS_ARRAY_TYPE) \
418 V(JS_ARRAY_BUFFER_TYPE) \ 415 V(JS_ARRAY_BUFFER_TYPE) \
419 V(JS_TYPED_ARRAY_TYPE) \ 416 V(JS_TYPED_ARRAY_TYPE) \
420 V(JS_DATA_VIEW_TYPE) \ 417 V(JS_DATA_VIEW_TYPE) \
421 V(JS_PROXY_TYPE) \
422 V(JS_SET_TYPE) \ 418 V(JS_SET_TYPE) \
423 V(JS_MAP_TYPE) \ 419 V(JS_MAP_TYPE) \
424 V(JS_SET_ITERATOR_TYPE) \ 420 V(JS_SET_ITERATOR_TYPE) \
425 V(JS_MAP_ITERATOR_TYPE) \ 421 V(JS_MAP_ITERATOR_TYPE) \
426 V(JS_WEAK_MAP_TYPE) \ 422 V(JS_WEAK_MAP_TYPE) \
427 V(JS_WEAK_SET_TYPE) \ 423 V(JS_WEAK_SET_TYPE) \
428 V(JS_PROMISE_TYPE) \ 424 V(JS_PROMISE_TYPE) \
429 V(JS_REGEXP_TYPE) \ 425 V(JS_REGEXP_TYPE) \
430 V(JS_ERROR_TYPE) \ 426 V(JS_ERROR_TYPE) \
431 V(JS_STRING_ITERATOR_TYPE) \ 427 V(JS_STRING_ITERATOR_TYPE) \
432 \ 428 \
433 V(JS_TYPED_ARRAY_KEY_ITERATOR_TYPE) \ 429 V(JS_TYPED_ARRAY_KEY_ITERATOR_TYPE) \
434 V(JS_FAST_ARRAY_KEY_ITERATOR_TYPE) \ 430 V(JS_FAST_ARRAY_KEY_ITERATOR_TYPE) \
435 V(JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE) \ 431 V(JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE) \
436 \ 432 \
433 V(JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
437 V(JS_INT8_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 434 V(JS_INT8_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
438 V(JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 435 V(JS_UINT16_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
439 V(JS_INT16_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 436 V(JS_INT16_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
440 V(JS_UINT16_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 437 V(JS_UINT32_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
441 V(JS_INT32_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 438 V(JS_INT32_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
442 V(JS_UINT32_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
443 V(JS_FLOAT32_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 439 V(JS_FLOAT32_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
444 V(JS_FLOAT64_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 440 V(JS_FLOAT64_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
445 V(JS_UINT8_CLAMPED_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 441 V(JS_UINT8_CLAMPED_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
446 \ 442 \
447 V(JS_FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 443 V(JS_FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
448 V(JS_FAST_HOLEY_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 444 V(JS_FAST_HOLEY_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
449 V(JS_FAST_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 445 V(JS_FAST_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
450 V(JS_FAST_HOLEY_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 446 V(JS_FAST_HOLEY_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
451 V(JS_FAST_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 447 V(JS_FAST_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
452 V(JS_FAST_HOLEY_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 448 V(JS_FAST_HOLEY_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
453 V(JS_GENERIC_ARRAY_KEY_VALUE_ITERATOR_TYPE) \ 449 V(JS_GENERIC_ARRAY_KEY_VALUE_ITERATOR_TYPE) \
454 \ 450 \
451 V(JS_UINT8_ARRAY_VALUE_ITERATOR_TYPE) \
455 V(JS_INT8_ARRAY_VALUE_ITERATOR_TYPE) \ 452 V(JS_INT8_ARRAY_VALUE_ITERATOR_TYPE) \
456 V(JS_UINT8_ARRAY_VALUE_ITERATOR_TYPE) \ 453 V(JS_UINT16_ARRAY_VALUE_ITERATOR_TYPE) \
457 V(JS_INT16_ARRAY_VALUE_ITERATOR_TYPE) \ 454 V(JS_INT16_ARRAY_VALUE_ITERATOR_TYPE) \
458 V(JS_UINT16_ARRAY_VALUE_ITERATOR_TYPE) \ 455 V(JS_UINT32_ARRAY_VALUE_ITERATOR_TYPE) \
459 V(JS_INT32_ARRAY_VALUE_ITERATOR_TYPE) \ 456 V(JS_INT32_ARRAY_VALUE_ITERATOR_TYPE) \
460 V(JS_UINT32_ARRAY_VALUE_ITERATOR_TYPE) \
461 V(JS_FLOAT32_ARRAY_VALUE_ITERATOR_TYPE) \ 457 V(JS_FLOAT32_ARRAY_VALUE_ITERATOR_TYPE) \
462 V(JS_FLOAT64_ARRAY_VALUE_ITERATOR_TYPE) \ 458 V(JS_FLOAT64_ARRAY_VALUE_ITERATOR_TYPE) \
463 V(JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE) \ 459 V(JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE) \
464 \ 460 \
465 V(JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE) \ 461 V(JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE) \
466 V(JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE) \ 462 V(JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE) \
467 V(JS_FAST_ARRAY_VALUE_ITERATOR_TYPE) \ 463 V(JS_FAST_ARRAY_VALUE_ITERATOR_TYPE) \
468 V(JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE) \ 464 V(JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE) \
469 V(JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \ 465 V(JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \
470 V(JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \ 466 V(JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \
471 V(JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE) \ 467 V(JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE) \
472 \ 468 \
473 V(JS_BOUND_FUNCTION_TYPE) \ 469 V(JS_BOUND_FUNCTION_TYPE) \
474 V(JS_FUNCTION_TYPE) \ 470 V(JS_FUNCTION_TYPE)
475 V(DEBUG_INFO_TYPE) \
476 V(BREAK_POINT_INFO_TYPE)
477 471
478 // Since string types are not consecutive, this macro is used to 472 // Since string types are not consecutive, this macro is used to
479 // iterate over them. 473 // iterate over them.
480 #define STRING_TYPE_LIST(V) \ 474 #define STRING_TYPE_LIST(V) \
481 V(STRING_TYPE, kVariableSizeSentinel, string, String) \ 475 V(STRING_TYPE, kVariableSizeSentinel, string, String) \
482 V(ONE_BYTE_STRING_TYPE, kVariableSizeSentinel, one_byte_string, \ 476 V(ONE_BYTE_STRING_TYPE, kVariableSizeSentinel, one_byte_string, \
483 OneByteString) \ 477 OneByteString) \
484 V(CONS_STRING_TYPE, ConsString::kSize, cons_string, ConsString) \ 478 V(CONS_STRING_TYPE, ConsString::kSize, cons_string, ConsString) \
485 V(CONS_ONE_BYTE_STRING_TYPE, ConsString::kSize, cons_one_byte_string, \ 479 V(CONS_ONE_BYTE_STRING_TYPE, ConsString::kSize, cons_one_byte_string, \
486 ConsOneByteString) \ 480 ConsOneByteString) \
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // A struct is a simple object a set of object-valued fields. Including an 523 // A struct is a simple object a set of object-valued fields. Including an
530 // object type in this causes the compiler to generate most of the boilerplate 524 // object type in this causes the compiler to generate most of the boilerplate
531 // code for the class including allocation and garbage collection routines, 525 // code for the class including allocation and garbage collection routines,
532 // casts and predicates. All you need to define is the class, methods and 526 // casts and predicates. All you need to define is the class, methods and
533 // object verification routines. Easy, no? 527 // object verification routines. Easy, no?
534 // 528 //
535 // Note that for subtle reasons related to the ordering or numerical values of 529 // Note that for subtle reasons related to the ordering or numerical values of
536 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST 530 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST
537 // manually. 531 // manually.
538 #define STRUCT_LIST(V) \ 532 #define STRUCT_LIST(V) \
539 V(BOX, Box, box) \
540 V(PROMISE_RESOLVE_THENABLE_JOB_INFO, PromiseResolveThenableJobInfo, \
541 promise_resolve_thenable_job_info) \
542 V(PROMISE_REACTION_JOB_INFO, PromiseReactionJobInfo, \
543 promise_reaction_job_info) \
544 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ 533 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
545 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ 534 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
546 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ 535 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
547 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ 536 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
548 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ 537 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \
549 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ 538 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \
550 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ 539 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \
551 V(SCRIPT, Script, script) \
552 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ 540 V(ALLOCATION_SITE, AllocationSite, allocation_site) \
553 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ 541 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \
542 V(SCRIPT, Script, script) \
554 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ 543 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \
555 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ 544 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \
545 V(BOX, Box, box) \
546 V(PROMISE_RESOLVE_THENABLE_JOB_INFO, PromiseResolveThenableJobInfo, \
547 promise_resolve_thenable_job_info) \
548 V(PROMISE_REACTION_JOB_INFO, PromiseReactionJobInfo, \
549 promise_reaction_job_info) \
556 V(DEBUG_INFO, DebugInfo, debug_info) \ 550 V(DEBUG_INFO, DebugInfo, debug_info) \
557 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ 551 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \
558 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ 552 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \
559 V(TUPLE2, Tuple2, tuple2) \ 553 V(TUPLE2, Tuple2, tuple2) \
560 V(TUPLE3, Tuple3, tuple3) \ 554 V(TUPLE3, Tuple3, tuple3) \
555 V(CONTEXT_EXTENSION, ContextExtension, context_extension) \
556 V(CONSTANT_ELEMENTS_PAIR, ConstantElementsPair, constant_elements_pair) \
561 V(MODULE, Module, module) \ 557 V(MODULE, Module, module) \
562 V(MODULE_INFO_ENTRY, ModuleInfoEntry, module_info_entry) \ 558 V(MODULE_INFO_ENTRY, ModuleInfoEntry, module_info_entry)
563 V(CONTEXT_EXTENSION, ContextExtension, context_extension) \
564 V(CONSTANT_ELEMENTS_PAIR, ConstantElementsPair, constant_elements_pair)
565 559
566 // We use the full 8 bits of the instance_type field to encode heap object 560 // We use the full 8 bits of the instance_type field to encode heap object
567 // instance types. The high-order bit (bit 7) is set if the object is not a 561 // instance types. The high-order bit (bit 7) is set if the object is not a
568 // string, and cleared if it is a string. 562 // string, and cleared if it is a string.
569 const uint32_t kIsNotStringMask = 0x80; 563 const uint32_t kIsNotStringMask = 0x80;
570 const uint32_t kStringTag = 0x0; 564 const uint32_t kStringTag = 0x0;
571 const uint32_t kNotStringTag = 0x80; 565 const uint32_t kNotStringTag = 0x80;
572 566
573 // Bit 6 indicates that the object is an internalized string (if set) or not. 567 // Bit 6 indicates that the object is an internalized string (if set) or not.
574 // Bit 7 has to be clear as well. 568 // Bit 7 has to be clear as well.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 FILLER_TYPE, // LAST_DATA_TYPE 705 FILLER_TYPE, // LAST_DATA_TYPE
712 706
713 // Structs. 707 // Structs.
714 ACCESSOR_INFO_TYPE, 708 ACCESSOR_INFO_TYPE,
715 ACCESSOR_PAIR_TYPE, 709 ACCESSOR_PAIR_TYPE,
716 ACCESS_CHECK_INFO_TYPE, 710 ACCESS_CHECK_INFO_TYPE,
717 INTERCEPTOR_INFO_TYPE, 711 INTERCEPTOR_INFO_TYPE,
718 CALL_HANDLER_INFO_TYPE, 712 CALL_HANDLER_INFO_TYPE,
719 FUNCTION_TEMPLATE_INFO_TYPE, 713 FUNCTION_TEMPLATE_INFO_TYPE,
720 OBJECT_TEMPLATE_INFO_TYPE, 714 OBJECT_TEMPLATE_INFO_TYPE,
721 SIGNATURE_INFO_TYPE,
722 TYPE_SWITCH_INFO_TYPE,
723 ALLOCATION_SITE_TYPE, 715 ALLOCATION_SITE_TYPE,
724 ALLOCATION_MEMENTO_TYPE, 716 ALLOCATION_MEMENTO_TYPE,
725 SCRIPT_TYPE, 717 SCRIPT_TYPE,
726 TYPE_FEEDBACK_INFO_TYPE, 718 TYPE_FEEDBACK_INFO_TYPE,
727 ALIASED_ARGUMENTS_ENTRY_TYPE, 719 ALIASED_ARGUMENTS_ENTRY_TYPE,
728 BOX_TYPE, 720 BOX_TYPE,
729 PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE, 721 PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE,
730 PROMISE_REACTION_JOB_INFO_TYPE, 722 PROMISE_REACTION_JOB_INFO_TYPE,
731 DEBUG_INFO_TYPE, 723 DEBUG_INFO_TYPE,
732 BREAK_POINT_INFO_TYPE, 724 BREAK_POINT_INFO_TYPE,
733 FIXED_ARRAY_TYPE,
734 SHARED_FUNCTION_INFO_TYPE,
735 CELL_TYPE,
736 WEAK_CELL_TYPE,
737 TRANSITION_ARRAY_TYPE,
738 PROPERTY_CELL_TYPE,
739 PROTOTYPE_INFO_TYPE, 725 PROTOTYPE_INFO_TYPE,
740 TUPLE2_TYPE, 726 TUPLE2_TYPE,
741 TUPLE3_TYPE, 727 TUPLE3_TYPE,
742 CONTEXT_EXTENSION_TYPE, 728 CONTEXT_EXTENSION_TYPE,
743 CONSTANT_ELEMENTS_PAIR_TYPE, 729 CONSTANT_ELEMENTS_PAIR_TYPE,
744 MODULE_TYPE, 730 MODULE_TYPE,
745 MODULE_INFO_ENTRY_TYPE, 731 MODULE_INFO_ENTRY_TYPE,
732 FIXED_ARRAY_TYPE,
733 TRANSITION_ARRAY_TYPE,
734 SHARED_FUNCTION_INFO_TYPE,
735 CELL_TYPE,
736 WEAK_CELL_TYPE,
737 PROPERTY_CELL_TYPE,
746 738
747 // All the following types are subtypes of JSReceiver, which corresponds to 739 // All the following types are subtypes of JSReceiver, which corresponds to
748 // objects in the JS sense. The first and the last type in this range are 740 // objects in the JS sense. The first and the last type in this range are
749 // the two forms of function. This organization enables using the same 741 // the two forms of function. This organization enables using the same
750 // compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range. 742 // compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range.
751 JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE 743 JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE
752 JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE 744 JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE
753 JS_GLOBAL_PROXY_TYPE, 745 JS_GLOBAL_PROXY_TYPE,
754 // Like JS_API_OBJECT_TYPE, but requires access checks and/or has 746 // Like JS_API_OBJECT_TYPE, but requires access checks and/or has
755 // interceptors. 747 // interceptors.
(...skipping 11273 matching lines...) Expand 10 before | Expand all | Expand 10 after
12029 } 12021 }
12030 return value; 12022 return value;
12031 } 12023 }
12032 }; 12024 };
12033 12025
12034 12026
12035 } // NOLINT, false-positive due to second-order macros. 12027 } // NOLINT, false-positive due to second-order macros.
12036 } // NOLINT, false-positive due to second-order macros. 12028 } // NOLINT, false-positive due to second-order macros.
12037 12029
12038 #endif // V8_OBJECTS_H_ 12030 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/compiler/types.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698