5#ifndef INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_
6#define INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_
22class PersistentRegion;
23class CrossThreadPersistentRegion;
28class UntracedMemberTag;
36 template <WriteBarrierSlotType SlotType>
38#ifdef CPPGC_SLIM_WRITE_BARRIER
40 WriteBarrier::CombinedWriteBarrierSlow<SlotType>(slot);
49 template <WriteBarrierSlotType SlotType>
53 "Assigning storages of Member and UncompressedMember is not supported");
54#ifdef CPPGC_SLIM_WRITE_BARRIER
56 WriteBarrier::CombinedWriteBarrierSlow<SlotType>(slot);
65#if defined(CPPGC_POINTER_COMPRESSION)
66 template <WriteBarrierSlotType SlotType>
68 CompressedPointer storage) {
71 "Assigning storages of Member and UncompressedMember is not supported");
72#ifdef CPPGC_SLIM_WRITE_BARRIER
74 WriteBarrier::CombinedWriteBarrierSlow<SlotType>(slot);
86 const WriteBarrier::Params& params,
87 const void* slot,
const void* value) {
104 template <WriteBarrierSlotType>
106 template <WriteBarrierSlotType,
typename MemberStorage>
113 bool check_off_heap_assignments);
115 const HeapBase* heap_ =
nullptr;
118template <
bool kCheckOffHeapAssignments>
122 template <
typename T>
126 CheckPointersImplTrampoline<T>::Call(
this, ptr);
130 template <
typename T,
bool = IsCompleteV<T>>
131 struct CheckPointersImplTrampoline {
133 policy->CheckPointerImpl(ptr,
false, kCheckOffHeapAssignments);
137 template <
typename T>
138 struct CheckPointersImplTrampoline<T, true> {
139 static void Call(SameThreadEnabledCheckingPolicy* policy,
const T* ptr) {
140 policy->CheckPointerImpl(ptr, IsGarbageCollectedTypeV<T>,
141 kCheckOffHeapAssignments);
155 SameThreadEnabledCheckingPolicy<
false >;
157 SameThreadEnabledCheckingPolicy<
true >;
174 : location_(location) {}
197#if CPPGC_SUPPORTS_OBJECT_NAMES
226template <
typename T,
typename WeaknessPolicy,
230template <
typename T,
typename WeaknessPolicy,
234template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
V8_INLINE void CheckPointer(const void *)
constexpr SourceLocation Location() const
constexpr IgnoreLocationPolicy(const SourceLocation &)
constexpr IgnoreLocationPolicy()=default
KeepLocationPolicy & operator=(const KeepLocationPolicy &)=delete
KeepLocationPolicy(KeepLocationPolicy &&)=default
KeepLocationPolicy & operator=(KeepLocationPolicy &&)=default
constexpr KeepLocationPolicy(const SourceLocation &location)
constexpr const SourceLocation & Location() const
KeepLocationPolicy(const KeepLocationPolicy &)=delete
constexpr KeepLocationPolicy()=default
V8_INLINE const void * Load() const
void CheckPointerImpl(const void *ptr, bool points_to_payload, bool check_off_heap_assignments)
void CheckPointer(const T *ptr)
static V8_INLINE void GenerationalBarrier(const Params ¶ms, const void *slot)
static V8_INLINE void DijkstraMarkingBarrier(const Params ¶ms, const void *object)
static V8_INLINE Type GetWriteBarrierType(const void *slot, const void *value, Params ¶ms)
IgnoreLocationPolicy DefaultLocationPolicy
DisabledCheckingPolicy DefaultPersistentCheckingPolicy
DisabledCheckingPolicy DefaultMemberCheckingPolicy
constexpr internal::SentinelPointer kSentinelPointer
static V8_INLINE void AssigningBarrier(const void *slot, const void *value)
static V8_INLINE void AssigningBarrier(const void *slot, RawPointer storage)
static V8_INLINE void InitializingBarrier(const void *, const void *)
static V8_INLINE void AssigningBarrier(const void *, const void *)
static V8_INLINE void AssigningBarrier(const void *, MemberStorage)
static V8_INLINE void InitializingBarrier(const void *, const void *)
std::true_type IsStrongPersistent
static V8_EXPORT CrossThreadPersistentRegion & GetPersistentRegion(const void *object)
std::true_type IsStrongPersistent
static V8_EXPORT PersistentRegion & GetPersistentRegion(const void *object)
static V8_EXPORT CrossThreadPersistentRegion & GetPersistentRegion(const void *object)
std::false_type IsStrongPersistent
static V8_EXPORT PersistentRegion & GetPersistentRegion(const void *object)
std::false_type IsStrongPersistent
#define V8_UNLIKELY(condition)