Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/debugger/qqmlprofiler_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | - | |||||||||||||||||||
6 | struct __attribute__((visibility("default"))) QQmlProfilerData : public QQmlProfilerDefinitions | - | ||||||||||||||||||
7 | { | - | ||||||||||||||||||
8 | QQmlProfilerData(qint64 time = -1, int messageType = -1, | - | ||||||||||||||||||
9 | RangeType detailType = MaximumRangeType, quintptr locationId = 0) : | - | ||||||||||||||||||
10 | time(time), locationId(locationId), messageType(messageType), detailType(detailType) | - | ||||||||||||||||||
11 | {} executed 44 times by 1 test: end of block Executed by:
| 44 | ||||||||||||||||||
12 | - | |||||||||||||||||||
13 | qint64 time; | - | ||||||||||||||||||
14 | quintptr locationId; | - | ||||||||||||||||||
15 | - | |||||||||||||||||||
16 | int messageType; | - | ||||||||||||||||||
17 | RangeType detailType; | - | ||||||||||||||||||
18 | }; | - | ||||||||||||||||||
19 | - | |||||||||||||||||||
20 | template<> class QTypeInfo<QQmlProfilerData > { public: enum { isSpecialized = true, isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_MOVABLE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QQmlProfilerData)>sizeof(void*)), isPointer = false, isIntegral = std::is_integral< QQmlProfilerData >::value, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QQmlProfilerData) }; static inline const char *name() { return "QQmlProfilerData"; } }; | - | ||||||||||||||||||
21 | - | |||||||||||||||||||
22 | class __attribute__((visibility("default"))) QQmlProfiler : public QObject, public QQmlProfilerDefinitions { | - | ||||||||||||||||||
23 | public: | - | ||||||||||||||||||
24 | #pragma GCC diagnostic push | - | ||||||||||||||||||
25 | - | |||||||||||||||||||
26 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||||||||||||||
27 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - | ||||||||||||||||||
28 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||||||||||||||
29 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||||||||
30 | #pragma GCC diagnostic pop | - | ||||||||||||||||||
31 | struct QPrivateSignal {}; | - | ||||||||||||||||||
32 | public: | - | ||||||||||||||||||
33 | - | |||||||||||||||||||
34 | struct Location { | - | ||||||||||||||||||
35 | Location(const QQmlSourceLocation &location = QQmlSourceLocation(), | - | ||||||||||||||||||
36 | const QUrl &url = QUrl()) : | - | ||||||||||||||||||
37 | location(location), url(url) {} executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||||||||||||||
38 | QQmlSourceLocation location; | - | ||||||||||||||||||
39 | QUrl url; | - | ||||||||||||||||||
40 | }; | - | ||||||||||||||||||
41 | - | |||||||||||||||||||
42 | - | |||||||||||||||||||
43 | - | |||||||||||||||||||
44 | struct RefLocation : public Location { | - | ||||||||||||||||||
45 | RefLocation() | - | ||||||||||||||||||
46 | : Location(), locationType(MaximumRangeType), something(nullptr), sent(false) | - | ||||||||||||||||||
47 | { | - | ||||||||||||||||||
48 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||
49 | - | |||||||||||||||||||
50 | RefLocation(QV4::Function *ref) | - | ||||||||||||||||||
51 | : Location(ref->sourceLocation()), locationType(Binding), sent(false) | - | ||||||||||||||||||
52 | { | - | ||||||||||||||||||
53 | function = ref; | - | ||||||||||||||||||
54 | function->compilationUnit->addref(); | - | ||||||||||||||||||
55 | } never executed: end of block | 0 | ||||||||||||||||||
56 | - | |||||||||||||||||||
57 | RefLocation(QV4::CompiledData::CompilationUnit *ref, const QUrl &url, const QV4::CompiledData::Object *obj, const QString &type) | - | ||||||||||||||||||
58 | : Location(QQmlSourceLocation(type, obj->location.line, obj->location.column), url), | - | ||||||||||||||||||
59 | locationType(Creating), sent(false) | - | ||||||||||||||||||
60 | { | - | ||||||||||||||||||
61 | unit = ref; | - | ||||||||||||||||||
62 | unit->addref(); | - | ||||||||||||||||||
63 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||
64 | - | |||||||||||||||||||
65 | RefLocation(QQmlBoundSignalExpression *ref) | - | ||||||||||||||||||
66 | : Location(ref->sourceLocation()), locationType(HandlingSignal), sent(false) | - | ||||||||||||||||||
67 | { | - | ||||||||||||||||||
68 | boundSignal = ref; | - | ||||||||||||||||||
69 | boundSignal->addref(); | - | ||||||||||||||||||
70 | } never executed: end of block | 0 | ||||||||||||||||||
71 | - | |||||||||||||||||||
72 | RefLocation(QQmlDataBlob *ref) | - | ||||||||||||||||||
73 | : Location(QQmlSourceLocation(), ref->url()), locationType(Compiling), sent(false) | - | ||||||||||||||||||
74 | { | - | ||||||||||||||||||
75 | blob = ref; | - | ||||||||||||||||||
76 | blob->addref(); | - | ||||||||||||||||||
77 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||||||||||||||
78 | - | |||||||||||||||||||
79 | RefLocation(const RefLocation &other) | - | ||||||||||||||||||
80 | : Location(other), | - | ||||||||||||||||||
81 | locationType(other.locationType), | - | ||||||||||||||||||
82 | function(other.function), | - | ||||||||||||||||||
83 | sent(other.sent) | - | ||||||||||||||||||
84 | { | - | ||||||||||||||||||
85 | addref(); | - | ||||||||||||||||||
86 | } executed 16 times by 1 test: end of block Executed by:
| 16 | ||||||||||||||||||
87 | - | |||||||||||||||||||
88 | RefLocation &operator=(const RefLocation &other) | - | ||||||||||||||||||
89 | { | - | ||||||||||||||||||
90 | if (this != &other
| 0-14 | ||||||||||||||||||
91 | release(); | - | ||||||||||||||||||
92 | Location::operator=(other); | - | ||||||||||||||||||
93 | locationType = other.locationType; | - | ||||||||||||||||||
94 | function = other.function; | - | ||||||||||||||||||
95 | sent = other.sent; | - | ||||||||||||||||||
96 | addref(); | - | ||||||||||||||||||
97 | } executed 14 times by 1 test: end of block Executed by:
| 14 | ||||||||||||||||||
98 | return executed 14 times by 1 test: *this;return *this; Executed by:
executed 14 times by 1 test: return *this; Executed by:
| 14 | ||||||||||||||||||
99 | } | - | ||||||||||||||||||
100 | - | |||||||||||||||||||
101 | ~RefLocation() | - | ||||||||||||||||||
102 | { | - | ||||||||||||||||||
103 | release(); | - | ||||||||||||||||||
104 | } executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||||||||||||||
105 | - | |||||||||||||||||||
106 | void addref() | - | ||||||||||||||||||
107 | { | - | ||||||||||||||||||
108 | if (isNull()
| 14-16 | ||||||||||||||||||
109 | return; executed 16 times by 1 test: return; Executed by:
| 16 | ||||||||||||||||||
110 | - | |||||||||||||||||||
111 | switch (locationType) { | - | ||||||||||||||||||
112 | case never executed: Binding:case Binding: never executed: case Binding: | 0 | ||||||||||||||||||
113 | function->compilationUnit->addref(); | - | ||||||||||||||||||
114 | break; never executed: break; | 0 | ||||||||||||||||||
115 | case executed 8 times by 1 test: Creating:case Creating: Executed by:
executed 8 times by 1 test: case Creating: Executed by:
| 8 | ||||||||||||||||||
116 | unit->addref(); | - | ||||||||||||||||||
117 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||
118 | case never executed: HandlingSignal:case HandlingSignal: never executed: case HandlingSignal: | 0 | ||||||||||||||||||
119 | boundSignal->addref(); | - | ||||||||||||||||||
120 | break; never executed: break; | 0 | ||||||||||||||||||
121 | case executed 6 times by 1 test: Compiling:case Compiling: Executed by:
executed 6 times by 1 test: case Compiling: Executed by:
| 6 | ||||||||||||||||||
122 | blob->addref(); | - | ||||||||||||||||||
123 | break; executed 6 times by 1 test: break; Executed by:
| 6 | ||||||||||||||||||
124 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||
125 | ((locationType == MaximumRangeType) ? static_cast<void>(0) : qt_assert("locationType == MaximumRangeType", __FILE__, 245)); | - | ||||||||||||||||||
126 | break; never executed: break; | 0 | ||||||||||||||||||
127 | } | - | ||||||||||||||||||
128 | } | - | ||||||||||||||||||
129 | - | |||||||||||||||||||
130 | void release() | - | ||||||||||||||||||
131 | { | - | ||||||||||||||||||
132 | if (isNull()
| 14-30 | ||||||||||||||||||
133 | return; executed 30 times by 1 test: return; Executed by:
| 30 | ||||||||||||||||||
134 | - | |||||||||||||||||||
135 | switch (locationType) { | - | ||||||||||||||||||
136 | case never executed: Binding:case Binding: never executed: case Binding: | 0 | ||||||||||||||||||
137 | function->compilationUnit->release(); | - | ||||||||||||||||||
138 | break; never executed: break; | 0 | ||||||||||||||||||
139 | case executed 8 times by 1 test: Creating:case Creating: Executed by:
executed 8 times by 1 test: case Creating: Executed by:
| 8 | ||||||||||||||||||
140 | unit->release(); | - | ||||||||||||||||||
141 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||
142 | case never executed: HandlingSignal:case HandlingSignal: never executed: case HandlingSignal: | 0 | ||||||||||||||||||
143 | boundSignal->release(); | - | ||||||||||||||||||
144 | break; never executed: break; | 0 | ||||||||||||||||||
145 | case executed 6 times by 1 test: Compiling:case Compiling: Executed by:
executed 6 times by 1 test: case Compiling: Executed by:
| 6 | ||||||||||||||||||
146 | blob->release(); | - | ||||||||||||||||||
147 | break; executed 6 times by 1 test: break; Executed by:
| 6 | ||||||||||||||||||
148 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||
149 | ((locationType == MaximumRangeType) ? static_cast<void>(0) : qt_assert("locationType == MaximumRangeType", __FILE__, 269)); | - | ||||||||||||||||||
150 | break; never executed: break; | 0 | ||||||||||||||||||
151 | } | - | ||||||||||||||||||
152 | } | - | ||||||||||||||||||
153 | - | |||||||||||||||||||
154 | bool isValid() const | - | ||||||||||||||||||
155 | { | - | ||||||||||||||||||
156 | return executed 16 times by 1 test: locationType != MaximumRangeType;return locationType != MaximumRangeType; Executed by:
executed 16 times by 1 test: return locationType != MaximumRangeType; Executed by:
| 16 | ||||||||||||||||||
157 | } | - | ||||||||||||||||||
158 | - | |||||||||||||||||||
159 | bool isNull() const | - | ||||||||||||||||||
160 | { | - | ||||||||||||||||||
161 | return executed 74 times by 1 test: !something;return !something; Executed by:
executed 74 times by 1 test: return !something; Executed by:
| 74 | ||||||||||||||||||
162 | } | - | ||||||||||||||||||
163 | - | |||||||||||||||||||
164 | RangeType locationType; | - | ||||||||||||||||||
165 | union { | - | ||||||||||||||||||
166 | QV4::Function *function; | - | ||||||||||||||||||
167 | QV4::CompiledData::CompilationUnit *unit; | - | ||||||||||||||||||
168 | QQmlBoundSignalExpression *boundSignal; | - | ||||||||||||||||||
169 | QQmlDataBlob *blob; | - | ||||||||||||||||||
170 | void *something; | - | ||||||||||||||||||
171 | }; | - | ||||||||||||||||||
172 | bool sent; | - | ||||||||||||||||||
173 | }; | - | ||||||||||||||||||
174 | - | |||||||||||||||||||
175 | typedef QHash<quintptr, Location> LocationHash; | - | ||||||||||||||||||
176 | - | |||||||||||||||||||
177 | void startBinding(QV4::Function *function) | - | ||||||||||||||||||
178 | { | - | ||||||||||||||||||
179 | - | |||||||||||||||||||
180 | - | |||||||||||||||||||
181 | - | |||||||||||||||||||
182 | - | |||||||||||||||||||
183 | - | |||||||||||||||||||
184 | - | |||||||||||||||||||
185 | - | |||||||||||||||||||
186 | quintptr locationId = function
| 0-2 | ||||||||||||||||||
187 | m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), | - | ||||||||||||||||||
188 | (1 << RangeStart | 1 << RangeLocation), Binding, | - | ||||||||||||||||||
189 | locationId)); | - | ||||||||||||||||||
190 | - | |||||||||||||||||||
191 | RefLocation &location = m_locations[locationId]; | - | ||||||||||||||||||
192 | if (!location.isValid()
| 0-2 | ||||||||||||||||||
193 | if (function
| 0-2 | ||||||||||||||||||
194 | location = RefLocation(function); never executed: location = RefLocation(function); | 0 | ||||||||||||||||||
195 | else | - | ||||||||||||||||||
196 | location.locationType = Binding; executed 2 times by 1 test: location.locationType = Binding; Executed by:
| 2 | ||||||||||||||||||
197 | } | - | ||||||||||||||||||
198 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||
199 | - | |||||||||||||||||||
200 | - | |||||||||||||||||||
201 | - | |||||||||||||||||||
202 | void startCompiling(QQmlDataBlob *blob) | - | ||||||||||||||||||
203 | { | - | ||||||||||||||||||
204 | quintptr locationId(id(blob)); | - | ||||||||||||||||||
205 | m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), | - | ||||||||||||||||||
206 | (1 << RangeStart | 1 << RangeLocation | 1 << RangeData), | - | ||||||||||||||||||
207 | Compiling, locationId)); | - | ||||||||||||||||||
208 | - | |||||||||||||||||||
209 | RefLocation &location = m_locations[locationId]; | - | ||||||||||||||||||
210 | if (!location.isValid()
| 0-6 | ||||||||||||||||||
211 | location = RefLocation(blob); executed 6 times by 1 test: location = RefLocation(blob); Executed by:
| 6 | ||||||||||||||||||
212 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||||||||||||||
213 | - | |||||||||||||||||||
214 | void startHandlingSignal(QQmlBoundSignalExpression *expression) | - | ||||||||||||||||||
215 | { | - | ||||||||||||||||||
216 | - | |||||||||||||||||||
217 | - | |||||||||||||||||||
218 | - | |||||||||||||||||||
219 | - | |||||||||||||||||||
220 | - | |||||||||||||||||||
221 | quintptr locationId(id(expression->function()) + 2); | - | ||||||||||||||||||
222 | m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), | - | ||||||||||||||||||
223 | (1 << RangeStart | 1 << RangeLocation), HandlingSignal, | - | ||||||||||||||||||
224 | locationId)); | - | ||||||||||||||||||
225 | - | |||||||||||||||||||
226 | RefLocation &location = m_locations[locationId]; | - | ||||||||||||||||||
227 | if (!location.isValid()
| 0 | ||||||||||||||||||
228 | location = RefLocation(expression); never executed: location = RefLocation(expression); | 0 | ||||||||||||||||||
229 | } never executed: end of block | 0 | ||||||||||||||||||
230 | - | |||||||||||||||||||
231 | void startCreating(const QV4::CompiledData::Object *obj) | - | ||||||||||||||||||
232 | { | - | ||||||||||||||||||
233 | m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), | - | ||||||||||||||||||
234 | (1 << RangeStart | 1 << RangeLocation | 1 << RangeData), | - | ||||||||||||||||||
235 | Creating, id(obj))); | - | ||||||||||||||||||
236 | } executed 14 times by 1 test: end of block Executed by:
| 14 | ||||||||||||||||||
237 | - | |||||||||||||||||||
238 | void updateCreating(const QV4::CompiledData::Object *obj, | - | ||||||||||||||||||
239 | QV4::CompiledData::CompilationUnit *ref, | - | ||||||||||||||||||
240 | const QUrl &url, const QString &type) | - | ||||||||||||||||||
241 | { | - | ||||||||||||||||||
242 | quintptr locationId(id(obj)); | - | ||||||||||||||||||
243 | RefLocation &location = m_locations[locationId]; | - | ||||||||||||||||||
244 | if (!location.isValid()
| 0-8 | ||||||||||||||||||
245 | location = RefLocation(ref, url, obj, type); executed 8 times by 1 test: location = RefLocation(ref, url, obj, type); Executed by:
| 8 | ||||||||||||||||||
246 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||
247 | - | |||||||||||||||||||
248 | template<RangeType Range> | - | ||||||||||||||||||
249 | void endRange() | - | ||||||||||||||||||
250 | { | - | ||||||||||||||||||
251 | m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(), 1 << RangeEnd, Range)); | - | ||||||||||||||||||
252 | } executed 22 times by 1 test: end of block Executed by:
| 22 | ||||||||||||||||||
253 | - | |||||||||||||||||||
254 | QQmlProfiler(); | - | ||||||||||||||||||
255 | - | |||||||||||||||||||
256 | quint64 featuresEnabled; | - | ||||||||||||||||||
257 | - | |||||||||||||||||||
258 | template<typename Object> | - | ||||||||||||||||||
259 | static quintptr id(const Object *pointer) | - | ||||||||||||||||||
260 | { | - | ||||||||||||||||||
261 | return executed 30 times by 1 test: reinterpret_cast<quintptr>(pointer);return reinterpret_cast<quintptr>(pointer); Executed by:
executed 30 times by 1 test: return reinterpret_cast<quintptr>(pointer); Executed by:
| 30 | ||||||||||||||||||
262 | } | - | ||||||||||||||||||
263 | - | |||||||||||||||||||
264 | void startProfiling(quint64 features); | - | ||||||||||||||||||
265 | void stopProfiling(); | - | ||||||||||||||||||
266 | void reportData(); | - | ||||||||||||||||||
267 | void setTimer(const QElapsedTimer &timer) { m_timer = timer; } executed 64 times by 3 tests: end of block Executed by:
| 64 | ||||||||||||||||||
268 | - | |||||||||||||||||||
269 | public : | - | ||||||||||||||||||
270 | void dataReady(const QVector<QQmlProfilerData> &, const QQmlProfiler::LocationHash &); | - | ||||||||||||||||||
271 | - | |||||||||||||||||||
272 | protected: | - | ||||||||||||||||||
273 | QElapsedTimer m_timer; | - | ||||||||||||||||||
274 | QHash<quintptr, RefLocation> m_locations; | - | ||||||||||||||||||
275 | QVector<QQmlProfilerData> m_data; | - | ||||||||||||||||||
276 | }; | - | ||||||||||||||||||
277 | - | |||||||||||||||||||
278 | - | |||||||||||||||||||
279 | - | |||||||||||||||||||
280 | - | |||||||||||||||||||
281 | - | |||||||||||||||||||
282 | struct QQmlProfilerHelper : public QQmlProfilerDefinitions { | - | ||||||||||||||||||
283 | QQmlProfiler *profiler; | - | ||||||||||||||||||
284 | QQmlProfilerHelper(QQmlProfiler *profiler) : profiler(profiler) {} executed 946959 times by 141 tests: end of block Executed by:
| 946959 | ||||||||||||||||||
285 | }; | - | ||||||||||||||||||
286 | - | |||||||||||||||||||
287 | struct QQmlBindingProfiler : public QQmlProfilerHelper { | - | ||||||||||||||||||
288 | QQmlBindingProfiler(QQmlProfiler *profiler, QV4::Function *function) : | - | ||||||||||||||||||
289 | QQmlProfilerHelper(profiler) | - | ||||||||||||||||||
290 | { | - | ||||||||||||||||||
291 | if (profiler
executed 2 times by 1 test: else (end of block Executed by:
executed 891366 times by 120 tests: void)0(void)0 ; Executed by:
executed 891366 times by 120 tests: (void)0 ; Executed by:
| 0-891366 | ||||||||||||||||||
292 | ; executed 891366 times by 120 tests: (void)0 ; Executed by:
| 891366 | ||||||||||||||||||
293 | } | - | ||||||||||||||||||
294 | - | |||||||||||||||||||
295 | ~QQmlBindingProfiler() | - | ||||||||||||||||||
296 | { | - | ||||||||||||||||||
297 | if (profiler
executed 2 times by 1 test: else (end of block Executed by:
executed 891366 times by 120 tests: void)0(void)0 ; Executed by:
executed 891366 times by 120 tests: (void)0 ; Executed by:
| 0-891366 | ||||||||||||||||||
298 | ; executed 891366 times by 120 tests: (void)0 ; Executed by:
| 891366 | ||||||||||||||||||
299 | } | - | ||||||||||||||||||
300 | }; | - | ||||||||||||||||||
301 | - | |||||||||||||||||||
302 | struct QQmlHandlingSignalProfiler : public QQmlProfilerHelper { | - | ||||||||||||||||||
303 | QQmlHandlingSignalProfiler(QQmlProfiler *profiler, QQmlBoundSignalExpression *expression) : | - | ||||||||||||||||||
304 | QQmlProfilerHelper(profiler) | - | ||||||||||||||||||
305 | { | - | ||||||||||||||||||
306 | if (profiler
never executed: else (end of block never executed: void)0(void)0 ; never executed: (void)0 ; | 0 | ||||||||||||||||||
307 | ; never executed: (void)0 ; | 0 | ||||||||||||||||||
308 | } | - | ||||||||||||||||||
309 | - | |||||||||||||||||||
310 | ~QQmlHandlingSignalProfiler() | - | ||||||||||||||||||
311 | { | - | ||||||||||||||||||
312 | if (profiler
never executed: else (end of block never executed: void)0(void)0 ; never executed: (void)0 ; | 0 | ||||||||||||||||||
313 | ; never executed: (void)0 ; | 0 | ||||||||||||||||||
314 | } | - | ||||||||||||||||||
315 | }; | - | ||||||||||||||||||
316 | - | |||||||||||||||||||
317 | struct QQmlCompilingProfiler : public QQmlProfilerHelper { | - | ||||||||||||||||||
318 | QQmlCompilingProfiler(QQmlProfiler *profiler, QQmlDataBlob *blob) : | - | ||||||||||||||||||
319 | QQmlProfilerHelper(profiler) | - | ||||||||||||||||||
320 | { | - | ||||||||||||||||||
321 | if (profiler
executed 6 times by 1 test: else (end of block Executed by:
executed 55585 times by 140 tests: void)0;(void)0; Executed by:
executed 55585 times by 140 tests: (void)0; Executed by:
| 6-55585 | ||||||||||||||||||
322 | } | - | ||||||||||||||||||
323 | - | |||||||||||||||||||
324 | ~QQmlCompilingProfiler() | - | ||||||||||||||||||
325 | { | - | ||||||||||||||||||
326 | if (profiler
executed 6 times by 1 test: else (end of block Executed by:
executed 55585 times by 140 tests: void)0;(void)0; Executed by:
executed 55585 times by 140 tests: (void)0; Executed by:
| 6-55585 | ||||||||||||||||||
327 | } | - | ||||||||||||||||||
328 | }; | - | ||||||||||||||||||
329 | - | |||||||||||||||||||
330 | struct QQmlVmeProfiler : public QQmlProfilerDefinitions { | - | ||||||||||||||||||
331 | public: | - | ||||||||||||||||||
332 | - | |||||||||||||||||||
333 | QQmlVmeProfiler() : profiler(nullptr) {} executed 152912 times by 139 tests: end of block Executed by:
| 152912 | ||||||||||||||||||
334 | - | |||||||||||||||||||
335 | void init(QQmlProfiler *p, int maxDepth) | - | ||||||||||||||||||
336 | { | - | ||||||||||||||||||
337 | profiler = p; | - | ||||||||||||||||||
338 | ranges.allocate(maxDepth); | - | ||||||||||||||||||
339 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||||||||||||||
340 | - | |||||||||||||||||||
341 | const QV4::CompiledData::Object *pop() | - | ||||||||||||||||||
342 | { | - | ||||||||||||||||||
343 | if (ranges.count() > 0
| 0-6 | ||||||||||||||||||
344 | return executed 6 times by 1 test: ranges.pop();return ranges.pop(); Executed by:
executed 6 times by 1 test: return ranges.pop(); Executed by:
| 6 | ||||||||||||||||||
345 | else | - | ||||||||||||||||||
346 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||||||||||||||
347 | } | - | ||||||||||||||||||
348 | - | |||||||||||||||||||
349 | void push(const QV4::CompiledData::Object *object) | - | ||||||||||||||||||
350 | { | - | ||||||||||||||||||
351 | if (ranges.capacity() > ranges.count()
| 0-6 | ||||||||||||||||||
352 | ranges.push(object); executed 6 times by 1 test: ranges.push(object); Executed by:
| 6 | ||||||||||||||||||
353 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||||||||||||||
354 | - | |||||||||||||||||||
355 | QQmlProfiler *profiler; | - | ||||||||||||||||||
356 | - | |||||||||||||||||||
357 | private: | - | ||||||||||||||||||
358 | QFiniteStack<const QV4::CompiledData::Object *> ranges; | - | ||||||||||||||||||
359 | }; | - | ||||||||||||||||||
360 | - | |||||||||||||||||||
361 | class QQmlObjectCreationProfiler { | - | ||||||||||||||||||
362 | public: | - | ||||||||||||||||||
363 | - | |||||||||||||||||||
364 | QQmlObjectCreationProfiler(QQmlProfiler *profiler, const QV4::CompiledData::Object *obj) | - | ||||||||||||||||||
365 | : profiler(profiler) | - | ||||||||||||||||||
366 | { | - | ||||||||||||||||||
367 | if (profiler
executed 8 times by 1 test: else (end of block Executed by:
executed 521528 times by 138 tests: void)0;(void)0; Executed by:
executed 521528 times by 138 tests: (void)0; Executed by:
| 0-521528 | ||||||||||||||||||
368 | } | - | ||||||||||||||||||
369 | - | |||||||||||||||||||
370 | ~QQmlObjectCreationProfiler() | - | ||||||||||||||||||
371 | { | - | ||||||||||||||||||
372 | if (profiler
executed 8 times by 1 test: else (end of block Executed by:
executed 521528 times by 138 tests: void)0;(void)0; Executed by:
executed 521528 times by 138 tests: (void)0; Executed by:
| 0-521528 | ||||||||||||||||||
373 | } | - | ||||||||||||||||||
374 | - | |||||||||||||||||||
375 | void update(QV4::CompiledData::CompilationUnit *ref, const QV4::CompiledData::Object *obj, | - | ||||||||||||||||||
376 | const QString &typeName, const QUrl &url) | - | ||||||||||||||||||
377 | { | - | ||||||||||||||||||
378 | profiler->updateCreating(obj, ref, url, typeName); | - | ||||||||||||||||||
379 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||
380 | - | |||||||||||||||||||
381 | private: | - | ||||||||||||||||||
382 | QQmlProfiler *profiler; | - | ||||||||||||||||||
383 | }; | - | ||||||||||||||||||
384 | - | |||||||||||||||||||
385 | class QQmlObjectCompletionProfiler { | - | ||||||||||||||||||
386 | public: | - | ||||||||||||||||||
387 | QQmlObjectCompletionProfiler(QQmlVmeProfiler *parent) : | - | ||||||||||||||||||
388 | profiler(parent->profiler) | - | ||||||||||||||||||
389 | { | - | ||||||||||||||||||
390 | if (profiler
executed 6 times by 1 test: else (end of block Executed by:
executed 479706 times by 131 tests: void)0(void)0 ; Executed by:
executed 479706 times by 131 tests: (void)0 ; Executed by:
| 0-479706 | ||||||||||||||||||
391 | 479706 | |||||||||||||||||||
392 | ; executed 479706 times by 131 tests: (void)0 ; Executed by:
| 479706 | ||||||||||||||||||
393 | } | - | ||||||||||||||||||
394 | - | |||||||||||||||||||
395 | ~QQmlObjectCompletionProfiler() | - | ||||||||||||||||||
396 | { | - | ||||||||||||||||||
397 | if (profiler
executed 6 times by 1 test: else (end of block Executed by:
executed 479706 times by 131 tests: void)0(void)0 ; Executed by:
executed 479706 times by 131 tests: (void)0 ; Executed by:
| 0-479706 | ||||||||||||||||||
398 | ; executed 479706 times by 131 tests: (void)0 ; Executed by:
| 479706 | ||||||||||||||||||
399 | } | - | ||||||||||||||||||
400 | private: | - | ||||||||||||||||||
401 | QQmlProfiler *profiler; | - | ||||||||||||||||||
402 | }; | - | ||||||||||||||||||
403 | - | |||||||||||||||||||
404 | - | |||||||||||||||||||
405 | - | |||||||||||||||||||
406 | - | |||||||||||||||||||
407 | - | |||||||||||||||||||
408 | - | |||||||||||||||||||
409 | - | |||||||||||||||||||
410 | template <> struct QMetaTypeId< QVector<QQmlProfilerData> > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QVector<QQmlProfilerData> >("QVector<QQmlProfilerData>", reinterpret_cast< QVector<QQmlProfilerData> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - | ||||||||||||||||||
411 | template <> struct QMetaTypeId< QQmlProfiler::LocationHash > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QQmlProfiler::LocationHash >("QQmlProfiler::LocationHash", reinterpret_cast< QQmlProfiler::LocationHash *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - | ||||||||||||||||||
Switch to Source code | Preprocessed file |