3#ifndef QV4WRITEBARRIER_P_H
4#define QV4WRITEBARRIER_P_H
17#include <private/qv4global_p.h>
18#include <private/qv4enginebase_p.h>
24typedef quint64 ReturnedValue;
30 Q_ALWAYS_INLINE static void write(EngineBase *engine, Heap::Base *base, ReturnedValue *slot, ReturnedValue value)
32 if (engine->isGCOngoing)
33 write_slowpath(engine, base, slot, value);
40 Q_ALWAYS_INLINE static void write(EngineBase *engine, Heap::Base *base, Heap::Base **slot, Heap::Base *value)
42 if (engine->isGCOngoing)
43 write_slowpath(engine, base, slot, value);
52 template<
typename F,
typename Engine = EngineBase>
53 static void markCustom(Engine *engine, F &&markFunction) {
54 if (engine->isGCOngoing)
55 (std::forward<F>(markFunction))(engine->memoryManager->markStack());
70 template<
typename HeapType>
73 HeapType *
get()
const {
return reinterpret_cast<HeapType *>(
wrapped); }
77 template <
typename ConvertibleToHeapType>
78 void set(
QV4::EngineBase *engine, ConvertibleToHeapType *heapObject)
80 WriteBarrier::markCustom(engine, [heapObject](QV4::MarkStack *ms){
90 template<
typename HeapType,
int PhantomTag>
94
95
96
97
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)