| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // - MaybeObject (an object or a failure) | 55 // - MaybeObject (an object or a failure) |
| 56 // - Failure (immediate for marking failed operation) | 56 // - Failure (immediate for marking failed operation) |
| 57 // - Object | 57 // - Object |
| 58 // - Smi (immediate small integer) | 58 // - Smi (immediate small integer) |
| 59 // - HeapObject (superclass for everything allocated in the heap) | 59 // - HeapObject (superclass for everything allocated in the heap) |
| 60 // - JSReceiver (suitable for property access) | 60 // - JSReceiver (suitable for property access) |
| 61 // - JSObject | 61 // - JSObject |
| 62 // - JSArray | 62 // - JSArray |
| 63 // - JSArrayBuffer | 63 // - JSArrayBuffer |
| 64 // - JSArrayBufferView | 64 // - JSArrayBufferView |
| 65 // - JSTypedArray | 65 // - JSTypedArray |
| 66 // - JSDataView | 66 // - JSDataView |
| 67 // - JSSet | 67 // - JSSet |
| 68 // - JSMap | 68 // - JSMap |
| 69 // - JSWeakMap | 69 // - JSWeakCollection |
| 70 // - JSWeakMap |
| 71 // - JSWeakSet |
| 70 // - JSRegExp | 72 // - JSRegExp |
| 71 // - JSFunction | 73 // - JSFunction |
| 72 // - JSGeneratorObject | 74 // - JSGeneratorObject |
| 73 // - JSModule | 75 // - JSModule |
| 74 // - GlobalObject | 76 // - GlobalObject |
| 75 // - JSGlobalObject | 77 // - JSGlobalObject |
| 76 // - JSBuiltinsObject | 78 // - JSBuiltinsObject |
| 77 // - JSGlobalProxy | 79 // - JSGlobalProxy |
| 78 // - JSValue | 80 // - JSValue |
| 79 // - JSDate | 81 // - JSDate |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 V(DECLARED_ACCESSOR_INFO_TYPE) \ | 383 V(DECLARED_ACCESSOR_INFO_TYPE) \ |
| 382 V(EXECUTABLE_ACCESSOR_INFO_TYPE) \ | 384 V(EXECUTABLE_ACCESSOR_INFO_TYPE) \ |
| 383 V(ACCESSOR_PAIR_TYPE) \ | 385 V(ACCESSOR_PAIR_TYPE) \ |
| 384 V(ACCESS_CHECK_INFO_TYPE) \ | 386 V(ACCESS_CHECK_INFO_TYPE) \ |
| 385 V(INTERCEPTOR_INFO_TYPE) \ | 387 V(INTERCEPTOR_INFO_TYPE) \ |
| 386 V(CALL_HANDLER_INFO_TYPE) \ | 388 V(CALL_HANDLER_INFO_TYPE) \ |
| 387 V(FUNCTION_TEMPLATE_INFO_TYPE) \ | 389 V(FUNCTION_TEMPLATE_INFO_TYPE) \ |
| 388 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 390 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
| 389 V(SIGNATURE_INFO_TYPE) \ | 391 V(SIGNATURE_INFO_TYPE) \ |
| 390 V(TYPE_SWITCH_INFO_TYPE) \ | 392 V(TYPE_SWITCH_INFO_TYPE) \ |
| 391 V(ALLOCATION_SITE_INFO_TYPE) \ | 393 V(ALLOCATION_MEMENTO_TYPE) \ |
| 392 V(ALLOCATION_SITE_TYPE) \ | 394 V(ALLOCATION_SITE_TYPE) \ |
| 393 V(SCRIPT_TYPE) \ | 395 V(SCRIPT_TYPE) \ |
| 394 V(CODE_CACHE_TYPE) \ | 396 V(CODE_CACHE_TYPE) \ |
| 395 V(POLYMORPHIC_CODE_CACHE_TYPE) \ | 397 V(POLYMORPHIC_CODE_CACHE_TYPE) \ |
| 396 V(TYPE_FEEDBACK_INFO_TYPE) \ | 398 V(TYPE_FEEDBACK_INFO_TYPE) \ |
| 397 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 399 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
| 398 \ | 400 \ |
| 399 V(FIXED_ARRAY_TYPE) \ | 401 V(FIXED_ARRAY_TYPE) \ |
| 400 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 402 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
| 401 V(SHARED_FUNCTION_INFO_TYPE) \ | 403 V(SHARED_FUNCTION_INFO_TYPE) \ |
| 402 \ | 404 \ |
| 403 V(JS_MESSAGE_OBJECT_TYPE) \ | 405 V(JS_MESSAGE_OBJECT_TYPE) \ |
| 404 \ | 406 \ |
| 405 V(JS_VALUE_TYPE) \ | 407 V(JS_VALUE_TYPE) \ |
| 406 V(JS_DATE_TYPE) \ | 408 V(JS_DATE_TYPE) \ |
| 407 V(JS_OBJECT_TYPE) \ | 409 V(JS_OBJECT_TYPE) \ |
| 408 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ | 410 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ |
| 409 V(JS_GENERATOR_OBJECT_TYPE) \ | 411 V(JS_GENERATOR_OBJECT_TYPE) \ |
| 410 V(JS_MODULE_TYPE) \ | 412 V(JS_MODULE_TYPE) \ |
| 411 V(JS_GLOBAL_OBJECT_TYPE) \ | 413 V(JS_GLOBAL_OBJECT_TYPE) \ |
| 412 V(JS_BUILTINS_OBJECT_TYPE) \ | 414 V(JS_BUILTINS_OBJECT_TYPE) \ |
| 413 V(JS_GLOBAL_PROXY_TYPE) \ | 415 V(JS_GLOBAL_PROXY_TYPE) \ |
| 414 V(JS_ARRAY_TYPE) \ | 416 V(JS_ARRAY_TYPE) \ |
| 415 V(JS_ARRAY_BUFFER_TYPE) \ | 417 V(JS_ARRAY_BUFFER_TYPE) \ |
| 416 V(JS_TYPED_ARRAY_TYPE) \ | 418 V(JS_TYPED_ARRAY_TYPE) \ |
| 417 V(JS_DATA_VIEW_TYPE) \ | 419 V(JS_DATA_VIEW_TYPE) \ |
| 418 V(JS_PROXY_TYPE) \ | 420 V(JS_PROXY_TYPE) \ |
| 419 V(JS_WEAK_MAP_TYPE) \ | 421 V(JS_WEAK_MAP_TYPE) \ |
| 422 V(JS_WEAK_SET_TYPE) \ |
| 420 V(JS_REGEXP_TYPE) \ | 423 V(JS_REGEXP_TYPE) \ |
| 421 \ | 424 \ |
| 422 V(JS_FUNCTION_TYPE) \ | 425 V(JS_FUNCTION_TYPE) \ |
| 423 V(JS_FUNCTION_PROXY_TYPE) \ | 426 V(JS_FUNCTION_PROXY_TYPE) \ |
| 424 | 427 |
| 425 #ifdef ENABLE_DEBUGGER_SUPPORT | 428 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 426 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ | 429 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \ |
| 427 V(DEBUG_INFO_TYPE) \ | 430 V(DEBUG_INFO_TYPE) \ |
| 428 V(BREAK_POINT_INFO_TYPE) | 431 V(BREAK_POINT_INFO_TYPE) |
| 429 #else | 432 #else |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 550 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
| 548 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 551 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
| 549 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 552 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
| 550 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 553 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
| 551 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 554 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
| 552 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 555 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
| 553 V(SIGNATURE_INFO, SignatureInfo, signature_info) \ | 556 V(SIGNATURE_INFO, SignatureInfo, signature_info) \ |
| 554 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ | 557 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ |
| 555 V(SCRIPT, Script, script) \ | 558 V(SCRIPT, Script, script) \ |
| 556 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 559 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
| 557 V(ALLOCATION_SITE_INFO, AllocationSiteInfo, allocation_site_info) \ | 560 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
| 558 V(CODE_CACHE, CodeCache, code_cache) \ | 561 V(CODE_CACHE, CodeCache, code_cache) \ |
| 559 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \ | 562 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \ |
| 560 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ | 563 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ |
| 561 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) | 564 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) |
| 562 | 565 |
| 563 #ifdef ENABLE_DEBUGGER_SUPPORT | 566 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 564 #define STRUCT_LIST_DEBUGGER(V) \ | 567 #define STRUCT_LIST_DEBUGGER(V) \ |
| 565 V(DEBUG_INFO, DebugInfo, debug_info) \ | 568 V(DEBUG_INFO, DebugInfo, debug_info) \ |
| 566 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) | 569 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) |
| 567 #else | 570 #else |
| 568 #define STRUCT_LIST_DEBUGGER(V) | 571 #define STRUCT_LIST_DEBUGGER(V) |
| 569 #endif | 572 #endif |
| 570 | 573 |
| 571 #define STRUCT_LIST(V) \ | 574 #define STRUCT_LIST(V) \ |
| 572 STRUCT_LIST_ALL(V) \ | 575 STRUCT_LIST_ALL(V) \ |
| 573 STRUCT_LIST_DEBUGGER(V) | 576 STRUCT_LIST_DEBUGGER(V) |
| 574 | 577 |
| 575 // We use the full 8 bits of the instance_type field to encode heap object | 578 // We use the full 8 bits of the instance_type field to encode heap object |
| 576 // instance types. The high-order bit (bit 7) is set if the object is not a | 579 // instance types. The high-order bit (bit 7) is set if the object is not a |
| 577 // string, and cleared if it is a string. | 580 // string, and cleared if it is a string. |
| 578 const uint32_t kIsNotStringMask = 0x80; | 581 const uint32_t kIsNotStringMask = 0x80; |
| 579 const uint32_t kStringTag = 0x0; | 582 const uint32_t kStringTag = 0x0; |
| 580 const uint32_t kNotStringTag = 0x80; | 583 const uint32_t kNotStringTag = 0x80; |
| 581 | 584 |
| 582 // Bit 6 indicates that the object is an internalized string (if set) or not. | 585 // Bit 6 indicates that the object is an internalized string (if set) or not. |
| 583 // Bit 7 has to be clear as well. | 586 // Bit 7 has to be clear as well. |
| 584 const uint32_t kIsInternalizedMask = 0x40; | 587 const uint32_t kIsNotInternalizedMask = 0x40; |
| 585 const uint32_t kNotInternalizedTag = 0x0; | 588 const uint32_t kNotInternalizedTag = 0x40; |
| 586 const uint32_t kInternalizedTag = 0x40; | 589 const uint32_t kInternalizedTag = 0x0; |
| 587 | 590 |
| 588 // If bit 7 is clear then bit 2 indicates whether the string consists of | 591 // If bit 7 is clear then bit 2 indicates whether the string consists of |
| 589 // two-byte characters or one-byte characters. | 592 // two-byte characters or one-byte characters. |
| 590 const uint32_t kStringEncodingMask = 0x4; | 593 const uint32_t kStringEncodingMask = 0x4; |
| 591 const uint32_t kTwoByteStringTag = 0x0; | 594 const uint32_t kTwoByteStringTag = 0x0; |
| 592 const uint32_t kOneByteStringTag = 0x4; | 595 const uint32_t kOneByteStringTag = 0x4; |
| 593 | 596 |
| 594 // If bit 7 is clear, the low-order 2 bits indicate the representation | 597 // If bit 7 is clear, the low-order 2 bits indicate the representation |
| 595 // of the string. | 598 // of the string. |
| 596 const uint32_t kStringRepresentationMask = 0x03; | 599 const uint32_t kStringRepresentationMask = 0x03; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 625 const uint32_t kShortExternalStringTag = 0x10; | 628 const uint32_t kShortExternalStringTag = 0x10; |
| 626 | 629 |
| 627 | 630 |
| 628 // A ConsString with an empty string as the right side is a candidate | 631 // A ConsString with an empty string as the right side is a candidate |
| 629 // for being shortcut by the garbage collector unless it is internalized. | 632 // for being shortcut by the garbage collector unless it is internalized. |
| 630 // It's not common to have non-flat internalized strings, so we do not | 633 // It's not common to have non-flat internalized strings, so we do not |
| 631 // shortcut them thereby avoiding turning internalized strings into strings. | 634 // shortcut them thereby avoiding turning internalized strings into strings. |
| 632 // See heap.cc and mark-compact.cc. | 635 // See heap.cc and mark-compact.cc. |
| 633 const uint32_t kShortcutTypeMask = | 636 const uint32_t kShortcutTypeMask = |
| 634 kIsNotStringMask | | 637 kIsNotStringMask | |
| 635 kIsInternalizedMask | | 638 kIsNotInternalizedMask | |
| 636 kStringRepresentationMask; | 639 kStringRepresentationMask; |
| 637 const uint32_t kShortcutTypeTag = kConsStringTag; | 640 const uint32_t kShortcutTypeTag = kConsStringTag | kNotInternalizedTag; |
| 638 | 641 |
| 639 | 642 |
| 640 enum InstanceType { | 643 enum InstanceType { |
| 641 // String types. | 644 // String types. |
| 642 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, | 645 INTERNALIZED_STRING_TYPE = kTwoByteStringTag | kSeqStringTag |
| 643 ASCII_STRING_TYPE = kOneByteStringTag | kSeqStringTag, | 646 | kInternalizedTag, |
| 644 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, | 647 ASCII_INTERNALIZED_STRING_TYPE = kOneByteStringTag | kSeqStringTag |
| 645 CONS_ASCII_STRING_TYPE = kOneByteStringTag | kConsStringTag, | 648 | kInternalizedTag, |
| 646 SLICED_STRING_TYPE = kTwoByteStringTag | kSlicedStringTag, | 649 CONS_INTERNALIZED_STRING_TYPE = kTwoByteStringTag | kConsStringTag |
| 647 SLICED_ASCII_STRING_TYPE = kOneByteStringTag | kSlicedStringTag, | 650 | kInternalizedTag, |
| 648 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, | 651 CONS_ASCII_INTERNALIZED_STRING_TYPE = kOneByteStringTag | kConsStringTag |
| 649 EXTERNAL_ASCII_STRING_TYPE = kOneByteStringTag | kExternalStringTag, | 652 | kInternalizedTag, |
| 653 EXTERNAL_INTERNALIZED_STRING_TYPE = kTwoByteStringTag | kExternalStringTag |
| 654 | kInternalizedTag, |
| 655 EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = kOneByteStringTag |
| 656 | kExternalStringTag | kInternalizedTag, |
| 657 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE = |
| 658 EXTERNAL_INTERNALIZED_STRING_TYPE | kOneByteDataHintTag |
| 659 | kInternalizedTag, |
| 660 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE = |
| 661 EXTERNAL_INTERNALIZED_STRING_TYPE | kShortExternalStringTag |
| 662 | kInternalizedTag, |
| 663 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = |
| 664 EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE | kShortExternalStringTag |
| 665 | kInternalizedTag, |
| 666 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE = |
| 667 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE |
| 668 | kShortExternalStringTag | kInternalizedTag, |
| 669 |
| 670 STRING_TYPE = INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 671 ASCII_STRING_TYPE = ASCII_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 672 CONS_STRING_TYPE = CONS_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 673 CONS_ASCII_STRING_TYPE = |
| 674 CONS_ASCII_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 675 |
| 676 SLICED_STRING_TYPE = |
| 677 kTwoByteStringTag | kSlicedStringTag | kNotInternalizedTag, |
| 678 SLICED_ASCII_STRING_TYPE = |
| 679 kOneByteStringTag | kSlicedStringTag | kNotInternalizedTag, |
| 680 EXTERNAL_STRING_TYPE = |
| 681 EXTERNAL_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 682 EXTERNAL_ASCII_STRING_TYPE = |
| 683 EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 650 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = | 684 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = |
| 651 EXTERNAL_STRING_TYPE | kOneByteDataHintTag, | 685 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE |
| 652 SHORT_EXTERNAL_STRING_TYPE = EXTERNAL_STRING_TYPE | kShortExternalStringTag, | 686 | kNotInternalizedTag, |
| 687 SHORT_EXTERNAL_STRING_TYPE = |
| 688 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 653 SHORT_EXTERNAL_ASCII_STRING_TYPE = | 689 SHORT_EXTERNAL_ASCII_STRING_TYPE = |
| 654 EXTERNAL_ASCII_STRING_TYPE | kShortExternalStringTag, | 690 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 655 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = | 691 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = |
| 656 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE | kShortExternalStringTag, | 692 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE |
| 657 | 693 | kNotInternalizedTag, |
| 658 INTERNALIZED_STRING_TYPE = STRING_TYPE | kInternalizedTag, | |
| 659 ASCII_INTERNALIZED_STRING_TYPE = ASCII_STRING_TYPE | kInternalizedTag, | |
| 660 CONS_INTERNALIZED_STRING_TYPE = CONS_STRING_TYPE | kInternalizedTag, | |
| 661 CONS_ASCII_INTERNALIZED_STRING_TYPE = | |
| 662 CONS_ASCII_STRING_TYPE | kInternalizedTag, | |
| 663 EXTERNAL_INTERNALIZED_STRING_TYPE = EXTERNAL_STRING_TYPE | kInternalizedTag, | |
| 664 EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = | |
| 665 EXTERNAL_ASCII_STRING_TYPE | kInternalizedTag, | |
| 666 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE = | |
| 667 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE | kInternalizedTag, | |
| 668 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE = | |
| 669 SHORT_EXTERNAL_STRING_TYPE | kInternalizedTag, | |
| 670 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = | |
| 671 SHORT_EXTERNAL_ASCII_STRING_TYPE | kInternalizedTag, | |
| 672 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE = | |
| 673 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE | kInternalizedTag, | |
| 674 | 694 |
| 675 // Non-string names | 695 // Non-string names |
| 676 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE | 696 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE |
| 677 | 697 |
| 678 // Objects allocated in their own spaces (never in new space). | 698 // Objects allocated in their own spaces (never in new space). |
| 679 MAP_TYPE, | 699 MAP_TYPE, |
| 680 CODE_TYPE, | 700 CODE_TYPE, |
| 681 ODDBALL_TYPE, | 701 ODDBALL_TYPE, |
| 682 CELL_TYPE, | 702 CELL_TYPE, |
| 683 PROPERTY_CELL_TYPE, | 703 PROPERTY_CELL_TYPE, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 707 EXECUTABLE_ACCESSOR_INFO_TYPE, | 727 EXECUTABLE_ACCESSOR_INFO_TYPE, |
| 708 ACCESSOR_PAIR_TYPE, | 728 ACCESSOR_PAIR_TYPE, |
| 709 ACCESS_CHECK_INFO_TYPE, | 729 ACCESS_CHECK_INFO_TYPE, |
| 710 INTERCEPTOR_INFO_TYPE, | 730 INTERCEPTOR_INFO_TYPE, |
| 711 CALL_HANDLER_INFO_TYPE, | 731 CALL_HANDLER_INFO_TYPE, |
| 712 FUNCTION_TEMPLATE_INFO_TYPE, | 732 FUNCTION_TEMPLATE_INFO_TYPE, |
| 713 OBJECT_TEMPLATE_INFO_TYPE, | 733 OBJECT_TEMPLATE_INFO_TYPE, |
| 714 SIGNATURE_INFO_TYPE, | 734 SIGNATURE_INFO_TYPE, |
| 715 TYPE_SWITCH_INFO_TYPE, | 735 TYPE_SWITCH_INFO_TYPE, |
| 716 ALLOCATION_SITE_TYPE, | 736 ALLOCATION_SITE_TYPE, |
| 717 ALLOCATION_SITE_INFO_TYPE, | 737 ALLOCATION_MEMENTO_TYPE, |
| 718 SCRIPT_TYPE, | 738 SCRIPT_TYPE, |
| 719 CODE_CACHE_TYPE, | 739 CODE_CACHE_TYPE, |
| 720 POLYMORPHIC_CODE_CACHE_TYPE, | 740 POLYMORPHIC_CODE_CACHE_TYPE, |
| 721 TYPE_FEEDBACK_INFO_TYPE, | 741 TYPE_FEEDBACK_INFO_TYPE, |
| 722 ALIASED_ARGUMENTS_ENTRY_TYPE, | 742 ALIASED_ARGUMENTS_ENTRY_TYPE, |
| 723 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT | 743 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT |
| 724 // is defined. However as include/v8.h contain some of the instance type | 744 // is defined. However as include/v8.h contain some of the instance type |
| 725 // constants always having them avoids them getting different numbers | 745 // constants always having them avoids them getting different numbers |
| 726 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. | 746 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. |
| 727 DEBUG_INFO_TYPE, | 747 DEBUG_INFO_TYPE, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 749 JS_GLOBAL_OBJECT_TYPE, | 769 JS_GLOBAL_OBJECT_TYPE, |
| 750 JS_BUILTINS_OBJECT_TYPE, | 770 JS_BUILTINS_OBJECT_TYPE, |
| 751 JS_GLOBAL_PROXY_TYPE, | 771 JS_GLOBAL_PROXY_TYPE, |
| 752 JS_ARRAY_TYPE, | 772 JS_ARRAY_TYPE, |
| 753 JS_ARRAY_BUFFER_TYPE, | 773 JS_ARRAY_BUFFER_TYPE, |
| 754 JS_TYPED_ARRAY_TYPE, | 774 JS_TYPED_ARRAY_TYPE, |
| 755 JS_DATA_VIEW_TYPE, | 775 JS_DATA_VIEW_TYPE, |
| 756 JS_SET_TYPE, | 776 JS_SET_TYPE, |
| 757 JS_MAP_TYPE, | 777 JS_MAP_TYPE, |
| 758 JS_WEAK_MAP_TYPE, | 778 JS_WEAK_MAP_TYPE, |
| 779 JS_WEAK_SET_TYPE, |
| 759 | 780 |
| 760 JS_REGEXP_TYPE, | 781 JS_REGEXP_TYPE, |
| 761 | 782 |
| 762 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE | 783 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE |
| 763 | 784 |
| 764 // Pseudo-types | 785 // Pseudo-types |
| 765 FIRST_TYPE = 0x0, | 786 FIRST_TYPE = 0x0, |
| 766 LAST_TYPE = JS_FUNCTION_TYPE, | 787 LAST_TYPE = JS_FUNCTION_TYPE, |
| 767 INVALID_TYPE = FIRST_TYPE - 1, | 788 INVALID_TYPE = FIRST_TYPE - 1, |
| 768 FIRST_NAME_TYPE = FIRST_TYPE, | 789 FIRST_NAME_TYPE = FIRST_TYPE, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 | 938 |
| 918 template<typename T> | 939 template<typename T> |
| 919 inline bool ToHandle(Handle<T>* obj, Isolate* isolate) { | 940 inline bool ToHandle(Handle<T>* obj, Isolate* isolate) { |
| 920 if (IsFailure()) return false; | 941 if (IsFailure()) return false; |
| 921 *obj = handle(T::cast(reinterpret_cast<Object*>(this)), isolate); | 942 *obj = handle(T::cast(reinterpret_cast<Object*>(this)), isolate); |
| 922 return true; | 943 return true; |
| 923 } | 944 } |
| 924 | 945 |
| 925 #ifdef OBJECT_PRINT | 946 #ifdef OBJECT_PRINT |
| 926 // Prints this object with details. | 947 // Prints this object with details. |
| 927 inline void Print() { | 948 void Print(); |
| 928 Print(stdout); | |
| 929 } | |
| 930 inline void PrintLn() { | |
| 931 PrintLn(stdout); | |
| 932 } | |
| 933 void Print(FILE* out); | 949 void Print(FILE* out); |
| 950 void PrintLn(); |
| 934 void PrintLn(FILE* out); | 951 void PrintLn(FILE* out); |
| 935 #endif | 952 #endif |
| 936 #ifdef VERIFY_HEAP | 953 #ifdef VERIFY_HEAP |
| 937 // Verifies the object. | 954 // Verifies the object. |
| 938 void Verify(); | 955 void Verify(); |
| 939 #endif | 956 #endif |
| 940 }; | 957 }; |
| 941 | 958 |
| 942 | 959 |
| 943 #define OBJECT_TYPE_LIST(V) \ | 960 #define OBJECT_TYPE_LIST(V) \ |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 V(Boolean) \ | 1019 V(Boolean) \ |
| 1003 V(JSArray) \ | 1020 V(JSArray) \ |
| 1004 V(JSArrayBuffer) \ | 1021 V(JSArrayBuffer) \ |
| 1005 V(JSArrayBufferView) \ | 1022 V(JSArrayBufferView) \ |
| 1006 V(JSTypedArray) \ | 1023 V(JSTypedArray) \ |
| 1007 V(JSDataView) \ | 1024 V(JSDataView) \ |
| 1008 V(JSProxy) \ | 1025 V(JSProxy) \ |
| 1009 V(JSFunctionProxy) \ | 1026 V(JSFunctionProxy) \ |
| 1010 V(JSSet) \ | 1027 V(JSSet) \ |
| 1011 V(JSMap) \ | 1028 V(JSMap) \ |
| 1029 V(JSWeakCollection) \ |
| 1012 V(JSWeakMap) \ | 1030 V(JSWeakMap) \ |
| 1031 V(JSWeakSet) \ |
| 1013 V(JSRegExp) \ | 1032 V(JSRegExp) \ |
| 1014 V(HashTable) \ | 1033 V(HashTable) \ |
| 1015 V(Dictionary) \ | 1034 V(Dictionary) \ |
| 1016 V(StringTable) \ | 1035 V(StringTable) \ |
| 1017 V(JSFunctionResultCache) \ | 1036 V(JSFunctionResultCache) \ |
| 1018 V(NormalizedMapCache) \ | 1037 V(NormalizedMapCache) \ |
| 1019 V(CompilationCacheTable) \ | 1038 V(CompilationCacheTable) \ |
| 1020 V(CodeCacheHashTable) \ | 1039 V(CodeCacheHashTable) \ |
| 1021 V(PolymorphicCodeCacheHashTable) \ | 1040 V(PolymorphicCodeCacheHashTable) \ |
| 1022 V(MapCache) \ | 1041 V(MapCache) \ |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 MUST_USE_RESULT MaybeObject* SetProperty( | 1680 MUST_USE_RESULT MaybeObject* SetProperty( |
| 1662 LookupResult* result, | 1681 LookupResult* result, |
| 1663 Name* key, | 1682 Name* key, |
| 1664 Object* value, | 1683 Object* value, |
| 1665 PropertyAttributes attributes, | 1684 PropertyAttributes attributes, |
| 1666 StrictModeFlag strict_mode, | 1685 StrictModeFlag strict_mode, |
| 1667 StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED); | 1686 StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED); |
| 1668 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter, | 1687 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter, |
| 1669 Object* value); | 1688 Object* value); |
| 1670 | 1689 |
| 1671 MUST_USE_RESULT MaybeObject* DeleteProperty(Name* name, DeleteMode mode); | 1690 static Handle<Object> DeleteProperty(Handle<JSReceiver> object, |
| 1672 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); | 1691 Handle<Name> name, |
| 1692 DeleteMode mode = NORMAL_DELETION); |
| 1693 static Handle<Object> DeleteElement(Handle<JSReceiver> object, |
| 1694 uint32_t index, |
| 1695 DeleteMode mode); |
| 1673 | 1696 |
| 1674 // Set the index'th array element. | 1697 // Set the index'th array element. |
| 1675 // Can cause GC, or return failure if GC is required. | 1698 // Can cause GC, or return failure if GC is required. |
| 1676 MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, | 1699 MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, |
| 1677 Object* value, | 1700 Object* value, |
| 1678 PropertyAttributes attributes, | 1701 PropertyAttributes attributes, |
| 1679 StrictModeFlag strict_mode, | 1702 StrictModeFlag strict_mode, |
| 1680 bool check_prototype); | 1703 bool check_prototype); |
| 1681 | 1704 |
| 1682 // Tests for the fast common case for property enumeration. | 1705 // Tests for the fast common case for property enumeration. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 // Handles the special representation of JS global objects. | 1929 // Handles the special representation of JS global objects. |
| 1907 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, | 1930 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, |
| 1908 Handle<Name> key, | 1931 Handle<Name> key, |
| 1909 Handle<Object> value, | 1932 Handle<Object> value, |
| 1910 PropertyDetails details); | 1933 PropertyDetails details); |
| 1911 | 1934 |
| 1912 MUST_USE_RESULT MaybeObject* SetNormalizedProperty(Name* name, | 1935 MUST_USE_RESULT MaybeObject* SetNormalizedProperty(Name* name, |
| 1913 Object* value, | 1936 Object* value, |
| 1914 PropertyDetails details); | 1937 PropertyDetails details); |
| 1915 | 1938 |
| 1916 // Deletes the named property in a normalized object. | |
| 1917 MUST_USE_RESULT MaybeObject* DeleteNormalizedProperty(Name* name, | |
| 1918 DeleteMode mode); | |
| 1919 | |
| 1920 static void OptimizeAsPrototype(Handle<JSObject> object); | 1939 static void OptimizeAsPrototype(Handle<JSObject> object); |
| 1921 MUST_USE_RESULT MaybeObject* OptimizeAsPrototype(); | 1940 MUST_USE_RESULT MaybeObject* OptimizeAsPrototype(); |
| 1922 | 1941 |
| 1923 // Retrieve interceptors. | 1942 // Retrieve interceptors. |
| 1924 InterceptorInfo* GetNamedInterceptor(); | 1943 InterceptorInfo* GetNamedInterceptor(); |
| 1925 InterceptorInfo* GetIndexedInterceptor(); | 1944 InterceptorInfo* GetIndexedInterceptor(); |
| 1926 | 1945 |
| 1927 // Used from JSReceiver. | 1946 // Used from JSReceiver. |
| 1928 PropertyAttributes GetPropertyAttributePostInterceptor(JSObject* receiver, | 1947 PropertyAttributes GetPropertyAttributePostInterceptor(JSObject* receiver, |
| 1929 Name* name, | 1948 Name* name, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2000 // Deletes a hidden property. Deleting a non-existing property is | 2019 // Deletes a hidden property. Deleting a non-existing property is |
| 2001 // considered successful. | 2020 // considered successful. |
| 2002 void DeleteHiddenProperty(Name* key); | 2021 void DeleteHiddenProperty(Name* key); |
| 2003 // Returns true if the object has a property with the hidden string as name. | 2022 // Returns true if the object has a property with the hidden string as name. |
| 2004 bool HasHiddenProperties(); | 2023 bool HasHiddenProperties(); |
| 2005 | 2024 |
| 2006 static int GetIdentityHash(Handle<JSObject> obj); | 2025 static int GetIdentityHash(Handle<JSObject> obj); |
| 2007 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 2026 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
| 2008 MUST_USE_RESULT MaybeObject* SetIdentityHash(Smi* hash, CreationFlag flag); | 2027 MUST_USE_RESULT MaybeObject* SetIdentityHash(Smi* hash, CreationFlag flag); |
| 2009 | 2028 |
| 2010 static Handle<Object> DeleteProperty(Handle<JSObject> obj, | 2029 static Handle<Object> DeleteElement(Handle<JSObject> obj, |
| 2011 Handle<Name> name); | 2030 uint32_t index, |
| 2012 // Can cause GC. | 2031 DeleteMode mode = NORMAL_DELETION); |
| 2013 MUST_USE_RESULT MaybeObject* DeleteProperty(Name* name, DeleteMode mode); | |
| 2014 | |
| 2015 static Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index); | |
| 2016 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); | 2032 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); |
| 2017 | 2033 |
| 2018 inline void ValidateElements(); | 2034 inline void ValidateElements(); |
| 2019 | 2035 |
| 2020 // Makes sure that this object can contain HeapObject as elements. | 2036 // Makes sure that this object can contain HeapObject as elements. |
| 2021 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements(); | 2037 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements(); |
| 2022 | 2038 |
| 2023 // Makes sure that this object can contain the specified elements. | 2039 // Makes sure that this object can contain the specified elements. |
| 2024 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( | 2040 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( |
| 2025 Object** elements, | 2041 Object** elements, |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2438 static void EnqueueChangeRecord(Handle<JSObject> object, | 2454 static void EnqueueChangeRecord(Handle<JSObject> object, |
| 2439 const char* type, | 2455 const char* type, |
| 2440 Handle<Name> name, | 2456 Handle<Name> name, |
| 2441 Handle<Object> old_value); | 2457 Handle<Object> old_value); |
| 2442 | 2458 |
| 2443 // Deliver change records to observers. May cause GC. | 2459 // Deliver change records to observers. May cause GC. |
| 2444 static void DeliverChangeRecords(Isolate* isolate); | 2460 static void DeliverChangeRecords(Isolate* isolate); |
| 2445 | 2461 |
| 2446 private: | 2462 private: |
| 2447 friend class DictionaryElementsAccessor; | 2463 friend class DictionaryElementsAccessor; |
| 2464 friend class JSReceiver; |
| 2448 | 2465 |
| 2449 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, | 2466 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, |
| 2450 Object* structure, | 2467 Object* structure, |
| 2451 uint32_t index, | 2468 uint32_t index, |
| 2452 Object* holder); | 2469 Object* holder); |
| 2453 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor( | 2470 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor( |
| 2454 JSReceiver* receiver, | 2471 JSReceiver* receiver, |
| 2455 uint32_t index, | 2472 uint32_t index, |
| 2456 bool continue_search); | 2473 bool continue_search); |
| 2457 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor( | 2474 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2483 // has a setter, invoke it and set '*done' to true. If it is found and is | 2500 // has a setter, invoke it and set '*done' to true. If it is found and is |
| 2484 // read-only, reject and set '*done' to true. Otherwise, set '*done' to | 2501 // read-only, reject and set '*done' to true. Otherwise, set '*done' to |
| 2485 // false. Can cause GC and can return a failure result with '*done==true'. | 2502 // false. Can cause GC and can return a failure result with '*done==true'. |
| 2486 MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypes( | 2503 MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypes( |
| 2487 Name* name, | 2504 Name* name, |
| 2488 Object* value, | 2505 Object* value, |
| 2489 PropertyAttributes attributes, | 2506 PropertyAttributes attributes, |
| 2490 StrictModeFlag strict_mode, | 2507 StrictModeFlag strict_mode, |
| 2491 bool* done); | 2508 bool* done); |
| 2492 | 2509 |
| 2493 MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(Name* name, | 2510 static Handle<Object> DeleteProperty(Handle<JSObject> object, |
| 2494 DeleteMode mode); | 2511 Handle<Name> name, |
| 2495 MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(Name* name); | 2512 DeleteMode mode); |
| 2513 static Handle<Object> DeletePropertyPostInterceptor(Handle<JSObject> object, |
| 2514 Handle<Name> name, |
| 2515 DeleteMode mode); |
| 2516 static Handle<Object> DeletePropertyWithInterceptor(Handle<JSObject> object, |
| 2517 Handle<Name> name); |
| 2518 |
| 2519 // Deletes the named property in a normalized object. |
| 2520 static Handle<Object> DeleteNormalizedProperty(Handle<JSObject> object, |
| 2521 Handle<Name> name, |
| 2522 DeleteMode mode); |
| 2496 | 2523 |
| 2497 MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index); | 2524 MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index); |
| 2498 | 2525 |
| 2499 MUST_USE_RESULT MaybeObject* DeleteFastElement(uint32_t index); | 2526 MUST_USE_RESULT MaybeObject* DeleteFastElement(uint32_t index); |
| 2500 MUST_USE_RESULT MaybeObject* DeleteDictionaryElement(uint32_t index, | 2527 MUST_USE_RESULT MaybeObject* DeleteDictionaryElement(uint32_t index, |
| 2501 DeleteMode mode); | 2528 DeleteMode mode); |
| 2502 | 2529 |
| 2503 bool ReferencesObjectFromElements(FixedArray* elements, | 2530 bool ReferencesObjectFromElements(FixedArray* elements, |
| 2504 ElementsKind kind, | 2531 ElementsKind kind, |
| 2505 Object* object); | 2532 Object* object); |
| (...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5331 // A map can never be used for both dictionary mode and fast mode JSObjects. | 5358 // A map can never be used for both dictionary mode and fast mode JSObjects. |
| 5332 // False by default and for HeapObjects that are not JSObjects. | 5359 // False by default and for HeapObjects that are not JSObjects. |
| 5333 inline void set_dictionary_map(bool value); | 5360 inline void set_dictionary_map(bool value); |
| 5334 inline bool is_dictionary_map(); | 5361 inline bool is_dictionary_map(); |
| 5335 | 5362 |
| 5336 // Tells whether the instance needs security checks when accessing its | 5363 // Tells whether the instance needs security checks when accessing its |
| 5337 // properties. | 5364 // properties. |
| 5338 inline void set_is_access_check_needed(bool access_check_needed); | 5365 inline void set_is_access_check_needed(bool access_check_needed); |
| 5339 inline bool is_access_check_needed(); | 5366 inline bool is_access_check_needed(); |
| 5340 | 5367 |
| 5368 // Returns true if map has a non-empty stub code cache. |
| 5369 inline bool has_code_cache(); |
| 5370 |
| 5341 // [prototype]: implicit prototype object. | 5371 // [prototype]: implicit prototype object. |
| 5342 DECL_ACCESSORS(prototype, Object) | 5372 DECL_ACCESSORS(prototype, Object) |
| 5343 | 5373 |
| 5344 // [constructor]: points back to the function responsible for this map. | 5374 // [constructor]: points back to the function responsible for this map. |
| 5345 DECL_ACCESSORS(constructor, Object) | 5375 DECL_ACCESSORS(constructor, Object) |
| 5346 | 5376 |
| 5347 // [instance descriptors]: describes the object. | 5377 // [instance descriptors]: describes the object. |
| 5348 DECL_ACCESSORS(instance_descriptors, DescriptorArray) | 5378 DECL_ACCESSORS(instance_descriptors, DescriptorArray) |
| 5349 inline void InitializeDescriptors(DescriptorArray* descriptors); | 5379 inline void InitializeDescriptors(DescriptorArray* descriptors); |
| 5350 | 5380 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5455 inline bool is_deprecated(); | 5485 inline bool is_deprecated(); |
| 5456 inline bool CanBeDeprecated(); | 5486 inline bool CanBeDeprecated(); |
| 5457 // Returns a non-deprecated version of the input. If the input was not | 5487 // Returns a non-deprecated version of the input. If the input was not |
| 5458 // deprecated, it is directly returned. Otherwise, the non-deprecated version | 5488 // deprecated, it is directly returned. Otherwise, the non-deprecated version |
| 5459 // is found by re-transitioning from the root of the transition tree using the | 5489 // is found by re-transitioning from the root of the transition tree using the |
| 5460 // descriptor array of the map. Returns NULL if no updated map is found. | 5490 // descriptor array of the map. Returns NULL if no updated map is found. |
| 5461 Map* CurrentMapForDeprecated(); | 5491 Map* CurrentMapForDeprecated(); |
| 5462 | 5492 |
| 5463 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); | 5493 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); |
| 5464 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); | 5494 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); |
| 5495 static Handle<Map> CopyDropDescriptors(Handle<Map> map); |
| 5465 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); | 5496 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); |
| 5466 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( | 5497 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( |
| 5467 DescriptorArray* descriptors, | 5498 DescriptorArray* descriptors, |
| 5468 TransitionFlag flag, | 5499 TransitionFlag flag, |
| 5469 Name* name = NULL, | 5500 Name* name = NULL, |
| 5470 SimpleTransitionFlag simple_flag = FULL_TRANSITION); | 5501 SimpleTransitionFlag simple_flag = FULL_TRANSITION); |
| 5471 MUST_USE_RESULT MaybeObject* CopyInstallDescriptors( | 5502 MUST_USE_RESULT MaybeObject* CopyInstallDescriptors( |
| 5472 int new_descriptor, | 5503 int new_descriptor, |
| 5473 DescriptorArray* descriptors); | 5504 DescriptorArray* descriptors); |
| 5474 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, | 5505 MUST_USE_RESULT MaybeObject* ShareDescriptor(DescriptorArray* descriptors, |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6143 DECL_BOOLEAN_ACCESSORS(is_toplevel) | 6174 DECL_BOOLEAN_ACCESSORS(is_toplevel) |
| 6144 | 6175 |
| 6145 // Bit field containing various information collected by the compiler to | 6176 // Bit field containing various information collected by the compiler to |
| 6146 // drive optimization. | 6177 // drive optimization. |
| 6147 inline int compiler_hints(); | 6178 inline int compiler_hints(); |
| 6148 inline void set_compiler_hints(int value); | 6179 inline void set_compiler_hints(int value); |
| 6149 | 6180 |
| 6150 inline int ast_node_count(); | 6181 inline int ast_node_count(); |
| 6151 inline void set_ast_node_count(int count); | 6182 inline void set_ast_node_count(int count); |
| 6152 | 6183 |
| 6153 // A counter used to determine when to stress the deoptimizer with a | |
| 6154 // deopt. | |
| 6155 inline int stress_deopt_counter(); | |
| 6156 inline void set_stress_deopt_counter(int counter); | |
| 6157 | |
| 6158 inline int profiler_ticks(); | 6184 inline int profiler_ticks(); |
| 6159 | 6185 |
| 6160 // Inline cache age is used to infer whether the function survived a context | 6186 // Inline cache age is used to infer whether the function survived a context |
| 6161 // disposal or not. In the former case we reset the opt_count. | 6187 // disposal or not. In the former case we reset the opt_count. |
| 6162 inline int ic_age(); | 6188 inline int ic_age(); |
| 6163 inline void set_ic_age(int age); | 6189 inline void set_ic_age(int age); |
| 6164 | 6190 |
| 6165 // Indicates if this function can be lazy compiled. | 6191 // Indicates if this function can be lazy compiled. |
| 6166 // This is used to determine if we can safely flush code from a function | 6192 // This is used to determine if we can safely flush code from a function |
| 6167 // when doing GC if we expect that the function will no longer be used. | 6193 // when doing GC if we expect that the function will no longer be used. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6339 static const int kStartPositionAndTypeOffset = | 6365 static const int kStartPositionAndTypeOffset = |
| 6340 kNumLiteralsOffset + kPointerSize; | 6366 kNumLiteralsOffset + kPointerSize; |
| 6341 static const int kEndPositionOffset = | 6367 static const int kEndPositionOffset = |
| 6342 kStartPositionAndTypeOffset + kPointerSize; | 6368 kStartPositionAndTypeOffset + kPointerSize; |
| 6343 static const int kFunctionTokenPositionOffset = | 6369 static const int kFunctionTokenPositionOffset = |
| 6344 kEndPositionOffset + kPointerSize; | 6370 kEndPositionOffset + kPointerSize; |
| 6345 static const int kCompilerHintsOffset = | 6371 static const int kCompilerHintsOffset = |
| 6346 kFunctionTokenPositionOffset + kPointerSize; | 6372 kFunctionTokenPositionOffset + kPointerSize; |
| 6347 static const int kOptCountOffset = kCompilerHintsOffset + kPointerSize; | 6373 static const int kOptCountOffset = kCompilerHintsOffset + kPointerSize; |
| 6348 static const int kCountersOffset = kOptCountOffset + kPointerSize; | 6374 static const int kCountersOffset = kOptCountOffset + kPointerSize; |
| 6349 static const int kStressDeoptCounterOffset = kCountersOffset + kPointerSize; | |
| 6350 | 6375 |
| 6351 // Total size. | 6376 // Total size. |
| 6352 static const int kSize = kStressDeoptCounterOffset + kPointerSize; | 6377 static const int kSize = kCountersOffset + kPointerSize; |
| 6353 #else | 6378 #else |
| 6354 // The only reason to use smi fields instead of int fields | 6379 // The only reason to use smi fields instead of int fields |
| 6355 // is to allow iteration without maps decoding during | 6380 // is to allow iteration without maps decoding during |
| 6356 // garbage collections. | 6381 // garbage collections. |
| 6357 // To avoid wasting space on 64-bit architectures we use | 6382 // To avoid wasting space on 64-bit architectures we use |
| 6358 // the following trick: we group integer fields into pairs | 6383 // the following trick: we group integer fields into pairs |
| 6359 // First integer in each pair is shifted left by 1. | 6384 // First integer in each pair is shifted left by 1. |
| 6360 // By doing this we guarantee that LSB of each kPointerSize aligned | 6385 // By doing this we guarantee that LSB of each kPointerSize aligned |
| 6361 // word is not set and thus this word cannot be treated as pointer | 6386 // word is not set and thus this word cannot be treated as pointer |
| 6362 // to HeapObject during old space traversal. | 6387 // to HeapObject during old space traversal. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6376 kEndPositionOffset + kIntSize; | 6401 kEndPositionOffset + kIntSize; |
| 6377 | 6402 |
| 6378 static const int kFunctionTokenPositionOffset = | 6403 static const int kFunctionTokenPositionOffset = |
| 6379 kStartPositionAndTypeOffset + kIntSize; | 6404 kStartPositionAndTypeOffset + kIntSize; |
| 6380 static const int kCompilerHintsOffset = | 6405 static const int kCompilerHintsOffset = |
| 6381 kFunctionTokenPositionOffset + kIntSize; | 6406 kFunctionTokenPositionOffset + kIntSize; |
| 6382 | 6407 |
| 6383 static const int kOptCountOffset = kCompilerHintsOffset + kIntSize; | 6408 static const int kOptCountOffset = kCompilerHintsOffset + kIntSize; |
| 6384 | 6409 |
| 6385 static const int kCountersOffset = kOptCountOffset + kIntSize; | 6410 static const int kCountersOffset = kOptCountOffset + kIntSize; |
| 6386 static const int kStressDeoptCounterOffset = kCountersOffset + kIntSize; | |
| 6387 | 6411 |
| 6388 // Total size. | 6412 // Total size. |
| 6389 static const int kSize = kStressDeoptCounterOffset + kIntSize; | 6413 static const int kSize = kCountersOffset + kIntSize; |
| 6390 | 6414 |
| 6391 #endif | 6415 #endif |
| 6392 | 6416 |
| 6393 // The construction counter for inobject slack tracking is stored in the | 6417 // The construction counter for inobject slack tracking is stored in the |
| 6394 // most significant byte of compiler_hints which is otherwise unused. | 6418 // most significant byte of compiler_hints which is otherwise unused. |
| 6395 // Its offset depends on the endian-ness of the architecture. | 6419 // Its offset depends on the endian-ness of the architecture. |
| 6396 #if __BYTE_ORDER == __LITTLE_ENDIAN | 6420 #if __BYTE_ORDER == __LITTLE_ENDIAN |
| 6397 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; | 6421 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; |
| 6398 #elif __BYTE_ORDER == __BIG_ENDIAN | 6422 #elif __BYTE_ORDER == __BIG_ENDIAN |
| 6399 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; | 6423 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6681 inline bool has_initial_map(); | 6705 inline bool has_initial_map(); |
| 6682 | 6706 |
| 6683 // Get and set the prototype property on a JSFunction. If the | 6707 // Get and set the prototype property on a JSFunction. If the |
| 6684 // function has an initial map the prototype is set on the initial | 6708 // function has an initial map the prototype is set on the initial |
| 6685 // map. Otherwise, the prototype is put in the initial map field | 6709 // map. Otherwise, the prototype is put in the initial map field |
| 6686 // until an initial map is needed. | 6710 // until an initial map is needed. |
| 6687 inline bool has_prototype(); | 6711 inline bool has_prototype(); |
| 6688 inline bool has_instance_prototype(); | 6712 inline bool has_instance_prototype(); |
| 6689 inline Object* prototype(); | 6713 inline Object* prototype(); |
| 6690 inline Object* instance_prototype(); | 6714 inline Object* instance_prototype(); |
| 6691 MUST_USE_RESULT MaybeObject* SetInstancePrototype(Object* value); | 6715 static void SetPrototype(Handle<JSFunction> function, |
| 6692 MUST_USE_RESULT MaybeObject* SetPrototype(Object* value); | 6716 Handle<Object> value); |
| 6717 static void SetInstancePrototype(Handle<JSFunction> function, |
| 6718 Handle<Object> value); |
| 6693 | 6719 |
| 6694 // After prototype is removed, it will not be created when accessed, and | 6720 // After prototype is removed, it will not be created when accessed, and |
| 6695 // [[Construct]] from this function will not be allowed. | 6721 // [[Construct]] from this function will not be allowed. |
| 6696 void RemovePrototype(); | 6722 void RemovePrototype(); |
| 6697 inline bool should_have_prototype(); | 6723 inline bool should_have_prototype(); |
| 6698 | 6724 |
| 6699 // Accessor for this function's initial map's [[class]] | 6725 // Accessor for this function's initial map's [[class]] |
| 6700 // property. This is primarily used by ECMA native functions. This | 6726 // property. This is primarily used by ECMA native functions. This |
| 6701 // method sets the class_name field of this function's initial map | 6727 // method sets the class_name field of this function's initial map |
| 6702 // to a given value. It creates an initial map if this function does | 6728 // to a given value. It creates an initial map if this function does |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7469 | 7495 |
| 7470 enum AllocationSiteMode { | 7496 enum AllocationSiteMode { |
| 7471 DONT_TRACK_ALLOCATION_SITE, | 7497 DONT_TRACK_ALLOCATION_SITE, |
| 7472 TRACK_ALLOCATION_SITE, | 7498 TRACK_ALLOCATION_SITE, |
| 7473 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE | 7499 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE |
| 7474 }; | 7500 }; |
| 7475 | 7501 |
| 7476 | 7502 |
| 7477 class AllocationSite: public Struct { | 7503 class AllocationSite: public Struct { |
| 7478 public: | 7504 public: |
| 7479 static const int kTransitionInfoOffset = HeapObject::kHeaderSize; | |
| 7480 static const int kSize = kTransitionInfoOffset + kPointerSize; | |
| 7481 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; | 7505 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; |
| 7482 | 7506 |
| 7483 DECL_ACCESSORS(transition_info, Object) | 7507 DECL_ACCESSORS(transition_info, Object) |
| 7508 DECL_ACCESSORS(weak_next, Object) |
| 7484 | 7509 |
| 7485 void Initialize() { | 7510 void Initialize() { |
| 7486 SetElementsKind(GetInitialFastElementsKind()); | 7511 SetElementsKind(GetInitialFastElementsKind()); |
| 7487 } | 7512 } |
| 7488 | 7513 |
| 7489 ElementsKind GetElementsKind() { | 7514 ElementsKind GetElementsKind() { |
| 7490 ASSERT(!IsLiteralSite()); | 7515 ASSERT(!IsLiteralSite()); |
| 7491 return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); | 7516 return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); |
| 7492 } | 7517 } |
| 7493 | 7518 |
| 7494 void SetElementsKind(ElementsKind kind) { | 7519 void SetElementsKind(ElementsKind kind) { |
| 7495 set_transition_info(Smi::FromInt(static_cast<int>(kind))); | 7520 set_transition_info(Smi::FromInt(static_cast<int>(kind))); |
| 7496 } | 7521 } |
| 7497 | 7522 |
| 7498 bool IsLiteralSite() { | 7523 bool IsLiteralSite() { |
| 7499 // If transition_info is a smi, then it represents an ElementsKind | 7524 // If transition_info is a smi, then it represents an ElementsKind |
| 7500 // for a constructed array. Otherwise, it must be a boilerplate | 7525 // for a constructed array. Otherwise, it must be a boilerplate |
| 7501 // for an array literal | 7526 // for an array literal |
| 7502 return transition_info()->IsJSArray(); | 7527 return transition_info()->IsJSArray(); |
| 7503 } | 7528 } |
| 7504 | 7529 |
| 7505 DECLARE_PRINTER(AllocationSite) | 7530 DECLARE_PRINTER(AllocationSite) |
| 7506 DECLARE_VERIFIER(AllocationSite) | 7531 DECLARE_VERIFIER(AllocationSite) |
| 7507 | 7532 |
| 7508 static inline AllocationSite* cast(Object* obj); | 7533 static inline AllocationSite* cast(Object* obj); |
| 7509 static inline AllocationSiteMode GetMode( | 7534 static inline AllocationSiteMode GetMode( |
| 7510 ElementsKind boilerplate_elements_kind); | 7535 ElementsKind boilerplate_elements_kind); |
| 7511 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); | 7536 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); |
| 7512 | 7537 |
| 7538 static const int kTransitionInfoOffset = HeapObject::kHeaderSize; |
| 7539 static const int kWeakNextOffset = kTransitionInfoOffset + kPointerSize; |
| 7540 static const int kSize = kWeakNextOffset + kPointerSize; |
| 7541 |
| 7542 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, |
| 7543 kTransitionInfoOffset + kPointerSize, |
| 7544 kSize> BodyDescriptor; |
| 7545 |
| 7513 private: | 7546 private: |
| 7514 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); | 7547 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); |
| 7515 }; | 7548 }; |
| 7516 | 7549 |
| 7517 | 7550 |
| 7518 class AllocationSiteInfo: public Struct { | 7551 class AllocationMemento: public Struct { |
| 7519 public: | 7552 public: |
| 7520 static const int kAllocationSiteOffset = HeapObject::kHeaderSize; | 7553 static const int kAllocationSiteOffset = HeapObject::kHeaderSize; |
| 7521 static const int kSize = kAllocationSiteOffset + kPointerSize; | 7554 static const int kSize = kAllocationSiteOffset + kPointerSize; |
| 7522 | 7555 |
| 7523 DECL_ACCESSORS(allocation_site, Object) | 7556 DECL_ACCESSORS(allocation_site, Object) |
| 7524 | 7557 |
| 7525 bool IsValid() { return allocation_site()->IsAllocationSite(); } | 7558 bool IsValid() { return allocation_site()->IsAllocationSite(); } |
| 7526 AllocationSite* GetAllocationSite() { | 7559 AllocationSite* GetAllocationSite() { |
| 7527 ASSERT(IsValid()); | 7560 ASSERT(IsValid()); |
| 7528 return AllocationSite::cast(allocation_site()); | 7561 return AllocationSite::cast(allocation_site()); |
| 7529 } | 7562 } |
| 7530 | 7563 |
| 7531 DECLARE_PRINTER(AllocationSiteInfo) | 7564 DECLARE_PRINTER(AllocationMemento) |
| 7532 DECLARE_VERIFIER(AllocationSiteInfo) | 7565 DECLARE_VERIFIER(AllocationMemento) |
| 7533 | 7566 |
| 7534 // Returns NULL if no AllocationSiteInfo is available for object. | 7567 // Returns NULL if no AllocationMemento is available for object. |
| 7535 static AllocationSiteInfo* FindForJSObject(JSObject* object); | 7568 static AllocationMemento* FindForJSObject(JSObject* object); |
| 7536 static inline AllocationSiteInfo* cast(Object* obj); | 7569 static inline AllocationMemento* cast(Object* obj); |
| 7537 | 7570 |
| 7538 private: | 7571 private: |
| 7539 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); | 7572 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationMemento); |
| 7540 }; | 7573 }; |
| 7541 | 7574 |
| 7542 | 7575 |
| 7543 // Representation of a slow alias as part of a non-strict arguments objects. | 7576 // Representation of a slow alias as part of a non-strict arguments objects. |
| 7544 // For fast aliases (if HasNonStrictArgumentsElements()): | 7577 // For fast aliases (if HasNonStrictArgumentsElements()): |
| 7545 // - the parameter map contains an index into the context | 7578 // - the parameter map contains an index into the context |
| 7546 // - all attributes of the element have default values | 7579 // - all attributes of the element have default values |
| 7547 // For slow aliases (if HasDictionaryArgumentsElements()): | 7580 // For slow aliases (if HasDictionaryArgumentsElements()): |
| 7548 // - the parameter map contains no fast alias mapping (i.e. the hole) | 7581 // - the parameter map contains no fast alias mapping (i.e. the hole) |
| 7549 // - this struct (in the slow backing store) contains an index into the context | 7582 // - this struct (in the slow backing store) contains an index into the context |
| (...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8727 // that is read-only, throw. In all these cases set '*done' to true, | 8760 // that is read-only, throw. In all these cases set '*done' to true, |
| 8728 // otherwise set it to false. | 8761 // otherwise set it to false. |
| 8729 MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypesWithHandler( | 8762 MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypesWithHandler( |
| 8730 JSReceiver* receiver, | 8763 JSReceiver* receiver, |
| 8731 Name* name, | 8764 Name* name, |
| 8732 Object* value, | 8765 Object* value, |
| 8733 PropertyAttributes attributes, | 8766 PropertyAttributes attributes, |
| 8734 StrictModeFlag strict_mode, | 8767 StrictModeFlag strict_mode, |
| 8735 bool* done); | 8768 bool* done); |
| 8736 | 8769 |
| 8737 MUST_USE_RESULT MaybeObject* DeletePropertyWithHandler( | |
| 8738 Name* name, | |
| 8739 DeleteMode mode); | |
| 8740 MUST_USE_RESULT MaybeObject* DeleteElementWithHandler( | |
| 8741 uint32_t index, | |
| 8742 DeleteMode mode); | |
| 8743 | |
| 8744 MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler( | 8770 MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler( |
| 8745 JSReceiver* receiver, | 8771 JSReceiver* receiver, |
| 8746 Name* name); | 8772 Name* name); |
| 8747 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithHandler( | 8773 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithHandler( |
| 8748 JSReceiver* receiver, | 8774 JSReceiver* receiver, |
| 8749 uint32_t index); | 8775 uint32_t index); |
| 8750 | 8776 |
| 8751 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 8777 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
| 8752 | 8778 |
| 8753 // Turn this into an (empty) JSObject. | 8779 // Turn this into an (empty) JSObject. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 8777 static const int kHeaderSize = kPaddingOffset; | 8803 static const int kHeaderSize = kPaddingOffset; |
| 8778 static const int kPaddingSize = kSize - kPaddingOffset; | 8804 static const int kPaddingSize = kSize - kPaddingOffset; |
| 8779 | 8805 |
| 8780 STATIC_CHECK(kPaddingSize >= 0); | 8806 STATIC_CHECK(kPaddingSize >= 0); |
| 8781 | 8807 |
| 8782 typedef FixedBodyDescriptor<kHandlerOffset, | 8808 typedef FixedBodyDescriptor<kHandlerOffset, |
| 8783 kPaddingOffset, | 8809 kPaddingOffset, |
| 8784 kSize> BodyDescriptor; | 8810 kSize> BodyDescriptor; |
| 8785 | 8811 |
| 8786 private: | 8812 private: |
| 8813 friend class JSReceiver; |
| 8814 |
| 8815 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> object, |
| 8816 Handle<Name> name, |
| 8817 DeleteMode mode); |
| 8818 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> object, |
| 8819 uint32_t index, |
| 8820 DeleteMode mode); |
| 8821 |
| 8787 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 8822 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
| 8788 }; | 8823 }; |
| 8789 | 8824 |
| 8790 | 8825 |
| 8791 class JSFunctionProxy: public JSProxy { | 8826 class JSFunctionProxy: public JSProxy { |
| 8792 public: | 8827 public: |
| 8793 // [call_trap]: The call trap. | 8828 // [call_trap]: The call trap. |
| 8794 DECL_ACCESSORS(call_trap, Object) | 8829 DECL_ACCESSORS(call_trap, Object) |
| 8795 | 8830 |
| 8796 // [construct_trap]: The construct trap. | 8831 // [construct_trap]: The construct trap. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8856 DECLARE_VERIFIER(JSMap) | 8891 DECLARE_VERIFIER(JSMap) |
| 8857 | 8892 |
| 8858 static const int kTableOffset = JSObject::kHeaderSize; | 8893 static const int kTableOffset = JSObject::kHeaderSize; |
| 8859 static const int kSize = kTableOffset + kPointerSize; | 8894 static const int kSize = kTableOffset + kPointerSize; |
| 8860 | 8895 |
| 8861 private: | 8896 private: |
| 8862 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 8897 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); |
| 8863 }; | 8898 }; |
| 8864 | 8899 |
| 8865 | 8900 |
| 8866 // The JSWeakMap describes EcmaScript Harmony weak maps | 8901 // Base class for both JSWeakMap and JSWeakSet |
| 8867 class JSWeakMap: public JSObject { | 8902 class JSWeakCollection: public JSObject { |
| 8868 public: | 8903 public: |
| 8869 // [table]: the backing hash table mapping keys to values. | 8904 // [table]: the backing hash table mapping keys to values. |
| 8870 DECL_ACCESSORS(table, Object) | 8905 DECL_ACCESSORS(table, Object) |
| 8871 | 8906 |
| 8872 // [next]: linked list of encountered weak maps during GC. | 8907 // [next]: linked list of encountered weak maps during GC. |
| 8873 DECL_ACCESSORS(next, Object) | 8908 DECL_ACCESSORS(next, Object) |
| 8874 | 8909 |
| 8910 static const int kTableOffset = JSObject::kHeaderSize; |
| 8911 static const int kNextOffset = kTableOffset + kPointerSize; |
| 8912 static const int kSize = kNextOffset + kPointerSize; |
| 8913 |
| 8914 private: |
| 8915 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakCollection); |
| 8916 }; |
| 8917 |
| 8918 |
| 8919 // The JSWeakMap describes EcmaScript Harmony weak maps |
| 8920 class JSWeakMap: public JSWeakCollection { |
| 8921 public: |
| 8875 // Casting. | 8922 // Casting. |
| 8876 static inline JSWeakMap* cast(Object* obj); | 8923 static inline JSWeakMap* cast(Object* obj); |
| 8877 | 8924 |
| 8878 // Dispatched behavior. | 8925 // Dispatched behavior. |
| 8879 DECLARE_PRINTER(JSWeakMap) | 8926 DECLARE_PRINTER(JSWeakMap) |
| 8880 DECLARE_VERIFIER(JSWeakMap) | 8927 DECLARE_VERIFIER(JSWeakMap) |
| 8881 | 8928 |
| 8882 static const int kTableOffset = JSObject::kHeaderSize; | |
| 8883 static const int kNextOffset = kTableOffset + kPointerSize; | |
| 8884 static const int kSize = kNextOffset + kPointerSize; | |
| 8885 | |
| 8886 private: | 8929 private: |
| 8887 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); | 8930 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); |
| 8888 }; | 8931 }; |
| 8889 | 8932 |
| 8890 | 8933 |
| 8934 // The JSWeakSet describes EcmaScript Harmony weak sets |
| 8935 class JSWeakSet: public JSWeakCollection { |
| 8936 public: |
| 8937 // Casting. |
| 8938 static inline JSWeakSet* cast(Object* obj); |
| 8939 |
| 8940 // Dispatched behavior. |
| 8941 DECLARE_PRINTER(JSWeakSet) |
| 8942 DECLARE_VERIFIER(JSWeakSet) |
| 8943 |
| 8944 private: |
| 8945 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakSet); |
| 8946 }; |
| 8947 |
| 8948 |
| 8891 class JSArrayBuffer: public JSObject { | 8949 class JSArrayBuffer: public JSObject { |
| 8892 public: | 8950 public: |
| 8893 // [backing_store]: backing memory for this array | 8951 // [backing_store]: backing memory for this array |
| 8894 DECL_ACCESSORS(backing_store, void) | 8952 DECL_ACCESSORS(backing_store, void) |
| 8895 | 8953 |
| 8896 // [byte_length]: length in bytes | 8954 // [byte_length]: length in bytes |
| 8897 DECL_ACCESSORS(byte_length, Object) | 8955 DECL_ACCESSORS(byte_length, Object) |
| 8898 | 8956 |
| 8899 // [flags] | 8957 // [flags] |
| 8900 DECL_ACCESSORS(flag, Smi) | 8958 DECL_ACCESSORS(flag, Smi) |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9821 } else { | 9879 } else { |
| 9822 value &= ~(1 << bit_position); | 9880 value &= ~(1 << bit_position); |
| 9823 } | 9881 } |
| 9824 return value; | 9882 return value; |
| 9825 } | 9883 } |
| 9826 }; | 9884 }; |
| 9827 | 9885 |
| 9828 } } // namespace v8::internal | 9886 } } // namespace v8::internal |
| 9829 | 9887 |
| 9830 #endif // V8_OBJECTS_H_ | 9888 #endif // V8_OBJECTS_H_ |
| OLD | NEW |