Overview
Comment: | Add forwarding for iOS/ARM64. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2566c341f345e36855a69ee0111962af |
User & Date: | js on 2013-12-24 00:50:36 |
Other Links: | manifest | tags |
Context
2013-12-24
| ||
23:23 | Get rid of a stupid warning when using (old) GCC. check-in: 55c9063260 user: js tags: trunk | |
00:50 | Add forwarding for iOS/ARM64. check-in: 2566c341f3 user: js tags: trunk | |
2013-12-22
| ||
15:00 | PLATFORMS.md: Add ARM64 to iOS. check-in: d4fef32ab3 user: js tags: trunk | |
Changes
Modified src/OFObject.h from [16867a85cf] to [73a261c6af].
︙ | ︙ | |||
102 103 104 105 106 107 108 | #if __has_attribute(objc_root_class) # define OF_ROOT_CLASS __attribute__((objc_root_class)) #else # define OF_ROOT_CLASS #endif #ifdef OF_APPLE_RUNTIME | | | | > | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | #if __has_attribute(objc_root_class) # define OF_ROOT_CLASS __attribute__((objc_root_class)) #else # define OF_ROOT_CLASS #endif #ifdef OF_APPLE_RUNTIME # if defined(__x86_64__) || defined(__i386__) || defined(__ARM64_ARCH_8__) || \ defined(__arm__) || defined(__ppc__) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif #else # if defined(__ELF__) # if defined(__amd64__) || defined(__x86_64__) || defined(__i386__) || \ defined(__arm__) || defined(__ARM__) || defined(__ppc__) || \ defined(__PPC__) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # if __OBJFW_RUNTIME_ABI__ >= 800 # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif # endif # if (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \ (defined(__mips_eabi) && _MIPS_SZPTR == 32) |
︙ | ︙ |
Modified src/forwarding/apple-forwarding-arm.S from [f3e1432527] to [71a0f74942].
︙ | ︙ | |||
14 15 16 17 18 19 20 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __objc_methname, cstring_literals | | | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __objc_methname, cstring_literals L_str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section __DATA, __objc_selrefs, literal_pointers, no_dead_strip L_sel_forwardingTargetForSelector_: .long L_str_forwardingTargetForSelector_ .section __DATA, __objc_imageinfo, regular, no_dead_strip .long 0, 0 .section __TEXT, __text, regular, pure_instructions .arm .align 2 _of_forward: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} blx _object_getClass ldr r1, L_sel_forwardingTargetForSelector_$indirect_L0 L0: ldr r1, [pc, r1] stmfd sp!, {r1} blx _class_respondsToSelector ldmfd sp!, {r1} cmp r0, #0 beq fail |
︙ | ︙ | |||
72 73 74 75 76 77 78 | _of_forward_stret: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} mov r0, r1 blx _object_getClass | | | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | _of_forward_stret: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} mov r0, r1 blx _object_getClass ldr r1, L_sel_forwardingTargetForSelector_$indirect_L1 L1: ldr r1, [pc, r1] stmfd sp!, {r1} blx _class_respondsToSelector ldmfd sp!, {r1} cmp r0, #0 beq fail_stret |
︙ | ︙ | |||
109 110 111 112 113 114 115 | fldmfdd sp!, {d0-d7} ldmfd sp!, {r0-r3, lr} mov r0, r1 mov r1, r2 b _of_method_not_found .data_region | | | | | | 109 110 111 112 113 114 115 116 117 118 119 120 | fldmfdd sp!, {d0-d7} ldmfd sp!, {r0-r3, lr} mov r0, r1 mov r1, r2 b _of_method_not_found .data_region L_sel_forwardingTargetForSelector_$indirect_L0: .long L_sel_forwardingTargetForSelector_-(L0+8) L_sel_forwardingTargetForSelector_$indirect_L1: .long L_sel_forwardingTargetForSelector_-(L1+8) .end_data_region |
Added src/forwarding/apple-forwarding-arm64.S version [bd6425afa7].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 * Jonathan Schleifer <js@webkeks.org> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __objc_methname, cstring_literals L_str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section __DATA, __objc_selrefs, literal_pointers, no_dead_strip L_sel_forwardingTargetForSelector_: .quad L_str_forwardingTargetForSelector_ .section __DATA, __objc_imageinfo, regular, no_dead_strip .long 0, 0 .section __TEXT, __text, regular, pure_instructions _of_forward: _of_forward_stret: stp fp, lr, [sp, #-208]! mov fp, sp sub sp, sp, #208 /* Save all arguments, x8 and x19 */ stp x0, x1, [sp] stp x2, x3, [sp, #16] stp x4, x5, [sp, #32] stp x6, x7, [sp, #48] stp x8, x19, [sp, #64] /* Save all foating point arguments */ stp q0, q1, [sp, #80] stp q2, q3, [sp, #112] stp q4, q5, [sp, #144] stp q6, q7, [sp, #176] bl _object_getClass adrp x19, L_sel_forwardingTargetForSelector_@PAGE add x19, x19, L_sel_forwardingTargetForSelector_@PAGEOFF ldr x19, [x19] mov x1, x19 bl _class_respondsToSelector cbz x0, fail ldp x0, x2, [sp] mov x1, x19 bl _objc_msgSend cbz x0, fail ldr x1, [sp, #8] cmp x0, x1 b.eq fail /* Restore all arguments, x8 and x19, but not x0 */ ldr x1, [sp, #8] ldp x2, x3, [sp, #16] ldp x4, x5, [sp, #32] ldp x6, x7, [sp, #48] ldp x8, x19, [sp, #64] /* Restore all foating point arguments */ ldp q0, q1, [sp, #80] ldp q2, q3, [sp, #112] ldp q4, q5, [sp, #144] ldp q6, q7, [sp, #176] mov sp, fp ldp fp, lr, [sp], #208 b _objc_msgSend fail: ldp x0, x1, [sp] mov sp, fp ldp fp, lr, [sp], #208 b _of_method_not_found |
Modified src/forwarding/apple-forwarding-i386.S from [a72704deee] to [8a15676211].
︙ | ︙ | |||
14 15 16 17 18 19 20 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __cstring, cstring_literals | | | | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __cstring, cstring_literals L_str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section __OBJC, __message_refs, literal_pointers, no_dead_strip L_sel_forwardingTargetForSelector_: .long L_str_forwardingTargetForSelector_ .section __OBJC, __image_info .long 0, 0 .section __TEXT, __text, regular, pure_instructions _of_forward: pushl %ebp movl %esp, %ebp pushl %ebx subl $20, %esp call get_eip .L0: movl 8(%ebp), %eax movl %eax, (%esp) call _object_getClass movl %eax, (%esp) movl L_sel_forwardingTargetForSelector_-.L0(%ebx), %eax movl %eax, 4(%esp) call _class_respondsToSelector testl %eax, %eax jz fail movl 8(%ebp), %eax movl %eax, (%esp) movl L_sel_forwardingTargetForSelector_-.L0(%ebx), %eax movl %eax, 4(%esp) movl 12(%ebp), %eax movl %eax, 8(%esp) call _objc_msgSend testl %eax, %eax jz fail |
︙ | ︙ | |||
88 89 90 91 92 93 94 | call get_eip .L1: movl 12(%ebp), %eax movl %eax, (%esp) call _object_getClass movl %eax, (%esp) | | | | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | call get_eip .L1: movl 12(%ebp), %eax movl %eax, (%esp) call _object_getClass movl %eax, (%esp) movl L_sel_forwardingTargetForSelector_-.L1(%ebx), %eax movl %eax, 4(%esp) call _class_respondsToSelector testl %eax, %eax jz fail_stret movl 12(%ebp), %eax movl %eax, (%esp) movl L_sel_forwardingTargetForSelector_-.L1(%ebx), %eax movl %eax, 4(%esp) movl 16(%ebp), %eax movl %eax, 8(%esp) call _objc_msgSend testl %eax, %eax jz fail_stret |
︙ | ︙ |
Modified src/forwarding/apple-forwarding-ppc.S from [0d304d12c0] to [a34378a6db].
︙ | ︙ | |||
14 15 16 17 18 19 20 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __cstring, cstring_literals | | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __cstring, cstring_literals L_str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section __OBJC, __message_refs, literal_pointers, no_dead_strip L_sel_forwardingTargetForSelector_: .long L_str_forwardingTargetForSelector_ .section __OBJC, __image_info .long 0, 0 .section __TEXT, __text, regular, pure_instructions _of_forward: mflr r0 |
︙ | ︙ | |||
66 67 68 69 70 71 72 | stfd f13, 184(r1) bl _object_getClass bl L0 L0: mflr r13 | | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | stfd f13, 184(r1) bl _object_getClass bl L0 L0: mflr r13 addis r13, r13, ha16(L_sel_forwardingTargetForSelector_-L0) lwz r13, lo16(L_sel_forwardingTargetForSelector_-L0)(r13) mr r4, r13 bl _class_respondsToSelector cmpwi r3, 0 beq- fail lwz r3, 216(r1) mr r4, r13 |
︙ | ︙ | |||
168 169 170 171 172 173 174 | mr r3, r4 bl _object_getClass bl L1 L1: mflr r13 | | | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | mr r3, r4 bl _object_getClass bl L1 L1: mflr r13 addis r13, r13, ha16(L_sel_forwardingTargetForSelector_-L1) lwz r13, lo16(L_sel_forwardingTargetForSelector_-L1)(r13) mr r4, r13 bl _class_respondsToSelector cmpwi r3, 0 beq- fail_stret lwz r3, 212(r1) mr r4, r13 |
︙ | ︙ |
Modified src/forwarding/apple-forwarding-x86_64.S from [5bfd2f984d] to [b4c76d8ed5].
︙ | ︙ | |||
14 15 16 17 18 19 20 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __objc_methname, cstring_literals | | | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | * file. */ .globl _of_forward .globl _of_forward_stret .section __TEXT, __objc_methname, cstring_literals L_str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section __DATA, __objc_selrefs, literal_pointers, no_dead_strip L_sel_forwardingTargetForSelector_: .quad L_str_forwardingTargetForSelector_ .section __DATA, __objc_imageinfo, regular, no_dead_strip .long 0, 0 .section __TEXT, __text, regular, pure_instructions _of_forward: pushq %rbp |
︙ | ︙ | |||
50 51 52 53 54 55 56 | movdqa %xmm5, -0xA0(%rbp) movdqa %xmm6, -0xB0(%rbp) movdqa %xmm7, -0xC0(%rbp) call _object_getClass movq %rax, %rdi | | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | movdqa %xmm5, -0xA0(%rbp) movdqa %xmm6, -0xB0(%rbp) movdqa %xmm7, -0xC0(%rbp) call _object_getClass movq %rax, %rdi movq L_sel_forwardingTargetForSelector_(%rip), %rsi call _class_respondsToSelector testq %rax, %rax jz fail movq -0x10(%rbp), %rdi movq L_sel_forwardingTargetForSelector_(%rip), %rsi movq -0x18(%rbp), %rdx call _objc_msgSend movq %rax, %rdi testq %rdi, %rdi jz fail |
︙ | ︙ | |||
123 124 125 126 127 128 129 | movdqa %xmm6, -0xB0(%rbp) movdqa %xmm7, -0xC0(%rbp) movq %rsi, %rdi call _object_getClass movq %rax, %rdi | | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | movdqa %xmm6, -0xB0(%rbp) movdqa %xmm7, -0xC0(%rbp) movq %rsi, %rdi call _object_getClass movq %rax, %rdi movq L_sel_forwardingTargetForSelector_(%rip), %rsi call _class_respondsToSelector testq %rax, %rax jz fail_stret movq -0x18(%rbp), %rdi movq L_sel_forwardingTargetForSelector_(%rip), %rsi movq -0x20(%rbp), %rdx call _objc_msgSend movq %rax, %rsi testq %rsi, %rsi jz fail_stret |
︙ | ︙ |
Modified src/forwarding/forwarding-arm-elf.S from [5a18cdb1fb] to [35b02bf9ed].
︙ | ︙ | |||
18 19 20 21 22 23 24 | .globl of_forward_stret .section .text of_forward: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | .globl of_forward_stret .section .text of_forward: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} ldr r1, sel_forwardingTargetForSelector_$indirect_L0 .L0: add r1, pc stmfd sp!, {r1} bl objc_msg_lookup(PLT) ldmfd sp!, {r1} mov r12, r0 |
︙ | ︙ | |||
47 48 49 50 51 52 53 | .size of_forward, .-of_forward of_forward_stret: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} mov r0, r1 | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | .size of_forward, .-of_forward of_forward_stret: stmfd sp!, {r0-r3, lr} fstmfdd sp!, {d0-d7} mov r0, r1 ldr r1, sel_forwardingTargetForSelector_$indirect_L1 .L1: add r1, pc stmfd sp!, {r1} bl objc_msg_lookup(PLT) ldmfd sp!, {r1} mov r12, r0 |
︙ | ︙ | |||
77 78 79 80 81 82 83 | init: ldr r0, module_indirect_L2 .L2: add r0, pc b __objc_exec_class(PLT) | | | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | init: ldr r0, module_indirect_L2 .L2: add r0, pc b __objc_exec_class(PLT) sel_forwardingTargetForSelector_$indirect_L0: .long sel_forwardingTargetForSelector_-(.L0+8) sel_forwardingTargetForSelector_$indirect_L1: .long sel_forwardingTargetForSelector_-(.L1+8) module_indirect_L2: .long module-(.L2+8) .section .ctors, "a", %progbits .long init |
︙ | ︙ |
Modified src/forwarding/forwarding.S from [fb4a9e7114] to [d78a83049e].
︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "config.h" #ifdef OF_APPLE_RUNTIME # if defined(__x86_64__) # include "apple-forwarding-x86_64.S" # elif defined(__i386__) # include "apple-forwarding-i386.S" # elif defined(__arm__) # include "apple-forwarding-arm.S" # elif defined(__ppc__) # include "apple-forwarding-ppc.S" # endif #else # if defined(__ELF__) | > > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include "config.h" #ifdef OF_APPLE_RUNTIME # if defined(__x86_64__) # include "apple-forwarding-x86_64.S" # elif defined(__i386__) # include "apple-forwarding-i386.S" # elif defined(__ARM64_ARCH_8__) # include "apple-forwarding-arm64.S" # elif defined(__arm__) # include "apple-forwarding-arm.S" # elif defined(__ppc__) # include "apple-forwarding-ppc.S" # endif #else # if defined(__ELF__) |
︙ | ︙ |