summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2014-12-20 01:22:54 +0000
committerNick Kledzik <kledzik@apple.com>2014-12-20 01:22:54 +0000
commit41baec6ce12a62ccaed33eb834026c2e2cc2e5b4 (patch)
treed1bf64827c31e4332b9613ebb073dfdfebdac545 /include
parent96a6ac2c5c2d297f19309411a94350d92e9310af (diff)
[libunwind] improve x86_64 comments in compact_unwind_encoding.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@224657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/mach-o/compact_unwind_encoding.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/mach-o/compact_unwind_encoding.h b/include/mach-o/compact_unwind_encoding.h
index 8d5ee7d..b71c2c8 100644
--- a/include/mach-o/compact_unwind_encoding.h
+++ b/include/mach-o/compact_unwind_encoding.h
@@ -133,6 +133,10 @@ enum {
// linker in final linked images which have only dwarf unwind info for a
// function.
//
+// The permutation encoding is a Lehmer code sequence encoded into a
+// single variable-base number so we can encode the ordering of up to
+// six registers in a 10-bit space.
+//
// The following is the algorithm used to create the permutation encoding used
// with frameless stacks. It is passed the number of registers to be saved and
// an array of the register numbers saved.
@@ -234,7 +238,7 @@ enum {
// EPB value, then RBP is restored by popping off the stack, and the return
// is done by popping the stack once more into the pc.
// All non-volatile registers that need to be restored must have been saved
-// in a small range in the stack that starts RBP-8 to RBP-1020. The offset/4
+// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
// Each entry contains which register to restore.
@@ -244,8 +248,8 @@ enum {
// unwind encoding) is added to the RSP. Then the return is done by
// popping the stack into the pc.
// All non-volatile registers that need to be restored must have been saved
-// on the stack immediately after the return address. The stack_size/4 is
-// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 1024).
+// on the stack immediately after the return address. The stack_size/8 is
+// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
// saved and their order.