5#ifndef INCLUDE_CPPGC_INTERNAL_GC_INFO_H_
6#define INCLUDE_CPPGC_INTERNAL_GC_INFO_H_
28 std::atomic<GCInfoIndex>& registered_index) {
29 EnsureGCInfoIndexTraitDispatch<T>{}(registered_index);
33 template <typename T, bool = std::is_polymorphic<T>::value,
36 struct EnsureGCInfoIndexTraitDispatch;
58#define DISPATCH(is_polymorphic, has_finalizer, has_non_hidden_name, function) \
59 template <typename T> \
60 struct EnsureGCInfoIndexTrait::EnsureGCInfoIndexTraitDispatch< \
61 T, is_polymorphic, has_finalizer, has_non_hidden_name> { \
62 V8_INLINE void operator()(std::atomic<GCInfoIndex>& registered_index) { \
108template <
typename T,
typename ParentMostGarbageCollectedType>
111 std::has_virtual_destructor<ParentMostGarbageCollectedType>::value;
113 std::is_trivially_destructible<ParentMostGarbageCollectedType>::value &&
114 std::is_trivially_destructible<T>::value;
117 ParentMostGarbageCollectedType>::value;
118#ifdef CPPGC_SUPPORTS_OBJECT_NAMES
130 ParentMostGarbageCollectedType, T>;
138 static_assert(
sizeof(T),
"T must be fully defined");
139 static std::atomic<GCInfoIndex>
141 GCInfoIndex index = registered_index.load(std::memory_order_acquire);
143 EnsureGCInfoIndexTrait::EnsureIndex<T>(registered_index);
147 index = registered_index.load(std::memory_order_acquire);
#define DISPATCH(is_polymorphic, has_finalizer, has_non_hidden_name, function)
#define CPPGC_DCHECK(condition)
void(*)(void *) FinalizationCallback
EnsureGCInfoIndexNonPolymorphic(registered_index, TraceTrait< T >::Trace, FinalizerTrait< T >::kCallback, NameTrait< T >::GetName)) DISPATCH(false
HeapObjectName(*)(const void *, HeapObjectNameForUnnamedObject) NameCallback
EnsureGCInfoIndexPolymorphic(registered_index, TraceTrait< T >::Trace, FinalizerTrait< T >::kCallback)) DISPATCH(true
void(*)(Visitor *visitor, const void *object) TraceCallback
static V8_INLINE void EnsureIndex(std::atomic< GCInfoIndex > ®istered_index)
static constexpr bool kHasCustomFinalizerDispatchAtBase
static constexpr bool kHasVirtualDestructorAtBase
static constexpr bool kWantsDetailedObjectNames
std::conditional_t<(kHasVirtualDestructorAtBase||kBothTypesAreTriviallyDestructible||kHasCustomFinalizerDispatchAtBase) &&!kWantsDetailedObjectNames, ParentMostGarbageCollectedType, T > ResultType
static constexpr bool kBothTypesAreTriviallyDestructible
static V8_INLINE GCInfoIndex Index()
#define V8_UNLIKELY(condition)