OpenCoverage

qv4mm_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/memory/qv4mm_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10namespace QV4 {-
11-
12struct ChunkAllocator;-
13struct MemorySegment;-
14-
15struct BlockAllocator {-
16 BlockAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)-
17 : chunkAllocator(chunkAllocator), engine(engine)-
18 {-
19 memset(freeBins, 0, sizeof(freeBins));-
20 }
executed 198486 times by 154 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
198486
21-
22 enum { NumBins = 8 };-
23-
24 static inline size_t binForSlots(size_t nSlots) {-
25 return
executed 338636 times by 18 tests: return nSlots >= NumBins ? NumBins - 1 : nSlots;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickgridview
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickvisualdatamodel
  • tst_quicktestmainwithsetup
  • tst_qv4mm
  • tst_scenegraph
  • tst_testfiltering
nSlots >= NumBins ? NumBins - 1 : nSlots;
executed 338636 times by 18 tests: return nSlots >= NumBins ? NumBins - 1 : nSlots;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qqmlecmascript
  • tst_qqmlnotifier
  • tst_qqmlqt
  • tst_qquickanimationcontroller
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickgridview
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickvisualdatamodel
  • tst_quicktestmainwithsetup
  • tst_qv4mm
  • tst_scenegraph
  • tst_testfiltering
338636
26 }-
27-
28 HeapItem *allocate(size_t size, bool forceAllocation = false);-
29-
30 size_t totalSlots() const {-
31 return
executed 295129 times by 154 tests: return Chunk::AvailableSlots*chunks.size();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
Chunk::AvailableSlots*chunks.size();
executed 295129 times by 154 tests: return Chunk::AvailableSlots*chunks.size();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
295129
32 }-
33-
34 size_t allocatedMem() const {-
35 return
executed 22 times by 2 tests: return chunks.size()*Chunk::DataSize;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
chunks.size()*Chunk::DataSize;
executed 22 times by 2 tests: return chunks.size()*Chunk::DataSize;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
22
36 }-
37 size_t usedMem() const {-
38 uint used = 0;-
39 for (auto c : chunks)-
40 used += c->nUsedSlots()*Chunk::SlotSize;
executed 70 times by 2 tests: used += c->nUsedSlots()*Chunk::SlotSize;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
70
41 return
executed 28 times by 2 tests: return used;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
used;
executed 28 times by 2 tests: return used;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
28
42 }-
43-
44 void sweep();-
45 void freeAll();-
46 void resetBlackBits();-
47 void collectGrayItems(MarkStack *markStack);-
48-
49-
50 HeapItem *nextFree = nullptr;-
51 size_t nFree = 0;-
52 size_t usedSlotsAfterLastSweep = 0;-
53 HeapItem *freeBins[NumBins];-
54 ChunkAllocator *chunkAllocator;-
55 ExecutionEngine *engine;-
56 std::vector<Chunk *> chunks;-
57 uint *allocationStats = nullptr;-
58};-
59-
60struct HugeItemAllocator {-
61 HugeItemAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)-
62 : chunkAllocator(chunkAllocator), engine(engine)-
63 {}
executed 99244 times by 154 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
99244
64-
65 HeapItem *allocate(size_t size);-
66 void sweep(ClassDestroyStatsCallback classCountPtr);-
67 void freeAll();-
68 void resetBlackBits();-
69 void collectGrayItems(MarkStack *markStack);-
70-
71 size_t usedMem() const {-
72 size_t used = 0;-
73 for (const auto &c : chunks)-
74 used += c.size;
never executed: used += c.size;
0
75 return
executed 30 times by 2 tests: return used;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
used;
executed 30 times by 2 tests: return used;
Executed by:
  • tst_qqmlprofilerservice
  • tst_qv4mm
30
76 }-
77-
78 ChunkAllocator *chunkAllocator;-
79 ExecutionEngine *engine;-
80 struct HugeChunk {-
81 MemorySegment *segment;-
82 Chunk *chunk;-
83 size_t size;-
84 };-
85-
86 std::vector<HugeChunk> chunks;-
87};-
88-
89-
90class __attribute__((visibility("default"))) MemoryManager-
91{-
92 MemoryManager(const MemoryManager &) = delete; MemoryManager &operator=(const MemoryManager &) = delete;;-
93-
94public:-
95 MemoryManager(ExecutionEngine *engine);-
96 ~MemoryManager();-
97-
98-
99-
100 constexpr static inline std::size_t align(std::size_t size)-
101 { return (size + Chunk::SlotSize - 1) & ~(Chunk::SlotSize - 1); }-
102-
103 template<typename ManagedType>-
104 inline typename ManagedType::Data *allocManaged(std::size_t size, Heap::InternalClass *ic)-
105 {-
106 static_assert(bool(std::is_trivial< typename ManagedType::Data >::value), "std::is_trivial< typename ManagedType::Data >::value");-
107 size = align(size);-
108 typename ManagedType::Data *d = static_cast<typename ManagedType::Data *>(allocData(size));-
109 d->internalClass.set(engine, ic);-
110 ((d->internalClass && d->internalClass->vtable) ? static_cast<void>(0) : qt_assert("d->internalClass && d->internalClass->vtable", __FILE__, 169));-
111 ((ic->vtable == ManagedType::staticVTable()) ? static_cast<void>(0) : qt_assert("ic->vtable == ManagedType::staticVTable()", __FILE__, 170));-
112 return
executed 114353539 times by 154 tests: return d;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
d;
executed 114353539 times by 154 tests: return d;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
114353539
113 }-
114-
115 template<typename ManagedType>-
116 inline typename ManagedType::Data *allocManaged(std::size_t size, InternalClass *ic)-
117 {-
118 return
executed 109486049 times by 154 tests: return allocManaged<ManagedType>(size, ic->d());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
allocManaged<ManagedType>(size, ic->d());
executed 109486049 times by 154 tests: return allocManaged<ManagedType>(size, ic->d());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
109486049
119 }-
120-
121 template<typename ManagedType>-
122 inline typename ManagedType::Data *allocManaged(std::size_t size)-
123 {-
124 Scope scope(engine);-
125 Scoped<InternalClass> ic(scope, ManagedType::defaultInternalClass(engine));-
126 return
executed 109641468 times by 154 tests: return allocManaged<ManagedType>(size, ic);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
allocManaged<ManagedType>(size, ic);
executed 109641468 times by 154 tests: return allocManaged<ManagedType>(size, ic);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
109641468
127 }-
128-
129 template <typename ObjectType>-
130 typename ObjectType::Data *allocateObject(Heap::InternalClass *ic)-
131 {-
132 Heap::Object *o = allocObjectWithMemberData(ObjectType::staticVTable(), ic->size);-
133 o->internalClass.set(engine, ic);-
134 ((o->internalClass.get() && o->vtable()) ? static_cast<void>(0) : qt_assert("o->internalClass.get() && o->vtable()", __FILE__, 193));-
135 ((o->vtable() == ObjectType::staticVTable()) ? static_cast<void>(0) : qt_assert("o->vtable() == ObjectType::staticVTable()", __FILE__, 194));-
136 return
executed 53984069 times by 154 tests: return static_cast<typename ObjectType::Data *>(o);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
static_cast<typename ObjectType::Data *>(o);
executed 53984069 times by 154 tests: return static_cast<typename ObjectType::Data *>(o);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
53984069
137 }-
138-
139 template <typename ObjectType>-
140 typename ObjectType::Data *allocateObject(InternalClass *ic)-
141 {-
142 return
executed 45959685 times by 154 tests: return allocateObject<ObjectType>(ic->d());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
allocateObject<ObjectType>(ic->d());
executed 45959685 times by 154 tests: return allocateObject<ObjectType>(ic->d());
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
45959685
143 }-
144-
145 template <typename ObjectType>-
146 typename ObjectType::Data *allocateObject()-
147 {-
148 Scope scope(engine);-
149 Scoped<InternalClass> ic(scope, ObjectType::defaultInternalClass(engine));-
150 ic = ic->changeVTable(ObjectType::staticVTable());-
151 ic = ic->changePrototype(ObjectType::defaultPrototype(engine)->d());-
152 return
executed 45918127 times by 154 tests: return allocateObject<ObjectType>(ic);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
allocateObject<ObjectType>(ic);
executed 45918127 times by 154 tests: return allocateObject<ObjectType>(ic);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
45918127
153 }-
154-
155 template <typename ManagedType, typename Arg1>-
156 typename ManagedType::Data *allocWithStringData(std::size_t unmanagedSize, Arg1 arg1)-
157 {-
158 typename ManagedType::Data *o = reinterpret_cast<typename ManagedType::Data *>(allocString(unmanagedSize));-
159 o->internalClass.set(engine, ManagedType::defaultInternalClass(engine));-
160 ((o->internalClass && o->internalClass->vtable) ? static_cast<void>(0) : qt_assert("o->internalClass && o->internalClass->vtable", __FILE__, 219));-
161 o->init(arg1);-
162 return
executed 136169219 times by 154 tests: return o;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
o;
executed 136169219 times by 154 tests: return o;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
136169219
163 }-
164-
165 template <typename ObjectType, typename... Args>-
166 typename ObjectType::Data *allocObject(Heap::InternalClass *ic, Args... args)-
167 {-
168 typename ObjectType::Data *d = allocateObject<ObjectType>(ic);-
169 d->init(args...);-
170 return
executed 7987204 times by 154 tests: return d;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
d;
executed 7987204 times by 154 tests: return d;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
7987204
171 }-
172-
173 template <typename ObjectType, typename... Args>-
174 typename ObjectType::Data *allocObject(InternalClass *ic, Args... args)-
175 {-
176 typename ObjectType::Data *d = allocateObject<ObjectType>(ic);-
177 d->init(args...);-
178 return
executed 14647 times by 3 tests: return d;
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
d;
executed 14647 times by 3 tests: return d;
Executed by:
  • tst_ecmascripttests
  • tst_qjsvalue
  • tst_qqmlecmascript
14647
179 }-
180-
181 template <typename ObjectType, typename... Args>-
182 typename ObjectType::Data *allocate(Args... args)-
183 {-
184 Scope scope(engine);-
185 Scoped<ObjectType> t(scope, allocateObject<ObjectType>());-
186 t->d_unchecked()->init(args...);-
187 return
executed 45977232 times by 154 tests: return t->d();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
t->d();
executed 45977232 times by 154 tests: return t->d();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
45977232
188 }-
189-
190 template <typename ManagedType, typename... Args>-
191 typename ManagedType::Data *alloc(Args... args)-
192 {-
193 Scope scope(engine);-
194 Scoped<ManagedType> t(scope, allocManaged<ManagedType>(sizeof(typename ManagedType::Data)));-
195 t->d_unchecked()->init(args...);-
196 return
executed 60779258 times by 154 tests: return t->d();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
t->d();
executed 60779258 times by 154 tests: return t->d();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
60779258
197 }-
198-
199 void runGC();-
200-
201 void dumpStats() const;-
202-
203 size_t getUsedMem() const;-
204 size_t getAllocatedMem() const;-
205 size_t getLargeItemsMem() const;-
206-
207-
208 void changeUnmanagedHeapSizeUsage(qptrdiff delta) { unmanagedHeapSize += delta; }
executed 170433955 times by 154 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
170433955
209-
210 template<typename ManagedType>-
211 typename ManagedType::Data *allocIC()-
212 {-
213 size_t size = align(sizeof(typename ManagedType::Data));-
214 Heap::Base *b = *icAllocator.allocate(size, true);-
215 return
executed 72406692 times by 154 tests: return static_cast<typename ManagedType::Data *>(b);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
static_cast<typename ManagedType::Data *>(b);
executed 72406692 times by 154 tests: return static_cast<typename ManagedType::Data *>(b);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • ...
72406692
216 }-
217-
218protected:-
219-
220 Heap::Base *allocString(std::size_t unmanagedSize);-
221 Heap::Base *allocData(std::size_t size);-
222 Heap::Object *allocObjectWithMemberData(const QV4::VTable *vtable, uint nMembers);-
223-
224private:-
225 void collectFromJSStack(MarkStack *markStack) const;-
226 void mark();-
227 void sweep(bool lastSweep = false, ClassDestroyStatsCallback classCountPtr = nullptr);-
228 bool shouldRunGC() const;-
229 void collectRoots(MarkStack *markStack);-
230-
231public:-
232 QV4::ExecutionEngine *engine;-
233 ChunkAllocator *chunkAllocator;-
234 BlockAllocator blockAllocator;-
235 BlockAllocator icAllocator;-
236 HugeItemAllocator hugeItemAllocator;-
237 PersistentValueStorage *m_persistentValues;-
238 PersistentValueStorage *m_weakValues;-
239 QVector<Value *> m_pendingFreedObjectWrapperValue;-
240-
241 std::size_t unmanagedHeapSize = 0;-
242 std::size_t unmanagedHeapSizeGCLimit;-
243 std::size_t usedSlotsAfterLastFullSweep = 0;-
244-
245 bool gcBlocked = false;-
246 bool aggressiveGC = false;-
247 bool gcStats = false;-
248 bool gcCollectorStats = false;-
249-
250 int allocationCount = 0;-
251 size_t lastAllocRequestedSlots = 0;-
252-
253 struct {-
254 size_t maxReservedMem = 0;-
255 size_t maxAllocatedMem = 0;-
256 size_t maxUsedMem = 0;-
257 uint allocations[BlockAllocator::NumBins];-
258 } statistics;-
259};-
260-
261}-
262-
263-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0