| OLD | NEW |
| 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 | 9 |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 | 769 |
| 770 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ | 770 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ |
| 771 V(CODE_STUBS_TABLE_SUB_TYPE) \ | 771 V(CODE_STUBS_TABLE_SUB_TYPE) \ |
| 772 V(CONTEXT_SUB_TYPE) \ | 772 V(CONTEXT_SUB_TYPE) \ |
| 773 V(COPY_ON_WRITE_SUB_TYPE) \ | 773 V(COPY_ON_WRITE_SUB_TYPE) \ |
| 774 V(DEOPTIMIZATION_DATA_SUB_TYPE) \ | 774 V(DEOPTIMIZATION_DATA_SUB_TYPE) \ |
| 775 V(DESCRIPTOR_ARRAY_SUB_TYPE) \ | 775 V(DESCRIPTOR_ARRAY_SUB_TYPE) \ |
| 776 V(EMBEDDED_OBJECT_SUB_TYPE) \ | 776 V(EMBEDDED_OBJECT_SUB_TYPE) \ |
| 777 V(ENUM_CACHE_SUB_TYPE) \ | 777 V(ENUM_CACHE_SUB_TYPE) \ |
| 778 V(ENUM_INDICES_CACHE_SUB_TYPE) \ | 778 V(ENUM_INDICES_CACHE_SUB_TYPE) \ |
| 779 V(DEPENDENT_CODE_SUB_TYPE) \ |
| 779 V(DICTIONARY_ELEMENTS_SUB_TYPE) \ | 780 V(DICTIONARY_ELEMENTS_SUB_TYPE) \ |
| 780 V(DICTIONARY_PROPERTIES_SUB_TYPE) \ | 781 V(DICTIONARY_PROPERTIES_SUB_TYPE) \ |
| 782 V(EMPTY_PROPERTIES_DICTIONARY_SUB_TYPE) \ |
| 781 V(FAST_ELEMENTS_SUB_TYPE) \ | 783 V(FAST_ELEMENTS_SUB_TYPE) \ |
| 782 V(FAST_PROPERTIES_SUB_TYPE) \ | 784 V(FAST_PROPERTIES_SUB_TYPE) \ |
| 785 V(HANDLER_TABLE_SUB_TYPE) \ |
| 783 V(INTRINSIC_FUNCTION_NAMES_SUB_TYPE) \ | 786 V(INTRINSIC_FUNCTION_NAMES_SUB_TYPE) \ |
| 787 V(JS_COLLECTION_SUB_TYPE) \ |
| 788 V(JS_WEAK_COLLECTION_SUB_TYPE) \ |
| 784 V(LITERALS_ARRAY_SUB_TYPE) \ | 789 V(LITERALS_ARRAY_SUB_TYPE) \ |
| 785 V(MAP_CODE_CACHE_SUB_TYPE) \ | 790 V(MAP_CODE_CACHE_SUB_TYPE) \ |
| 791 V(NOSCRIPT_SHARED_FUNCTION_INFOS_SUB_TYPE) \ |
| 786 V(NUMBER_STRING_CACHE_SUB_TYPE) \ | 792 V(NUMBER_STRING_CACHE_SUB_TYPE) \ |
| 787 V(OBJECT_TO_CODE_SUB_TYPE) \ | 793 V(OBJECT_TO_CODE_SUB_TYPE) \ |
| 794 V(OPTIMIZED_CODE_MAP_SUB_TYPE) \ |
| 795 V(PROTOTYPE_USERS_SUB_TYPE) \ |
| 788 V(REGEXP_MULTIPLE_CACHE_SUB_TYPE) \ | 796 V(REGEXP_MULTIPLE_CACHE_SUB_TYPE) \ |
| 797 V(RETAINED_MAPS_SUB_TYPE) \ |
| 789 V(SCOPE_INFO_SUB_TYPE) \ | 798 V(SCOPE_INFO_SUB_TYPE) \ |
| 799 V(SCRIPT_LIST_SUB_TYPE) \ |
| 790 V(SERIALIZED_TEMPLATES_SUB_TYPE) \ | 800 V(SERIALIZED_TEMPLATES_SUB_TYPE) \ |
| 791 V(SHARED_FUNCTION_INFOS_SUB_TYPE) \ | 801 V(SHARED_FUNCTION_INFOS_SUB_TYPE) \ |
| 792 V(SINGLE_CHARACTER_STRING_CACHE_SUB_TYPE) \ | 802 V(SINGLE_CHARACTER_STRING_CACHE_SUB_TYPE) \ |
| 793 V(STRING_SPLIT_CACHE_SUB_TYPE) \ | 803 V(STRING_SPLIT_CACHE_SUB_TYPE) \ |
| 794 V(STRING_TABLE_SUB_TYPE) \ | 804 V(STRING_TABLE_SUB_TYPE) \ |
| 795 V(TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE) \ | 805 V(TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE) \ |
| 796 V(TYPE_FEEDBACK_VECTOR_SUB_TYPE) \ | 806 V(TYPE_FEEDBACK_VECTOR_SUB_TYPE) \ |
| 797 V(TYPE_FEEDBACK_METADATA_SUB_TYPE) \ | 807 V(TYPE_FEEDBACK_METADATA_SUB_TYPE) \ |
| 798 V(WEAK_COLLECTION_SUB_TYPE) \ | |
| 799 V(WEAK_NEW_SPACE_OBJECT_TO_CODE_SUB_TYPE) | 808 V(WEAK_NEW_SPACE_OBJECT_TO_CODE_SUB_TYPE) |
| 800 | 809 |
| 801 enum FixedArraySubInstanceType { | 810 enum FixedArraySubInstanceType { |
| 802 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name, | 811 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name, |
| 803 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE) | 812 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE) |
| 804 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE | 813 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE |
| 805 LAST_FIXED_ARRAY_SUB_TYPE = WEAK_NEW_SPACE_OBJECT_TO_CODE_SUB_TYPE | 814 LAST_FIXED_ARRAY_SUB_TYPE = WEAK_NEW_SPACE_OBJECT_TO_CODE_SUB_TYPE |
| 806 }; | 815 }; |
| 807 | 816 |
| 808 | 817 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 V(SharedFunctionInfo) \ | 977 V(SharedFunctionInfo) \ |
| 969 V(JSValue) \ | 978 V(JSValue) \ |
| 970 V(JSDate) \ | 979 V(JSDate) \ |
| 971 V(JSMessageObject) \ | 980 V(JSMessageObject) \ |
| 972 V(StringWrapper) \ | 981 V(StringWrapper) \ |
| 973 V(Foreign) \ | 982 V(Foreign) \ |
| 974 V(Boolean) \ | 983 V(Boolean) \ |
| 975 V(JSArray) \ | 984 V(JSArray) \ |
| 976 V(JSArrayBuffer) \ | 985 V(JSArrayBuffer) \ |
| 977 V(JSArrayBufferView) \ | 986 V(JSArrayBufferView) \ |
| 987 V(JSCollection) \ |
| 978 V(JSTypedArray) \ | 988 V(JSTypedArray) \ |
| 979 V(JSDataView) \ | 989 V(JSDataView) \ |
| 980 V(JSProxy) \ | 990 V(JSProxy) \ |
| 981 V(JSError) \ | 991 V(JSError) \ |
| 982 V(JSPromise) \ | 992 V(JSPromise) \ |
| 983 V(JSSet) \ | 993 V(JSSet) \ |
| 984 V(JSMap) \ | 994 V(JSMap) \ |
| 985 V(JSSetIterator) \ | 995 V(JSSetIterator) \ |
| 986 V(JSMapIterator) \ | 996 V(JSMapIterator) \ |
| 987 V(JSWeakCollection) \ | 997 V(JSWeakCollection) \ |
| (...skipping 4595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5583 kInitialMapChangedGroup, | 5593 kInitialMapChangedGroup, |
| 5584 // Group of code that depends on tenuring information in AllocationSites | 5594 // Group of code that depends on tenuring information in AllocationSites |
| 5585 // not being changed. | 5595 // not being changed. |
| 5586 kAllocationSiteTenuringChangedGroup, | 5596 kAllocationSiteTenuringChangedGroup, |
| 5587 // Group of code that depends on element transition information in | 5597 // Group of code that depends on element transition information in |
| 5588 // AllocationSites not being changed. | 5598 // AllocationSites not being changed. |
| 5589 kAllocationSiteTransitionChangedGroup | 5599 kAllocationSiteTransitionChangedGroup |
| 5590 }; | 5600 }; |
| 5591 | 5601 |
| 5592 static const int kGroupCount = kAllocationSiteTransitionChangedGroup + 1; | 5602 static const int kGroupCount = kAllocationSiteTransitionChangedGroup + 1; |
| 5603 static const int kNextLinkIndex = 0; |
| 5604 static const int kFlagsIndex = 1; |
| 5605 static const int kCodesStartIndex = 2; |
| 5593 | 5606 |
| 5594 bool Contains(DependencyGroup group, WeakCell* code_cell); | 5607 bool Contains(DependencyGroup group, WeakCell* code_cell); |
| 5595 bool IsEmpty(DependencyGroup group); | 5608 bool IsEmpty(DependencyGroup group); |
| 5596 | 5609 |
| 5597 static Handle<DependentCode> InsertCompilationDependencies( | 5610 static Handle<DependentCode> InsertCompilationDependencies( |
| 5598 Handle<DependentCode> entries, DependencyGroup group, | 5611 Handle<DependentCode> entries, DependencyGroup group, |
| 5599 Handle<Foreign> info); | 5612 Handle<Foreign> info); |
| 5600 | 5613 |
| 5601 static Handle<DependentCode> InsertWeakCode(Handle<DependentCode> entries, | 5614 static Handle<DependentCode> InsertWeakCode(Handle<DependentCode> entries, |
| 5602 DependencyGroup group, | 5615 DependencyGroup group, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5643 bool Compact(); | 5656 bool Compact(); |
| 5644 static int Grow(int number_of_entries) { | 5657 static int Grow(int number_of_entries) { |
| 5645 if (number_of_entries < 5) return number_of_entries + 1; | 5658 if (number_of_entries < 5) return number_of_entries + 1; |
| 5646 return number_of_entries * 5 / 4; | 5659 return number_of_entries * 5 / 4; |
| 5647 } | 5660 } |
| 5648 inline int flags(); | 5661 inline int flags(); |
| 5649 inline void set_flags(int flags); | 5662 inline void set_flags(int flags); |
| 5650 class GroupField : public BitField<int, 0, 3> {}; | 5663 class GroupField : public BitField<int, 0, 3> {}; |
| 5651 class CountField : public BitField<int, 3, 27> {}; | 5664 class CountField : public BitField<int, 3, 27> {}; |
| 5652 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1); | 5665 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1); |
| 5653 static const int kNextLinkIndex = 0; | |
| 5654 static const int kFlagsIndex = 1; | |
| 5655 static const int kCodesStartIndex = 2; | |
| 5656 }; | 5666 }; |
| 5657 | 5667 |
| 5658 | 5668 |
| 5659 class PrototypeInfo; | 5669 class PrototypeInfo; |
| 5660 | 5670 |
| 5661 | 5671 |
| 5662 // All heap objects have a Map that describes their structure. | 5672 // All heap objects have a Map that describes their structure. |
| 5663 // A Map contains information about: | 5673 // A Map contains information about: |
| 5664 // - Size information about the object | 5674 // - Size information about the object |
| 5665 // - How to iterate over an object (for garbage collection) | 5675 // - How to iterate over an object (for garbage collection) |
| (...skipping 5338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11004 } | 11014 } |
| 11005 return value; | 11015 return value; |
| 11006 } | 11016 } |
| 11007 }; | 11017 }; |
| 11008 | 11018 |
| 11009 | 11019 |
| 11010 } // NOLINT, false-positive due to second-order macros. | 11020 } // NOLINT, false-positive due to second-order macros. |
| 11011 } // NOLINT, false-positive due to second-order macros. | 11021 } // NOLINT, false-positive due to second-order macros. |
| 11012 | 11022 |
| 11013 #endif // V8_OBJECTS_H_ | 11023 #endif // V8_OBJECTS_H_ |
| OLD | NEW |