17#include <private/qv4global_p.h>
18#include <private/qv4runtimeapi_p.h>
19#include <QtCore/qalgorithms.h>
20#include <QtCore/qmath.h>
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
67#if QT_POINTER_SIZE == 8
156 bool sweep(ExecutionEngine *engine);
157 void freeAll(ExecutionEngine *engine);
173 T *
as() {
return static_cast<
T *>(
reinterpret_cast<
Heap::
Base *>(
this)); }
217 return reinterpret_cast<
HeapItem *>(
this);
250 qFatal(
"GC mark stack overrun. Either simplify your application or"
251 "increase QV4_GC_MAX_STACK_SIZE");
284#define HEAP_OBJECT_OFFSET_MEMBER_EXPANSION(c, gcType, type, name)
285 HEAP_OBJECT_OFFSET_MEMBER_EXPANSION_##gcType(c, type, name)
287#define HEAP_OBJECT_OFFSET_MEMBER_EXPANSION_Pointer(c, type, name) Pointer<type, 0
> name;
288#define HEAP_OBJECT_OFFSET_MEMBER_EXPANSION_NoMark(c, type, name) type name;
289#define HEAP_OBJECT_OFFSET_MEMBER_EXPANSION_HeapValue(c, type, name) HeapValue<0
> name;
290#define HEAP_OBJECT_OFFSET_MEMBER_EXPANSION_ValueArray(c, type, name) type<0
> name;
292#define HEAP_OBJECT_MEMBER_EXPANSION(c, gcType, type, name)
293 HEAP_OBJECT_MEMBER_EXPANSION_##gcType(c, type, name)
295#define HEAP_OBJECT_MEMBER_EXPANSION_Pointer(c, type, name)
296 Pointer<type, offsetof(c##OffsetStruct, name) + baseOffset> name;
297#define HEAP_OBJECT_MEMBER_EXPANSION_NoMark(c, type, name)
299#define HEAP_OBJECT_MEMBER_EXPANSION_HeapValue(c, type, name)
300 HeapValue<offsetof(c##OffsetStruct, name) + baseOffset> name;
301#define HEAP_OBJECT_MEMBER_EXPANSION_ValueArray(c, type, name)
302 type<offsetof(c##OffsetStruct, name) + baseOffset> name;
304#define HEAP_OBJECT_MARKOBJECTS_EXPANSION(c, gcType, type, name)
305 HEAP_OBJECT_MARKOBJECTS_EXPANSION_##gcType(c, type, name)
306#define HEAP_OBJECT_MARKOBJECTS_EXPANSION_Pointer(c, type, name)
307 if (o->name) o->name.heapObject()->mark(stack);
308#define HEAP_OBJECT_MARKOBJECTS_EXPANSION_NoMark(c, type, name)
309#define HEAP_OBJECT_MARKOBJECTS_EXPANSION_HeapValue(c, type, name)
311#define HEAP_OBJECT_MARKOBJECTS_EXPANSION_ValueArray(c, type, name)
315#define DECLARE_HEAP_OBJECT_BASE(name, base)
316 struct name##OffsetStruct {
319 struct name##SizeStruct : base, name##OffsetStruct {};
321 typedef base SuperClass;
322 static constexpr size_t baseOffset = sizeof(name##SizeStruct) - sizeof(name##OffsetStruct);
325 Q_STATIC_ASSERT(sizeof(name##SizeStruct) == sizeof(name##Data) + name##Data::baseOffset);
327#define DECLARE_HEAP_OBJECT(name, base)
329 struct name : base, name##Data
330#define DECLARE_EXPORTED_HEAP_OBJECT(name, base)
332 struct Q_QML_EXPORT name : base, name##Data
334#define DECLARE_MARKOBJECTS(class)
335 static void markObjects(Heap::Base *b, MarkStack *stack) {
336 class *o = static_cast<class *>(b);
337 class##Data::SuperClass::markObjects(o, stack);
void(* ClassDestroyStatsCallback)(const char *)
Q_STATIC_ASSERT(sizeof(CppStackFrame)==sizeof(JSTypesStackFrame))
#define HEAP_OBJECT_MARKOBJECTS_EXPANSION(c, gcType, type, name)
#define HEAP_OBJECT_OFFSET_MEMBER_EXPANSION(c, gcType, type, name)
#define HEAP_OBJECT_MEMBER_EXPANSION(c, gcType, type, name)
#define DECLARE_HEAP_OBJECT_BASE(name, base)
quintptr objectBitmap[BitmapSize/sizeof(quintptr)]
char data[ChunkSize - HeaderSize]
bool sweep(ExecutionEngine *engine)
void freeAll(ExecutionEngine *engine)
quintptr extendsBitmap[BitmapSize/sizeof(quintptr)]
void sortIntoBins(HeapItem **bins, uint nBins)
quintptr blackBitmap[BitmapSize/sizeof(quintptr)]
quint64 payload[Chunk::SlotSize/sizeof(quint64)]