4#ifndef QV4WRITEBARRIER_P_H
5#define QV4WRITEBARRIER_P_H
18#include <private/qv4global_p.h>
19#include <private/qv4enginebase_p.h>
25typedef quint64 ReturnedValue;
31 Q_ALWAYS_INLINE static void write(EngineBase *engine, Heap::Base *base, ReturnedValue *slot, ReturnedValue value)
33 if (engine->isGCOngoing)
34 write_slowpath(engine, base, slot, value);
41 Q_ALWAYS_INLINE static void write(EngineBase *engine, Heap::Base *base, Heap::Base **slot, Heap::Base *value)
43 if (engine->isGCOngoing)
44 write_slowpath(engine, base, slot, value);
53 template<
typename F,
typename Engine = EngineBase>
54 static void markCustom(Engine *engine, F &&markFunction) {
55 if (engine->isGCOngoing)
56 (std::forward<F>(markFunction))(engine->memoryManager->markStack());
71 template<
typename HeapType>
74 HeapType *
get()
const {
return reinterpret_cast<HeapType *>(
wrapped); }
78 template <
typename ConvertibleToHeapType>
79 void set(
QV4::EngineBase *engine, ConvertibleToHeapType *heapObject)
81 WriteBarrier::markCustom(engine, [heapObject](QV4::MarkStack *ms){
91 template<
typename HeapType,
int PhantomTag>
95
96
97
98
Q_ALWAYS_INLINE void fence()
HeapType * operator->() const
void set(QV4::EngineBase *engine, ConvertibleToHeapType *heapObject)
operator HeapType *() const
static Q_ALWAYS_INLINE void write(EngineBase *engine, Heap::Base *base, Heap::Base **slot, Heap::Base *value)
static void markCustom(Engine *engine, F &&markFunction)
static constexpr bool isInsertionBarrier
static Q_ALWAYS_INLINE void write(EngineBase *engine, Heap::Base *base, ReturnedValue *slot, ReturnedValue value)