5 #ifndef V8_HEAP_OBJECTS_VISITING_H_ 6 #define V8_HEAP_OBJECTS_VISITING_H_ 8 #include "src/allocation.h" 9 #include "src/layout-descriptor.h" 10 #include "src/objects-body-descriptors.h" 11 #include "src/objects.h" 12 #include "src/objects/hash-table.h" 13 #include "src/objects/ordered-hash-table.h" 14 #include "src/objects/string.h" 15 #include "src/visitors.h" 23 class EmbedderDataArray;
29 class JSWeakCollection;
31 class UncompiledDataWithoutPreParsedScope;
32 class UncompiledDataWithPreParsedScope;
33 class WasmInstanceObject;
35 #define TYPED_VISITOR_ID_LIST(V) \ 36 V(AllocationSite, AllocationSite*) \ 38 V(ByteArray, ByteArray) \ 39 V(BytecodeArray, BytecodeArray) \ 42 V(CodeDataContainer, CodeDataContainer*) \ 43 V(ConsString, ConsString) \ 45 V(DataHandler, DataHandler*) \ 46 V(DescriptorArray, DescriptorArray*) \ 47 V(EmbedderDataArray, EmbedderDataArray) \ 48 V(EphemeronHashTable, EphemeronHashTable) \ 49 V(FeedbackCell, FeedbackCell*) \ 50 V(FeedbackVector, FeedbackVector*) \ 51 V(FixedArray, FixedArray) \ 52 V(FixedDoubleArray, FixedDoubleArray) \ 53 V(FixedFloat64Array, FixedFloat64Array) \ 54 V(FixedTypedArrayBase, FixedTypedArrayBase) \ 55 V(JSArrayBuffer, JSArrayBuffer*) \ 56 V(JSDataView, JSDataView*) \ 57 V(JSObject, JSObject*) \ 58 V(JSTypedArray, JSTypedArray*) \ 59 V(JSWeakCollection, JSWeakCollection*) \ 61 V(NativeContext, NativeContext) \ 62 V(Oddball, Oddball*) \ 63 V(PreParsedScopeData, PreParsedScopeData*) \ 64 V(PropertyArray, PropertyArray) \ 65 V(PropertyCell, PropertyCell*) \ 66 V(PrototypeInfo, PrototypeInfo*) \ 67 V(SeqOneByteString, SeqOneByteString) \ 68 V(SeqTwoByteString, SeqTwoByteString) \ 69 V(SharedFunctionInfo, SharedFunctionInfo*) \ 70 V(SlicedString, SlicedString) \ 71 V(SmallOrderedHashMap, SmallOrderedHashMap) \ 72 V(SmallOrderedHashSet, SmallOrderedHashSet) \ 73 V(SmallOrderedNameDictionary, SmallOrderedNameDictionary) \ 75 V(ThinString, ThinString) \ 76 V(TransitionArray, TransitionArray*) \ 77 V(UncompiledDataWithoutPreParsedScope, UncompiledDataWithoutPreParsedScope*) \ 78 V(UncompiledDataWithPreParsedScope, UncompiledDataWithPreParsedScope*) \ 79 V(WasmInstanceObject, WasmInstanceObject*) 92 template <
typename ResultType,
typename ConcreteVisitor>
95 V8_INLINE ResultType Visit(
HeapObject*
object);
102 V8_INLINE
bool ShouldVisit(
HeapObject*
object) {
return true; }
104 V8_INLINE
bool ShouldVisitMapPointer() {
return true; }
109 V8_INLINE
bool AllowDefaultJSObjectVisit() {
return true; }
111 #define VISIT(TypeName, Type) \ 112 V8_INLINE ResultType Visit##TypeName(Map map, Type object); 113 TYPED_VISITOR_ID_LIST(VISIT)
115 V8_INLINE ResultType VisitShortcutCandidate(
Map map,
ConsString object);
116 V8_INLINE ResultType VisitDataObject(
Map map,
HeapObject*
object);
117 V8_INLINE ResultType VisitJSObjectFast(
Map map,
JSObject*
object);
118 V8_INLINE ResultType VisitJSApiObject(
Map map,
JSObject*
object);
119 V8_INLINE ResultType VisitStruct(
Map map,
HeapObject*
object);
120 V8_INLINE ResultType VisitFreeSpace(
Map map,
FreeSpace*
object);
121 V8_INLINE ResultType VisitWeakArray(
Map map,
HeapObject*
object);
123 template <
typename T,
typename =
typename std::enable_if<
124 std::is_base_of<Object, T>::value>
::type>
127 template <
typename T,
typename =
typename std::enable_if<
128 std::is_base_of<ObjectPtr, T>::value>
::type>
132 template <
typename ConcreteVisitor>
135 V8_INLINE
bool ShouldVisitMapPointer() {
return false; }
140 V8_INLINE
int VisitJSApiObject(
Map map,
JSObject*
object);
172 #endif // V8_HEAP_OBJECTS_VISITING_H_