Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/assembler/AbstractMacroAssembler.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | namespace JSC { | - | ||||||
3 | - | |||||||
4 | class JumpReplacementWatchpoint; | - | ||||||
5 | template <typename, template <typename> class> | - | ||||||
6 | class LinkBufferBase; | - | ||||||
7 | template <typename> | - | ||||||
8 | class BranchCompactingLinkBuffer; | - | ||||||
9 | class RepatchBuffer; | - | ||||||
10 | class Watchpoint; | - | ||||||
11 | namespace DFG { | - | ||||||
12 | struct OSRExit; | - | ||||||
13 | } | - | ||||||
14 | - | |||||||
15 | template <class AssemblerType> | - | ||||||
16 | class AbstractMacroAssembler { | - | ||||||
17 | public: | - | ||||||
18 | friend class JITWriteBarrierBase; | - | ||||||
19 | typedef AssemblerType AssemblerType_T; | - | ||||||
20 | - | |||||||
21 | typedef MacroAssemblerCodePtr CodePtr; | - | ||||||
22 | typedef MacroAssemblerCodeRef CodeRef; | - | ||||||
23 | - | |||||||
24 | - | |||||||
25 | class Jump; | - | ||||||
26 | - | |||||||
27 | - | |||||||
28 | typedef typename AssemblerType::RegisterID RegisterID; | - | ||||||
29 | typedef typename AssemblerType::FPRegisterID FPRegisterID; | - | ||||||
30 | - | |||||||
31 | - | |||||||
32 | - | |||||||
33 | - | |||||||
34 | - | |||||||
35 | - | |||||||
36 | enum Scale { | - | ||||||
37 | TimesOne, | - | ||||||
38 | TimesTwo, | - | ||||||
39 | TimesFour, | - | ||||||
40 | TimesEight, | - | ||||||
41 | }; | - | ||||||
42 | - | |||||||
43 | - | |||||||
44 | - | |||||||
45 | - | |||||||
46 | struct Address { | - | ||||||
47 | explicit Address(RegisterID base, int32_t offset = 0) | - | ||||||
48 | : base(base) | - | ||||||
49 | , offset(offset) | - | ||||||
50 | { | - | ||||||
51 | } executed 2547284 times by 153 tests: end of block Executed by:
| 2547284 | ||||||
52 | - | |||||||
53 | RegisterID base; | - | ||||||
54 | int32_t offset; | - | ||||||
55 | }; | - | ||||||
56 | - | |||||||
57 | struct ExtendedAddress { | - | ||||||
58 | explicit ExtendedAddress(RegisterID base, intptr_t offset = 0) | - | ||||||
59 | : base(base) | - | ||||||
60 | , offset(offset) | - | ||||||
61 | { | - | ||||||
62 | } executed 3755 times by 3 tests: end of block Executed by:
| 3755 | ||||||
63 | - | |||||||
64 | RegisterID base; | - | ||||||
65 | intptr_t offset; | - | ||||||
66 | }; | - | ||||||
67 | struct ImplicitAddress { | - | ||||||
68 | ImplicitAddress(RegisterID base) | - | ||||||
69 | : base(base) | - | ||||||
70 | , offset(0) | - | ||||||
71 | { | - | ||||||
72 | } executed 1153229 times by 153 tests: end of block Executed by:
| 1153229 | ||||||
73 | - | |||||||
74 | ImplicitAddress(Address address) | - | ||||||
75 | : base(address.base) | - | ||||||
76 | , offset(address.offset) | - | ||||||
77 | { | - | ||||||
78 | } executed 2495741 times by 153 tests: end of block Executed by:
| 2495741 | ||||||
79 | - | |||||||
80 | RegisterID base; | - | ||||||
81 | int32_t offset; | - | ||||||
82 | }; | - | ||||||
83 | - | |||||||
84 | - | |||||||
85 | - | |||||||
86 | - | |||||||
87 | struct BaseIndex { | - | ||||||
88 | BaseIndex(RegisterID base, RegisterID index, Scale scale, int32_t offset = 0) | - | ||||||
89 | : base(base) | - | ||||||
90 | , index(index) | - | ||||||
91 | , scale(scale) | - | ||||||
92 | , offset(offset) | - | ||||||
93 | { | - | ||||||
94 | } executed 1589277 times by 9 tests: end of block Executed by:
| 1589277 | ||||||
95 | - | |||||||
96 | RegisterID base; | - | ||||||
97 | RegisterID index; | - | ||||||
98 | Scale scale; | - | ||||||
99 | int32_t offset; | - | ||||||
100 | }; | - | ||||||
101 | - | |||||||
102 | - | |||||||
103 | - | |||||||
104 | - | |||||||
105 | - | |||||||
106 | struct AbsoluteAddress { | - | ||||||
107 | explicit AbsoluteAddress(const void* ptr) | - | ||||||
108 | : m_ptr(ptr) | - | ||||||
109 | { | - | ||||||
110 | } never executed: end of block | 0 | ||||||
111 | - | |||||||
112 | const void* m_ptr; | - | ||||||
113 | }; | - | ||||||
114 | - | |||||||
115 | - | |||||||
116 | - | |||||||
117 | - | |||||||
118 | - | |||||||
119 | - | |||||||
120 | struct TrustedImmPtr { | - | ||||||
121 | TrustedImmPtr() { } | - | ||||||
122 | - | |||||||
123 | explicit TrustedImmPtr(const void* value) | - | ||||||
124 | : m_value(value) | - | ||||||
125 | { | - | ||||||
126 | } executed 2398277 times by 153 tests: end of block Executed by:
| 2398277 | ||||||
127 | - | |||||||
128 | - | |||||||
129 | - | |||||||
130 | explicit TrustedImmPtr(int value) | - | ||||||
131 | : m_value(0) | - | ||||||
132 | { | - | ||||||
133 | (!(!value) ? (qmlWTFReportAssertionFailure(__FILE__, 193, __PRETTY_FUNCTION__, "!value"), (qmlWTFReportBacktrace(), qmlWTFInvokeCrashHook(), (*(int *)(uintptr_t)0xbbadbeef = 0), __builtin_trap())) : (void)0); | - | ||||||
134 | } executed 13697 times by 65 tests: end of block Executed by:
| 13697 | ||||||
135 | - | |||||||
136 | explicit TrustedImmPtr(size_t value) | - | ||||||
137 | : m_value(reinterpret_cast<void*>(value)) | - | ||||||
138 | { | - | ||||||
139 | } never executed: end of block | 0 | ||||||
140 | - | |||||||
141 | intptr_t asIntptr() | - | ||||||
142 | { | - | ||||||
143 | return executed 2411803 times by 153 tests: reinterpret_cast<intptr_t>(m_value);return reinterpret_cast<intptr_t>(m_value); Executed by:
executed 2411803 times by 153 tests: return reinterpret_cast<intptr_t>(m_value); Executed by:
| 2411803 | ||||||
144 | } | - | ||||||
145 | - | |||||||
146 | const void* m_value; | - | ||||||
147 | }; | - | ||||||
148 | - | |||||||
149 | struct ImmPtr : | - | ||||||
150 | - | |||||||
151 | - | |||||||
152 | - | |||||||
153 | public TrustedImmPtr | - | ||||||
154 | - | |||||||
155 | { | - | ||||||
156 | explicit ImmPtr(const void* value) | - | ||||||
157 | : TrustedImmPtr(value) | - | ||||||
158 | { | - | ||||||
159 | } never executed: end of block | 0 | ||||||
160 | - | |||||||
161 | TrustedImmPtr asTrustedImmPtr() { return never executed: *this;return *this; never executed: }return *this; | 0 | ||||||
162 | }; | - | ||||||
163 | - | |||||||
164 | - | |||||||
165 | - | |||||||
166 | - | |||||||
167 | - | |||||||
168 | - | |||||||
169 | - | |||||||
170 | struct TrustedImm32 { | - | ||||||
171 | TrustedImm32() { } | - | ||||||
172 | - | |||||||
173 | explicit TrustedImm32(int32_t value) | - | ||||||
174 | : m_value(value) | - | ||||||
175 | { | - | ||||||
176 | } executed 9765570 times by 153 tests: end of block Executed by:
| 9765570 | ||||||
177 | int32_t m_value; | - | ||||||
178 | }; | - | ||||||
179 | - | |||||||
180 | - | |||||||
181 | struct Imm32 : | - | ||||||
182 | - | |||||||
183 | - | |||||||
184 | - | |||||||
185 | public TrustedImm32 | - | ||||||
186 | - | |||||||
187 | { | - | ||||||
188 | explicit Imm32(int32_t value) | - | ||||||
189 | : TrustedImm32(value) | - | ||||||
190 | { | - | ||||||
191 | } executed 4887487 times by 153 tests: end of block Executed by:
| 4887487 | ||||||
192 | - | |||||||
193 | - | |||||||
194 | - | |||||||
195 | - | |||||||
196 | - | |||||||
197 | - | |||||||
198 | const TrustedImm32& asTrustedImm32() const { return never executed: *this;return *this; never executed: }return *this; | 0 | ||||||
199 | - | |||||||
200 | }; | - | ||||||
201 | - | |||||||
202 | - | |||||||
203 | - | |||||||
204 | - | |||||||
205 | - | |||||||
206 | - | |||||||
207 | - | |||||||
208 | struct TrustedImm64 { | - | ||||||
209 | TrustedImm64() { } | - | ||||||
210 | - | |||||||
211 | explicit TrustedImm64(int64_t value) | - | ||||||
212 | : m_value(value) | - | ||||||
213 | { | - | ||||||
214 | } executed 27294 times by 64 tests: end of block Executed by:
| 27294 | ||||||
215 | - | |||||||
216 | - | |||||||
217 | explicit TrustedImm64(TrustedImmPtr ptr) | - | ||||||
218 | : m_value(ptr.asIntptr()) | - | ||||||
219 | { | - | ||||||
220 | } executed 13246 times by 64 tests: end of block Executed by:
| 13246 | ||||||
221 | - | |||||||
222 | - | |||||||
223 | int64_t m_value; | - | ||||||
224 | }; | - | ||||||
225 | - | |||||||
226 | struct Imm64 : | - | ||||||
227 | - | |||||||
228 | - | |||||||
229 | - | |||||||
230 | public TrustedImm64 | - | ||||||
231 | - | |||||||
232 | { | - | ||||||
233 | explicit Imm64(int64_t value) | - | ||||||
234 | : TrustedImm64(value) | - | ||||||
235 | { | - | ||||||
236 | } never executed: end of block | 0 | ||||||
237 | - | |||||||
238 | explicit Imm64(TrustedImmPtr ptr) | - | ||||||
239 | : TrustedImm64(ptr) | - | ||||||
240 | { | - | ||||||
241 | } never executed: end of block | 0 | ||||||
242 | - | |||||||
243 | const TrustedImm64& asTrustedImm64() const { return never executed: *this;return *this; never executed: }return *this; | 0 | ||||||
244 | }; | - | ||||||
245 | class Label { | - | ||||||
246 | template<class TemplateAssemblerType> | - | ||||||
247 | friend class AbstractMacroAssembler; | - | ||||||
248 | friend struct DFG::OSRExit; | - | ||||||
249 | - | |||||||
250 | - | |||||||
251 | - | |||||||
252 | - | |||||||
253 | - | |||||||
254 | friend class Jump; | - | ||||||
255 | - | |||||||
256 | friend class JumpReplacementWatchpoint; | - | ||||||
257 | friend class MacroAssemblerCodeRef; | - | ||||||
258 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
259 | friend class Watchpoint; | - | ||||||
260 | - | |||||||
261 | public: | - | ||||||
262 | Label() | - | ||||||
263 | { | - | ||||||
264 | } | - | ||||||
265 | - | |||||||
266 | Label(AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
267 | : m_label(masm->m_assembler.label()) | - | ||||||
268 | { | - | ||||||
269 | } executed 2324432 times by 153 tests: end of block Executed by:
| 2324432 | ||||||
270 | - | |||||||
271 | bool isSet() const { return executed 26592 times by 64 tests: m_label.isSet();return m_label.isSet(); Executed by:
executed 26592 times by 64 tests: }return m_label.isSet(); Executed by:
| 26592 | ||||||
272 | - | |||||||
273 | const AssemblerLabel &label() const { return never executed: m_label;return m_label; never executed: }return m_label; | 0 | ||||||
274 | private: | - | ||||||
275 | AssemblerLabel m_label; | - | ||||||
276 | }; | - | ||||||
277 | class ConvertibleLoadLabel { | - | ||||||
278 | template<class TemplateAssemblerType> | - | ||||||
279 | friend class AbstractMacroAssembler; | - | ||||||
280 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
281 | - | |||||||
282 | public: | - | ||||||
283 | ConvertibleLoadLabel() | - | ||||||
284 | { | - | ||||||
285 | } | - | ||||||
286 | - | |||||||
287 | ConvertibleLoadLabel(AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
288 | : m_label(masm->m_assembler.labelIgnoringWatchpoints()) | - | ||||||
289 | { | - | ||||||
290 | } never executed: end of block | 0 | ||||||
291 | - | |||||||
292 | bool isSet() const { return never executed: m_label.isSet();return m_label.isSet(); never executed: }return m_label.isSet(); | 0 | ||||||
293 | private: | - | ||||||
294 | AssemblerLabel m_label; | - | ||||||
295 | }; | - | ||||||
296 | - | |||||||
297 | - | |||||||
298 | - | |||||||
299 | - | |||||||
300 | - | |||||||
301 | class DataLabelPtr { | - | ||||||
302 | template<class TemplateAssemblerType> | - | ||||||
303 | friend class AbstractMacroAssembler; | - | ||||||
304 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
305 | public: | - | ||||||
306 | DataLabelPtr() | - | ||||||
307 | { | - | ||||||
308 | } | - | ||||||
309 | - | |||||||
310 | DataLabelPtr(AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
311 | : m_label(masm->m_assembler.label()) | - | ||||||
312 | { | - | ||||||
313 | } executed 610 times by 10 tests: end of block Executed by:
| 610 | ||||||
314 | - | |||||||
315 | bool isSet() const { return never executed: m_label.isSet();return m_label.isSet(); never executed: }return m_label.isSet(); | 0 | ||||||
316 | - | |||||||
317 | private: | - | ||||||
318 | AssemblerLabel m_label; | - | ||||||
319 | }; | - | ||||||
320 | - | |||||||
321 | - | |||||||
322 | - | |||||||
323 | - | |||||||
324 | - | |||||||
325 | class DataLabel32 { | - | ||||||
326 | template<class TemplateAssemblerType> | - | ||||||
327 | friend class AbstractMacroAssembler; | - | ||||||
328 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
329 | public: | - | ||||||
330 | DataLabel32() | - | ||||||
331 | { | - | ||||||
332 | } | - | ||||||
333 | - | |||||||
334 | DataLabel32(AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
335 | : m_label(masm->m_assembler.label()) | - | ||||||
336 | { | - | ||||||
337 | } never executed: end of block | 0 | ||||||
338 | - | |||||||
339 | AssemblerLabel label() const { return never executed: m_label;return m_label; never executed: }return m_label; | 0 | ||||||
340 | - | |||||||
341 | private: | - | ||||||
342 | AssemblerLabel m_label; | - | ||||||
343 | }; | - | ||||||
344 | - | |||||||
345 | - | |||||||
346 | - | |||||||
347 | - | |||||||
348 | - | |||||||
349 | class DataLabelCompact { | - | ||||||
350 | template<class TemplateAssemblerType> | - | ||||||
351 | friend class AbstractMacroAssembler; | - | ||||||
352 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
353 | public: | - | ||||||
354 | DataLabelCompact() | - | ||||||
355 | { | - | ||||||
356 | } | - | ||||||
357 | - | |||||||
358 | DataLabelCompact(AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
359 | : m_label(masm->m_assembler.label()) | - | ||||||
360 | { | - | ||||||
361 | } never executed: end of block | 0 | ||||||
362 | - | |||||||
363 | DataLabelCompact(AssemblerLabel label) | - | ||||||
364 | : m_label(label) | - | ||||||
365 | { | - | ||||||
366 | } never executed: end of block | 0 | ||||||
367 | - | |||||||
368 | private: | - | ||||||
369 | AssemblerLabel m_label; | - | ||||||
370 | }; | - | ||||||
371 | class Call { | - | ||||||
372 | template<class TemplateAssemblerType> | - | ||||||
373 | friend class AbstractMacroAssembler; | - | ||||||
374 | - | |||||||
375 | public: | - | ||||||
376 | enum Flags { | - | ||||||
377 | None = 0x0, | - | ||||||
378 | Linkable = 0x1, | - | ||||||
379 | Near = 0x2, | - | ||||||
380 | LinkableNear = 0x3, | - | ||||||
381 | }; | - | ||||||
382 | - | |||||||
383 | Call() | - | ||||||
384 | : m_flags(None) | - | ||||||
385 | { | - | ||||||
386 | } never executed: end of block | 0 | ||||||
387 | - | |||||||
388 | Call(AssemblerLabel jmp, Flags flags) | - | ||||||
389 | : m_label(jmp) | - | ||||||
390 | , m_flags(flags) | - | ||||||
391 | { | - | ||||||
392 | } executed 83222 times by 64 tests: end of block Executed by:
| 83222 | ||||||
393 | - | |||||||
394 | bool isFlagSet(Flags flag) | - | ||||||
395 | { | - | ||||||
396 | return never executed: m_flags & flag;return m_flags & flag; never executed: return m_flags & flag; | 0 | ||||||
397 | } | - | ||||||
398 | - | |||||||
399 | static Call fromTailJump(Jump jump) | - | ||||||
400 | { | - | ||||||
401 | return never executed: Call(jump.m_label, Linkable);return Call(jump.m_label, Linkable); never executed: return Call(jump.m_label, Linkable); | 0 | ||||||
402 | } | - | ||||||
403 | - | |||||||
404 | AssemblerLabel m_label; | - | ||||||
405 | private: | - | ||||||
406 | Flags m_flags; | - | ||||||
407 | }; | - | ||||||
408 | class Jump { | - | ||||||
409 | template<class TemplateAssemblerType> | - | ||||||
410 | friend class AbstractMacroAssembler; | - | ||||||
411 | friend class Call; | - | ||||||
412 | friend struct DFG::OSRExit; | - | ||||||
413 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
414 | public: | - | ||||||
415 | Jump() | - | ||||||
416 | { | - | ||||||
417 | } | - | ||||||
418 | Jump(AssemblerLabel jmp) | - | ||||||
419 | : m_label(jmp) | - | ||||||
420 | { | - | ||||||
421 | } executed 7520831 times by 153 tests: end of block Executed by:
| 7520831 | ||||||
422 | - | |||||||
423 | - | |||||||
424 | Label label() const | - | ||||||
425 | { | - | ||||||
426 | Label result; | - | ||||||
427 | result.m_label = m_label; | - | ||||||
428 | return never executed: result;return result; never executed: return result; | 0 | ||||||
429 | } | - | ||||||
430 | - | |||||||
431 | void link(AbstractMacroAssembler<AssemblerType>* masm) const | - | ||||||
432 | { | - | ||||||
433 | masm->m_assembler.linkJump(m_label, masm->m_assembler.label()); | - | ||||||
434 | - | |||||||
435 | } executed 5196730 times by 153 tests: end of block Executed by:
| 5196730 | ||||||
436 | - | |||||||
437 | void linkTo(Label label, AbstractMacroAssembler<AssemblerType>* masm) const | - | ||||||
438 | { | - | ||||||
439 | masm->m_assembler.linkJump(m_label, label.m_label); | - | ||||||
440 | - | |||||||
441 | } executed 2330423 times by 153 tests: end of block Executed by:
| 2330423 | ||||||
442 | - | |||||||
443 | bool isSet() const { return executed 64678 times by 64 tests: m_label.isSet();return m_label.isSet(); Executed by:
executed 64678 times by 64 tests: }return m_label.isSet(); Executed by:
| 64678 | ||||||
444 | - | |||||||
445 | private: | - | ||||||
446 | AssemblerLabel m_label; | - | ||||||
447 | }; | - | ||||||
448 | - | |||||||
449 | - | |||||||
450 | struct PatchableJump { | - | ||||||
451 | PatchableJump() | - | ||||||
452 | { | - | ||||||
453 | } | - | ||||||
454 | - | |||||||
455 | explicit PatchableJump(Jump jump) | - | ||||||
456 | : m_jump(jump) | - | ||||||
457 | { | - | ||||||
458 | } never executed: end of block | 0 | ||||||
459 | - | |||||||
460 | operator Jump&() { return never executed: m_jump;return m_jump; never executed: }return m_jump; | 0 | ||||||
461 | - | |||||||
462 | Jump m_jump; | - | ||||||
463 | }; | - | ||||||
464 | - | |||||||
465 | - | |||||||
466 | - | |||||||
467 | - | |||||||
468 | - | |||||||
469 | class JumpList { | - | ||||||
470 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
471 | - | |||||||
472 | public: | - | ||||||
473 | typedef Vector<Jump, 2> JumpVector; | - | ||||||
474 | - | |||||||
475 | JumpList() { } | - | ||||||
476 | - | |||||||
477 | JumpList(Jump jump) | - | ||||||
478 | { | - | ||||||
479 | append(jump); | - | ||||||
480 | } never executed: end of block | 0 | ||||||
481 | - | |||||||
482 | void link(AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
483 | { | - | ||||||
484 | size_t size = m_jumps.size(); | - | ||||||
485 | for (size_t i = 0; i < size
| 2318643-2777913 | ||||||
486 | m_jumps[i].link(masm); executed 2778363 times by 153 tests: m_jumps[i].link(masm); Executed by:
| 2778363 | ||||||
487 | m_jumps.clear(); | - | ||||||
488 | } executed 2317694 times by 153 tests: end of block Executed by:
| 2317694 | ||||||
489 | - | |||||||
490 | void linkTo(Label label, AbstractMacroAssembler<AssemblerType>* masm) | - | ||||||
491 | { | - | ||||||
492 | size_t size = m_jumps.size(); | - | ||||||
493 | for (size_t i = 0; i < size
| 800-1210 | ||||||
494 | m_jumps[i].linkTo(label, masm); executed 1209 times by 5 tests: m_jumps[i].linkTo(label, masm); Executed by:
| 1209 | ||||||
495 | m_jumps.clear(); | - | ||||||
496 | } executed 800 times by 5 tests: end of block Executed by:
| 800 | ||||||
497 | - | |||||||
498 | void append(Jump jump) | - | ||||||
499 | { | - | ||||||
500 | m_jumps.append(jump); | - | ||||||
501 | } executed 2781479 times by 153 tests: end of block Executed by:
| 2781479 | ||||||
502 | - | |||||||
503 | void append(const JumpList& other) | - | ||||||
504 | { | - | ||||||
505 | m_jumps.append(other.m_jumps.begin(), other.m_jumps.size()); | - | ||||||
506 | } executed 2382740 times by 9 tests: end of block Executed by:
| 2382740 | ||||||
507 | - | |||||||
508 | bool empty() | - | ||||||
509 | { | - | ||||||
510 | return executed 2298520 times by 153 tests: !m_jumps.size();return !m_jumps.size(); Executed by:
executed 2298520 times by 153 tests: return !m_jumps.size(); Executed by:
| 2298520 | ||||||
511 | } | - | ||||||
512 | - | |||||||
513 | void clear() | - | ||||||
514 | { | - | ||||||
515 | m_jumps.clear(); | - | ||||||
516 | } executed 1158343 times by 153 tests: end of block Executed by:
| 1158343 | ||||||
517 | - | |||||||
518 | const JumpVector& jumps() const { return never executed: m_jumps;return m_jumps; never executed: }return m_jumps; | 0 | ||||||
519 | - | |||||||
520 | private: | - | ||||||
521 | JumpVector m_jumps; | - | ||||||
522 | }; | - | ||||||
523 | Label labelIgnoringWatchpoints() | - | ||||||
524 | { | - | ||||||
525 | return never executed: label();return label(); never executed: return label(); | 0 | ||||||
526 | } | - | ||||||
527 | - | |||||||
528 | - | |||||||
529 | Label label() | - | ||||||
530 | { | - | ||||||
531 | return executed 1170130 times by 153 tests: Label(this);return Label(this); Executed by:
executed 1170130 times by 153 tests: return Label(this); Executed by:
| 1170130 | ||||||
532 | } | - | ||||||
533 | - | |||||||
534 | void padBeforePatch() | - | ||||||
535 | { | - | ||||||
536 | - | |||||||
537 | (void)label(); | - | ||||||
538 | } executed 610 times by 10 tests: end of block Executed by:
| 610 | ||||||
539 | - | |||||||
540 | Label watchpointLabel() | - | ||||||
541 | { | - | ||||||
542 | Label result; | - | ||||||
543 | result.m_label = m_assembler.labelForWatchpoint(); | - | ||||||
544 | return never executed: result;return result; never executed: return result; | 0 | ||||||
545 | } | - | ||||||
546 | - | |||||||
547 | Label align() | - | ||||||
548 | { | - | ||||||
549 | m_assembler.align(16); | - | ||||||
550 | return never executed: Label(this);return Label(this); never executed: return Label(this); | 0 | ||||||
551 | } | - | ||||||
552 | template<typename T, typename U> | - | ||||||
553 | static ptrdiff_t differenceBetween(T from, U to) | - | ||||||
554 | { | - | ||||||
555 | return never executed: AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label); never executed: return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label); | 0 | ||||||
556 | } | - | ||||||
557 | - | |||||||
558 | static ptrdiff_t differenceBetweenCodePtr(const MacroAssemblerCodePtr& a, const MacroAssemblerCodePtr& b) | - | ||||||
559 | { | - | ||||||
560 | return never executed: reinterpret_cast<ptrdiff_t>(b.executableAddress()) - reinterpret_cast<ptrdiff_t>(a.executableAddress());return reinterpret_cast<ptrdiff_t>(b.executableAddress()) - reinterpret_cast<ptrdiff_t>(a.executableAddress()); never executed: return reinterpret_cast<ptrdiff_t>(b.executableAddress()) - reinterpret_cast<ptrdiff_t>(a.executableAddress()); | 0 | ||||||
561 | } | - | ||||||
562 | - | |||||||
563 | unsigned debugOffset() { return never executed: m_assembler.debugOffset();return m_assembler.debugOffset(); never executed: }return m_assembler.debugOffset(); | 0 | ||||||
564 | - | |||||||
565 | inline static void cacheFlush(void* code, size_t size) | - | ||||||
566 | { | - | ||||||
567 | AssemblerType::cacheFlush(code, size); | - | ||||||
568 | } executed 1163856 times by 153 tests: end of block Executed by:
| 1163856 | ||||||
569 | protected: | - | ||||||
570 | AbstractMacroAssembler() | - | ||||||
571 | : m_randomSource(cryptographicallyRandomNumber()) | - | ||||||
572 | { | - | ||||||
573 | } executed 1162652 times by 153 tests: end of block Executed by:
| 1162652 | ||||||
574 | - | |||||||
575 | AssemblerType m_assembler; | - | ||||||
576 | - | |||||||
577 | uint32_t random() | - | ||||||
578 | { | - | ||||||
579 | return never executed: m_randomSource.getUint32();return m_randomSource.getUint32(); never executed: return m_randomSource.getUint32(); | 0 | ||||||
580 | } | - | ||||||
581 | - | |||||||
582 | WeakRandom m_randomSource; | - | ||||||
583 | template <typename, template <typename> class> friend class LinkBufferBase; | - | ||||||
584 | template <typename> friend class BranchCompactingLinkBuffer; | - | ||||||
585 | friend class RepatchBuffer; | - | ||||||
586 | - | |||||||
587 | static void linkJump(void* code, Jump jump, CodeLocationLabel target) | - | ||||||
588 | { | - | ||||||
589 | AssemblerType::linkJump(code, jump.m_label, target.dataLocation()); | - | ||||||
590 | } never executed: end of block | 0 | ||||||
591 | - | |||||||
592 | static void linkPointer(void* code, AssemblerLabel label, void* value) | - | ||||||
593 | { | - | ||||||
594 | AssemblerType::linkPointer(code, label, value); | - | ||||||
595 | } executed 612 times by 10 tests: end of block Executed by:
| 612 | ||||||
596 | - | |||||||
597 | static void* getLinkerAddress(void* code, AssemblerLabel label) | - | ||||||
598 | { | - | ||||||
599 | return executed 612 times by 10 tests: AssemblerType::getRelocatedAddress(code, label);return AssemblerType::getRelocatedAddress(code, label); Executed by:
executed 612 times by 10 tests: return AssemblerType::getRelocatedAddress(code, label); Executed by:
| 612 | ||||||
600 | } | - | ||||||
601 | - | |||||||
602 | static unsigned getLinkerCallReturnOffset(Call call) | - | ||||||
603 | { | - | ||||||
604 | return never executed: AssemblerType::getCallReturnOffset(call.m_label);return AssemblerType::getCallReturnOffset(call.m_label); never executed: return AssemblerType::getCallReturnOffset(call.m_label); | 0 | ||||||
605 | } | - | ||||||
606 | - | |||||||
607 | static void repatchJump(CodeLocationJump jump, CodeLocationLabel destination) | - | ||||||
608 | { | - | ||||||
609 | AssemblerType::relinkJump(jump.dataLocation(), destination.dataLocation()); | - | ||||||
610 | } never executed: end of block | 0 | ||||||
611 | - | |||||||
612 | static void repatchNearCall(CodeLocationNearCall nearCall, CodeLocationLabel destination) | - | ||||||
613 | { | - | ||||||
614 | AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress()); | - | ||||||
615 | } never executed: end of block | 0 | ||||||
616 | - | |||||||
617 | static void repatchCompact(CodeLocationDataLabelCompact dataLabelCompact, int32_t value) | - | ||||||
618 | { | - | ||||||
619 | AssemblerType::repatchCompact(dataLabelCompact.dataLocation(), value); | - | ||||||
620 | } never executed: end of block | 0 | ||||||
621 | - | |||||||
622 | static void repatchInt32(CodeLocationDataLabel32 dataLabel32, int32_t value) | - | ||||||
623 | { | - | ||||||
624 | AssemblerType::repatchInt32(dataLabel32.dataLocation(), value); | - | ||||||
625 | } never executed: end of block | 0 | ||||||
626 | - | |||||||
627 | static void repatchPointer(CodeLocationDataLabelPtr dataLabelPtr, void* value) | - | ||||||
628 | { | - | ||||||
629 | AssemblerType::repatchPointer(dataLabelPtr.dataLocation(), value); | - | ||||||
630 | } never executed: end of block | 0 | ||||||
631 | - | |||||||
632 | - | |||||||
633 | static void* readPointer(CodeLocationDataLabelPtr dataLabelPtr) | - | ||||||
634 | { | - | ||||||
635 | return never executed: AssemblerType::readPointer(dataLabelPtr.dataLocation());return AssemblerType::readPointer(dataLabelPtr.dataLocation()); never executed: return AssemblerType::readPointer(dataLabelPtr.dataLocation()); | 0 | ||||||
636 | } | - | ||||||
637 | - | |||||||
638 | - | |||||||
639 | static void replaceWithLoad(CodeLocationConvertibleLoad label) | - | ||||||
640 | { | - | ||||||
641 | AssemblerType::replaceWithLoad(label.dataLocation()); | - | ||||||
642 | } never executed: end of block | 0 | ||||||
643 | - | |||||||
644 | static void replaceWithAddressComputation(CodeLocationConvertibleLoad label) | - | ||||||
645 | { | - | ||||||
646 | AssemblerType::replaceWithAddressComputation(label.dataLocation()); | - | ||||||
647 | } never executed: end of block | 0 | ||||||
648 | }; | - | ||||||
649 | - | |||||||
650 | } | - | ||||||
Switch to Source code | Preprocessed file |