OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 FIXED_UINT8_ARRAY_TYPE, | 710 FIXED_UINT8_ARRAY_TYPE, |
711 FIXED_INT16_ARRAY_TYPE, | 711 FIXED_INT16_ARRAY_TYPE, |
712 FIXED_UINT16_ARRAY_TYPE, | 712 FIXED_UINT16_ARRAY_TYPE, |
713 FIXED_INT32_ARRAY_TYPE, | 713 FIXED_INT32_ARRAY_TYPE, |
714 FIXED_UINT32_ARRAY_TYPE, | 714 FIXED_UINT32_ARRAY_TYPE, |
715 FIXED_FLOAT32_ARRAY_TYPE, | 715 FIXED_FLOAT32_ARRAY_TYPE, |
716 FIXED_FLOAT64_ARRAY_TYPE, | 716 FIXED_FLOAT64_ARRAY_TYPE, |
717 FIXED_UINT8_CLAMPED_ARRAY_TYPE, // LAST_FIXED_TYPED_ARRAY_TYPE | 717 FIXED_UINT8_CLAMPED_ARRAY_TYPE, // LAST_FIXED_TYPED_ARRAY_TYPE |
718 | 718 |
719 FIXED_DOUBLE_ARRAY_TYPE, | 719 FIXED_DOUBLE_ARRAY_TYPE, |
720 CONSTANT_POOL_ARRAY_TYPE, | |
721 FILLER_TYPE, // LAST_DATA_TYPE | 720 FILLER_TYPE, // LAST_DATA_TYPE |
722 | 721 |
723 // Structs. | 722 // Structs. |
724 DECLARED_ACCESSOR_DESCRIPTOR_TYPE, | 723 DECLARED_ACCESSOR_DESCRIPTOR_TYPE, |
725 DECLARED_ACCESSOR_INFO_TYPE, | 724 DECLARED_ACCESSOR_INFO_TYPE, |
726 EXECUTABLE_ACCESSOR_INFO_TYPE, | 725 EXECUTABLE_ACCESSOR_INFO_TYPE, |
727 ACCESSOR_PAIR_TYPE, | 726 ACCESSOR_PAIR_TYPE, |
728 ACCESS_CHECK_INFO_TYPE, | 727 ACCESS_CHECK_INFO_TYPE, |
729 INTERCEPTOR_INFO_TYPE, | 728 INTERCEPTOR_INFO_TYPE, |
730 CALL_HANDLER_INFO_TYPE, | 729 CALL_HANDLER_INFO_TYPE, |
731 FUNCTION_TEMPLATE_INFO_TYPE, | 730 FUNCTION_TEMPLATE_INFO_TYPE, |
732 OBJECT_TEMPLATE_INFO_TYPE, | 731 OBJECT_TEMPLATE_INFO_TYPE, |
733 SIGNATURE_INFO_TYPE, | 732 SIGNATURE_INFO_TYPE, |
734 TYPE_SWITCH_INFO_TYPE, | 733 TYPE_SWITCH_INFO_TYPE, |
735 ALLOCATION_SITE_TYPE, | 734 ALLOCATION_SITE_TYPE, |
736 ALLOCATION_MEMENTO_TYPE, | 735 ALLOCATION_MEMENTO_TYPE, |
737 SCRIPT_TYPE, | 736 SCRIPT_TYPE, |
738 CODE_CACHE_TYPE, | 737 CODE_CACHE_TYPE, |
739 POLYMORPHIC_CODE_CACHE_TYPE, | 738 POLYMORPHIC_CODE_CACHE_TYPE, |
740 TYPE_FEEDBACK_INFO_TYPE, | 739 TYPE_FEEDBACK_INFO_TYPE, |
741 ALIASED_ARGUMENTS_ENTRY_TYPE, | 740 ALIASED_ARGUMENTS_ENTRY_TYPE, |
742 BOX_TYPE, | 741 BOX_TYPE, |
743 DEBUG_INFO_TYPE, | 742 DEBUG_INFO_TYPE, |
744 BREAK_POINT_INFO_TYPE, | 743 BREAK_POINT_INFO_TYPE, |
745 | 744 |
746 FIXED_ARRAY_TYPE, | 745 FIXED_ARRAY_TYPE, |
| 746 CONSTANT_POOL_ARRAY_TYPE, |
747 SHARED_FUNCTION_INFO_TYPE, | 747 SHARED_FUNCTION_INFO_TYPE, |
748 | 748 |
749 // All the following types are subtypes of JSReceiver, which corresponds to | 749 // All the following types are subtypes of JSReceiver, which corresponds to |
750 // objects in the JS sense. The first and the last type in this range are | 750 // objects in the JS sense. The first and the last type in this range are |
751 // the two forms of function. This organization enables using the same | 751 // the two forms of function. This organization enables using the same |
752 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the | 752 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the |
753 // NONCALLABLE_JS_OBJECT range. | 753 // NONCALLABLE_JS_OBJECT range. |
754 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE | 754 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE |
755 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE | 755 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE |
756 | 756 |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 | 1712 |
1713 // Iterates over all pointers contained in the object except the | 1713 // Iterates over all pointers contained in the object except the |
1714 // first map pointer. The object type is given in the first | 1714 // first map pointer. The object type is given in the first |
1715 // parameter. This function does not access the map pointer in the | 1715 // parameter. This function does not access the map pointer in the |
1716 // object, and so is safe to call while the map pointer is modified. | 1716 // object, and so is safe to call while the map pointer is modified. |
1717 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); | 1717 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); |
1718 | 1718 |
1719 // Returns the heap object's size in bytes | 1719 // Returns the heap object's size in bytes |
1720 inline int Size(); | 1720 inline int Size(); |
1721 | 1721 |
1722 // Returns true if this heap object contains only references to other | |
1723 // heap objects. | |
1724 inline bool ContainsPointers(); | |
1725 | |
1726 // Given a heap object's map pointer, returns the heap size in bytes | 1722 // Given a heap object's map pointer, returns the heap size in bytes |
1727 // Useful when the map pointer field is used for other purposes. | 1723 // Useful when the map pointer field is used for other purposes. |
1728 // GC internal. | 1724 // GC internal. |
1729 inline int SizeFromMap(Map* map); | 1725 inline int SizeFromMap(Map* map); |
1730 | 1726 |
1731 // Returns the field at offset in obj, as a read/write Object* reference. | 1727 // Returns the field at offset in obj, as a read/write Object* reference. |
1732 // Does no checking, and is safe to use during GC, while maps are invalid. | 1728 // Does no checking, and is safe to use during GC, while maps are invalid. |
1733 // Does not invoke write barrier, so should only be assigned to | 1729 // Does not invoke write barrier, so should only be assigned to |
1734 // during marking GC. | 1730 // during marking GC. |
1735 static inline Object** RawField(HeapObject* obj, int offset); | 1731 static inline Object** RawField(HeapObject* obj, int offset); |
(...skipping 9495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11231 } else { | 11227 } else { |
11232 value &= ~(1 << bit_position); | 11228 value &= ~(1 << bit_position); |
11233 } | 11229 } |
11234 return value; | 11230 return value; |
11235 } | 11231 } |
11236 }; | 11232 }; |
11237 | 11233 |
11238 } } // namespace v8::internal | 11234 } } // namespace v8::internal |
11239 | 11235 |
11240 #endif // V8_OBJECTS_H_ | 11236 #endif // V8_OBJECTS_H_ |
OLD | NEW |