3 #include <mach/vm_param.h>
6 // Offset of block->invoke field.
9 # define BLOCK_INVOKE 16
12 # define BLOCK_INVOKE 12
16 .globl __objc_blockTrampolineImpl
17 .globl __objc_blockTrampolineStart
18 .globl __objc_blockTrampolineLast
21 __objc_blockTrampolineImpl:
22 L_objc_blockTrampolineImpl:
25 x17 == address of called trampoline's data (2 pages before its code)
26 lr == original return address
29 mov x1, x0 // _cmd = self
30 ldr p0, [x17] // self = block object
31 add p15, p0, #BLOCK_INVOKE // x15 = &block->invoke
32 ldr p16, [x15] // x16 = block->invoke
33 TailCallBlockInvoke x16, x15
35 // pad up to TrampolineBlockPagePair header size
40 .macro TrampolineEntry
41 // load address of trampoline data (two pages before this instruction)
42 adr x17, -2*PAGE_MAX_SIZE
43 b L_objc_blockTrampolineImpl
46 .macro TrampolineEntryX16
68 .macro TrampolineEntryX256
91 __objc_blockTrampolineStart:
92 // 2048-4 trampolines to fill 16K page
134 __objc_blockTrampolineLast: