5#ifndef INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_
6#define INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_
22class PersistentRegion;
23class CrossThreadPersistentRegion;
28class UntracedMemberTag;
36#if defined(CPPGC_POINTER_COMPRESSION)
38 CompressedPointer storage) {}
41 template <WriteBarrierSlotType SlotType>
44#ifdef CPPGC_SLIM_WRITE_BARRIER
46 WriteBarrier::CombinedWriteBarrierSlow<SlotType>(slot);
55 template <WriteBarrierSlotType SlotType>
59 "Assigning storages of Member and UncompressedMember is not supported");
60#ifdef CPPGC_SLIM_WRITE_BARRIER
62 WriteBarrier::CombinedWriteBarrierSlow<SlotType>(slot);
71#if defined(CPPGC_POINTER_COMPRESSION)
72 template <WriteBarrierSlotType SlotType>
74 CompressedPointer storage) {
77 "Assigning storages of Member and UncompressedMember is not supported");
78#ifdef CPPGC_SLIM_WRITE_BARRIER
80 WriteBarrier::CombinedWriteBarrierSlow<SlotType>(slot);
93 const void* slot,
const void* value) {
111#if defined(CPPGC_POINTER_COMPRESSION)
113 CompressedPointer storage) {}
115 template <WriteBarrierSlotType>
117 template <WriteBarrierSlotType,
typename MemberStorage>
123 void CheckPointerImpl(
const void* ptr,
bool points_to_payload,
124 bool check_off_heap_assignments);
129template <
bool kCheckOffHeapAssignments>
133 template <
typename T>
139 this,
static_cast<const T*
>(raw_pointer.
Load()));
141#if defined(CPPGC_POINTER_COMPRESSION)
142 template <
typename T>
143 V8_INLINE void CheckPointer(CompressedPointer compressed_pointer) {
144 if (compressed_pointer.IsCleared() || compressed_pointer.IsSentinel()) {
147 CheckPointersImplTrampoline<T>::Call(
148 this,
static_cast<const T*
>(compressed_pointer.Load()));
151 template <
typename T>
160 template <
typename T,
bool = IsCompleteV<T>>
167 template <
typename T>
171 kCheckOffHeapAssignments);
178 template <
typename T>
180 template <
typename T>
182#if defined(CPPGC_POINTER_COMPRESSION)
183 template <
typename T>
188#ifdef CPPGC_ENABLE_SLOW_API_CHECKS
192 SameThreadEnabledCheckingPolicy<
false >;
194 SameThreadEnabledCheckingPolicy<
true >;
234#if CPPGC_SUPPORTS_OBJECT_NAMES
263template <
typename T,
typename WeaknessPolicy,
267template <
typename T,
typename WeaknessPolicy,
271template <
typename T,
typename WeaknessTag,
typename WriteBarrierPolicy,
V8_INLINE void CheckPointer(RawPointer)
V8_INLINE void CheckPointer(T *)
constexpr IgnoreLocationPolicy(const SourceLocation &)
constexpr IgnoreLocationPolicy()=default
constexpr SourceLocation Location() const
constexpr KeepLocationPolicy()=default
constexpr const SourceLocation & Location() const
KeepLocationPolicy & operator=(KeepLocationPolicy &&)=default
KeepLocationPolicy(KeepLocationPolicy &&)=default
constexpr KeepLocationPolicy(const SourceLocation &location)
KeepLocationPolicy & operator=(const KeepLocationPolicy &)=delete
KeepLocationPolicy(const KeepLocationPolicy &)=delete
V8_INLINE const void * Load() const
V8_INLINE bool IsCleared() const
V8_INLINE bool IsSentinel() const
void CheckPointerImpl(const void *ptr, bool points_to_payload, bool check_off_heap_assignments)
V8_INLINE void CheckPointer(RawPointer raw_pointer)
void CheckPointer(const T *ptr)
static V8_INLINE Type GetWriteBarrierType(const void *slot, const void *value, Params ¶ms)
static V8_INLINE void GenerationalBarrier(const Params ¶ms, const void *slot)
static V8_INLINE void DijkstraMarkingBarrier(const Params ¶ms, const void *object)
IgnoreLocationPolicy DefaultLocationPolicy
DisabledCheckingPolicy DefaultMemberCheckingPolicy
DisabledCheckingPolicy DefaultPersistentCheckingPolicy
constexpr internal::SentinelPointer kSentinelPointer
static V8_INLINE void InitializingBarrier(const void *, const void *)
static V8_INLINE void WriteBarrier(WriteBarrier::Type type, const WriteBarrier::Params ¶ms, const void *slot, const void *value)
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 *, 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 *, RawPointer storage)
static void Call(SameThreadEnabledCheckingPolicy *policy, const T *ptr)
static void Call(SameThreadEnabledCheckingPolicy *policy, const T *ptr)
static V8_EXPORT CrossThreadPersistentRegion & GetPersistentRegion(const void *object)
std::true_type IsStrongPersistent
std::true_type IsStrongPersistent
static V8_EXPORT PersistentRegion & GetPersistentRegion(const void *object)
static V8_EXPORT CrossThreadPersistentRegion & GetPersistentRegion(const void *object)
std::false_type IsStrongPersistent
std::false_type IsStrongPersistent
static V8_EXPORT PersistentRegion & GetPersistentRegion(const void *object)
#define V8_UNLIKELY(condition)