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
38 .macro TrampolineEntry
39 // load address of trampoline data (two pages before this instruction)
40 adr x17, -2*PAGE_MAX_SIZE
41 b L_objc_blockTrampolineImpl
44 .macro TrampolineEntryX16
66 .macro TrampolineEntryX256
89 __objc_blockTrampolineStart:
90 // 2048-3 trampolines to fill 16K page
134 __objc_blockTrampolineLast: