Lines Matching +full:a +full:- +full:8
1 //===----------------------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10 //===----------------------------------------------------------------------===//
19 #include <mach-o/compact_unwind_encoding.h>
25 ((value >> __builtin_ctz(mask)) & (((1 << __builtin_popcount(mask))) - 1))
30 /// CompactUnwinder_x86 uses a compact unwind info to virtually "step" (aka
31 /// unwind) by modifying a Registers_x86 register set
32 template <typename A>
37 uint32_t functionStart, A &addressSpace,
41 typename A::pint_t pint_t;
43 static void frameUnwind(A &addressSpace, Registers_x86 ®isters);
44 static void framelessUnwind(A &addressSpace,
45 typename A::pint_t returnAddressLocation,
49 uint32_t functionStart, A &addressSpace,
53 A &addressSpace, Registers_x86 ®isters, bool indirectStackSize);
56 template <typename A>
57 int CompactUnwinder_x86<A>::stepWithCompactEncoding( in stepWithCompactEncoding()
59 A &addressSpace, Registers_x86 ®isters) { in stepWithCompactEncoding()
74 template <typename A>
75 int CompactUnwinder_x86<A>::stepWithCompactEncodingEBPFrame( in stepWithCompactEncodingEBPFrame()
77 A &addressSpace, Registers_x86 ®isters) { in stepWithCompactEncodingEBPFrame()
83 uint32_t savedRegisters = registers.getEBP() - 4 * savedRegistersOffset; in stepWithCompactEncodingEBPFrame()
118 template <typename A>
119 int CompactUnwinder_x86<A>::stepWithCompactEncodingFrameless( in stepWithCompactEncodingFrameless()
121 A &addressSpace, Registers_x86 ®isters, bool indirectStackSize) { in stepWithCompactEncodingFrameless()
141 permutation -= (permunreg[0] * 120); in stepWithCompactEncodingFrameless()
143 permutation -= (permunreg[1] * 24); in stepWithCompactEncodingFrameless()
145 permutation -= (permunreg[2] * 6); in stepWithCompactEncodingFrameless()
147 permutation -= (permunreg[3] * 2); in stepWithCompactEncodingFrameless()
153 permutation -= (permunreg[0] * 120); in stepWithCompactEncodingFrameless()
155 permutation -= (permunreg[1] * 24); in stepWithCompactEncodingFrameless()
157 permutation -= (permunreg[2] * 6); in stepWithCompactEncodingFrameless()
159 permutation -= (permunreg[3] * 2); in stepWithCompactEncodingFrameless()
164 permutation -= (permunreg[0] * 60); in stepWithCompactEncodingFrameless()
166 permutation -= (permunreg[1] * 12); in stepWithCompactEncodingFrameless()
168 permutation -= (permunreg[2] * 3); in stepWithCompactEncodingFrameless()
173 permutation -= (permunreg[0] * 20); in stepWithCompactEncodingFrameless()
175 permutation -= (permunreg[1] * 4); in stepWithCompactEncodingFrameless()
180 permutation -= (permunreg[0] * 5); in stepWithCompactEncodingFrameless()
187 // re-number registers back to standard numbers in stepWithCompactEncodingFrameless()
203 uint32_t savedRegisters = registers.getSP() + stackSize - 4 - 4 * regCount; in stepWithCompactEncodingFrameless()
237 template <typename A>
238 void CompactUnwinder_x86<A>::frameUnwind(A &addressSpace, in frameUnwind()
240 typename A::pint_t bp = registers.getEBP(); in frameUnwind()
244 registers.setSP((uint32_t)bp + 8); in frameUnwind()
249 template <typename A>
250 void CompactUnwinder_x86<A>::framelessUnwind( in framelessUnwind()
251 A &addressSpace, typename A::pint_t returnAddressLocation, in framelessUnwind()
262 /// CompactUnwinder_x86_64 uses a compact unwind info to virtually "step" (aka
263 /// unwind) by modifying a Registers_x86_64 register set
264 template <typename A>
269 uint64_t functionStart, A &addressSpace,
273 typename A::pint_t pint_t;
275 static void frameUnwind(A &addressSpace, Registers_x86_64 ®isters);
276 static void framelessUnwind(A &addressSpace, uint64_t returnAddressLocation,
280 uint64_t functionStart, A &addressSpace,
284 A &addressSpace, Registers_x86_64 ®isters, bool indirectStackSize);
287 template <typename A>
288 int CompactUnwinder_x86_64<A>::stepWithCompactEncoding( in stepWithCompactEncoding()
290 A &addressSpace, Registers_x86_64 ®isters) { in stepWithCompactEncoding()
305 template <typename A>
306 int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame( in stepWithCompactEncodingRBPFrame()
308 A &addressSpace, Registers_x86_64 ®isters) { in stepWithCompactEncodingRBPFrame()
314 uint64_t savedRegisters = registers.getRBP() - 8 * savedRegistersOffset; in stepWithCompactEncodingRBPFrame()
342 savedRegisters += 8; in stepWithCompactEncodingRBPFrame()
349 template <typename A>
350 int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless( in stepWithCompactEncodingFrameless()
351 compact_unwind_encoding_t encoding, uint64_t functionStart, A &addressSpace, in stepWithCompactEncodingFrameless()
361 uint32_t stackSize = stackSizeEncoded * 8; in stepWithCompactEncodingFrameless()
365 stackSize = subl + 8 * stackAdjust; in stepWithCompactEncodingFrameless()
372 permutation -= (permunreg[0] * 120); in stepWithCompactEncodingFrameless()
374 permutation -= (permunreg[1] * 24); in stepWithCompactEncodingFrameless()
376 permutation -= (permunreg[2] * 6); in stepWithCompactEncodingFrameless()
378 permutation -= (permunreg[3] * 2); in stepWithCompactEncodingFrameless()
384 permutation -= (permunreg[0] * 120); in stepWithCompactEncodingFrameless()
386 permutation -= (permunreg[1] * 24); in stepWithCompactEncodingFrameless()
388 permutation -= (permunreg[2] * 6); in stepWithCompactEncodingFrameless()
390 permutation -= (permunreg[3] * 2); in stepWithCompactEncodingFrameless()
395 permutation -= (permunreg[0] * 60); in stepWithCompactEncodingFrameless()
397 permutation -= (permunreg[1] * 12); in stepWithCompactEncodingFrameless()
399 permutation -= (permunreg[2] * 3); in stepWithCompactEncodingFrameless()
404 permutation -= (permunreg[0] * 20); in stepWithCompactEncodingFrameless()
406 permutation -= (permunreg[1] * 4); in stepWithCompactEncodingFrameless()
411 permutation -= (permunreg[0] * 5); in stepWithCompactEncodingFrameless()
418 // re-number registers back to standard numbers in stepWithCompactEncodingFrameless()
434 uint64_t savedRegisters = registers.getSP() + stackSize - 8 - 8 * regCount; in stepWithCompactEncodingFrameless()
461 savedRegisters += 8; in stepWithCompactEncodingFrameless()
468 template <typename A>
469 void CompactUnwinder_x86_64<A>::frameUnwind(A &addressSpace, in frameUnwind()
477 registers.setIP(addressSpace.get64(rbp + 8)); in frameUnwind()
480 template <typename A>
481 void CompactUnwinder_x86_64<A>::framelessUnwind(A &addressSpace, in framelessUnwind()
487 registers.setSP(returnAddressLocation + 8); in framelessUnwind()
494 /// CompactUnwinder_arm64 uses a compact unwind info to virtually "step" (aka
495 /// unwind) by modifying a Registers_arm64 register set
496 template <typename A>
501 uint64_t functionStart, A &addressSpace,
505 typename A::pint_t pint_t;
509 uint64_t functionStart, A &addressSpace,
513 A &addressSpace, Registers_arm64 ®isters);
516 template <typename A>
517 int CompactUnwinder_arm64<A>::stepWithCompactEncoding( in stepWithCompactEncoding()
519 A &addressSpace, Registers_arm64 ®isters) { in stepWithCompactEncoding()
531 template <typename A>
532 int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrameless( in stepWithCompactEncodingFrameless()
533 compact_unwind_encoding_t encoding, uint64_t, A &addressSpace, in stepWithCompactEncodingFrameless()
542 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
544 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
548 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
550 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
554 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
556 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
560 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
562 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
566 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
568 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
574 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
577 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
582 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
585 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
590 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
593 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
598 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
601 savedRegisterLoc -= 8; in stepWithCompactEncodingFrameless()
613 template <typename A>
614 int CompactUnwinder_arm64<A>::stepWithCompactEncodingFrame( in stepWithCompactEncodingFrame()
615 compact_unwind_encoding_t encoding, uint64_t, A &addressSpace, in stepWithCompactEncodingFrame()
617 uint64_t savedRegisterLoc = registers.getFP() - 8; in stepWithCompactEncodingFrame()
621 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
623 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
627 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
629 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
633 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
635 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
639 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
641 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
645 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
647 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
653 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
656 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
661 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
664 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
669 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
672 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
677 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
680 savedRegisterLoc -= 8; in stepWithCompactEncodingFrame()
689 registers.setIP(addressSpace.get64(fp + 8)); in stepWithCompactEncodingFrame()