Overview
Comment: | Add forwardingTargetForSelector: for SPARC64/ELF |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
38813c380cb20c9b971ccb03ff56f400 |
User & Date: | js on 2017-08-19 22:47:03 |
Other Links: | manifest | tags |
Context
2017-08-19
| ||
22:47 | PLATFORMS.md: Add SPARC64/ELF to "Forwarding" check-in: dda7d2ceb2 user: js tags: trunk | |
22:47 | Add forwardingTargetForSelector: for SPARC64/ELF check-in: 38813c380c user: js tags: trunk | |
15:54 | Fix a linker warning on OpenBSD/SPARC64 check-in: 7dde89363f user: js tags: trunk | |
Changes
Added src/forwarding/forwarding-sparc64-elf.S version [8b2de66c7f].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 * Jonathan Schleifer <js@heap.zone> * * 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. */ #include "config.h" #include "platform.h" .globl of_forward .globl of_forward_stret #define BIAS 2047 .section .text of_forward: save %sp, -304, %sp /* * Save all floating point registers as they can be used for parameter * passing. */ std %f0, [%sp + BIAS + 176] std %f2, [%sp + BIAS + 184] std %f4, [%sp + BIAS + 192] std %f6, [%sp + BIAS + 200] std %f8, [%sp + BIAS + 208] std %f10, [%sp + BIAS + 216] std %f12, [%sp + BIAS + 224] std %f14, [%sp + BIAS + 232] std %f16, [%sp + BIAS + 240] std %f18, [%sp + BIAS + 248] std %f20, [%sp + BIAS + 256] std %f22, [%sp + BIAS + 264] std %f24, [%sp + BIAS + 272] std %f26, [%sp + BIAS + 280] std %f28, [%sp + BIAS + 288] std %f30, [%sp + BIAS + 296] sethi %hi(_GLOBAL_OFFSET_TABLE_ - 4), %l7 call add_pc add %l7, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %l7 mov %i0, %o0 call object_getClass nop sethi %hi(sel_forwardingTargetForSelector_), %o1 or %o1, %lo(sel_forwardingTargetForSelector_), %o1 ldx [%l7 + %o1], %o1 call class_respondsToSelector nop cmp %o0, 0 be,pn %xcc, 0f nop mov %i0, %o0 sethi %hi(sel_forwardingTargetForSelector_), %o1 or %o1, %lo(sel_forwardingTargetForSelector_), %o1 ldx [%l7 + %o1], %o1 call objc_msg_lookup nop mov %o0, %l0 mov %i0, %o0 sethi %hi(sel_forwardingTargetForSelector_), %o1 or %o1, %lo(sel_forwardingTargetForSelector_), %o1 ldx [%l7 + %o1], %o1 jmpl %l0, %o7 mov %i1, %o2 cmp %o0, 0 be,pn %xcc, 0f nop cmp %o0, %i0 be,pn %xcc, 0f nop mov %o0, %i0 call objc_msg_lookup mov %i1, %o1 /* * Restore all floating point registers as they can be used for * parameter passing. */ ldd [%sp + BIAS + 176], %f0 ldd [%sp + BIAS + 184], %f2 ldd [%sp + BIAS + 192], %f4 ldd [%sp + BIAS + 200], %f6 ldd [%sp + BIAS + 208], %f8 ldd [%sp + BIAS + 216], %f10 ldd [%sp + BIAS + 224], %f12 ldd [%sp + BIAS + 232], %f14 ldd [%sp + BIAS + 240], %f16 ldd [%sp + BIAS + 248], %f18 ldd [%sp + BIAS + 256], %f20 ldd [%sp + BIAS + 264], %f22 ldd [%sp + BIAS + 272], %f24 ldd [%sp + BIAS + 280], %f26 ldd [%sp + BIAS + 288], %f28 ldd [%sp + BIAS + 296], %f30 jmpl %o0, %g0 restore 0: call of_method_not_found restore .type of_forward, %function .size of_forward, .-of_forward of_forward_stret: save %sp, -304, %sp /* * Save all floating point registers as they can be used for parameter * passing. */ std %f0, [%sp + BIAS + 176] std %f2, [%sp + BIAS + 184] std %f4, [%sp + BIAS + 192] std %f6, [%sp + BIAS + 200] std %f8, [%sp + BIAS + 208] std %f10, [%sp + BIAS + 216] std %f12, [%sp + BIAS + 224] std %f14, [%sp + BIAS + 232] std %f16, [%sp + BIAS + 240] std %f18, [%sp + BIAS + 248] std %f20, [%sp + BIAS + 256] std %f22, [%sp + BIAS + 264] std %f24, [%sp + BIAS + 272] std %f26, [%sp + BIAS + 280] std %f28, [%sp + BIAS + 288] std %f30, [%sp + BIAS + 296] sethi %hi(_GLOBAL_OFFSET_TABLE_ - 4), %l7 call add_pc add %l7, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %l7 mov %i1, %o0 call object_getClass nop sethi %hi(sel_forwardingTargetForSelector_), %o1 or %o1, %lo(sel_forwardingTargetForSelector_), %o1 ldx [%l7 + %o1], %o1 call class_respondsToSelector nop cmp %o0, 0 be,pn %xcc, 0f nop mov %i1, %o0 sethi %hi(sel_forwardingTargetForSelector_), %o1 or %o1, %lo(sel_forwardingTargetForSelector_), %o1 ldx [%l7 + %o1], %o1 call objc_msg_lookup nop mov %o0, %l0 mov %i1, %o0 sethi %hi(sel_forwardingTargetForSelector_), %o1 or %o1, %lo(sel_forwardingTargetForSelector_), %o1 ldx [%l7 + %o1], %o1 jmpl %l0, %o7 mov %i2, %o2 cmp %o0, 0 be,pn %xcc, 0f nop cmp %o0, %i1 be,pn %xcc, 0f nop mov %o0, %i1 call objc_msg_lookup mov %i2, %o1 /* * Restore all floating point registers as they can be used for * parameter passing. */ ldd [%sp + BIAS + 176], %f0 ldd [%sp + BIAS + 184], %f2 ldd [%sp + BIAS + 192], %f4 ldd [%sp + BIAS + 200], %f6 ldd [%sp + BIAS + 208], %f8 ldd [%sp + BIAS + 216], %f10 ldd [%sp + BIAS + 224], %f12 ldd [%sp + BIAS + 232], %f14 ldd [%sp + BIAS + 240], %f16 ldd [%sp + BIAS + 248], %f18 ldd [%sp + BIAS + 256], %f20 ldd [%sp + BIAS + 264], %f22 ldd [%sp + BIAS + 272], %f24 ldd [%sp + BIAS + 280], %f26 ldd [%sp + BIAS + 288], %f28 ldd [%sp + BIAS + 296], %f30 jmpl %o0, %g0 restore 0: call of_method_not_found_stret restore .type of_forward_stret, %function .size of_forward_stret, .-of_forward_stret init: save %sp, -176, %sp sethi %hi(_GLOBAL_OFFSET_TABLE_ - 4), %l7 call add_pc add %l7, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %l7 sethi %hi(module), %i0 or %i0, %lo(module), %i0 ldx [%l7 + %i0], %i0 call __objc_exec_class restore add_pc: jmp %o7 + 8 add %l7, %o7, %l7 .section .ctors, "aw", %progbits .xword init .section .rodata str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section .data sel_forwardingTargetForSelector_: .xword str_forwardingTargetForSelector_, 0 .xword 0, 0 symtab: .xword 0, sel_forwardingTargetForSelector_ .half 0, 0 .word 0 .xword 0 module: .xword 8, 32, 0, symtab #ifdef OF_LINUX .section .note.GNU-stack, "", %progbits #endif |
Modified src/forwarding/forwarding.S from [f4783c560e] to [d8dcb8a2a4].
︙ | ︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | # include "forwarding-arm64-elf.S" # elif defined(OF_ARM) # include "forwarding-arm-elf.S" # elif defined(OF_POWERPC) # include "forwarding-ppc-elf.S" # elif defined(OF_MIPS) # include "forwarding-mips-elf.S" # endif # elif defined(OF_MACH_O) # if defined(OF_X86_64) # include "forwarding-x86_64-macho.S" # endif # elif defined(OF_WINDOWS) # if defined(OF_X86_64) # include "forwarding-x86_64-win64.S" # elif defined(OF_X86) # include "forwarding-x86-win32.S" # endif # endif #endif | > > | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | # include "forwarding-arm64-elf.S" # elif defined(OF_ARM) # include "forwarding-arm-elf.S" # elif defined(OF_POWERPC) # include "forwarding-ppc-elf.S" # elif defined(OF_MIPS) # include "forwarding-mips-elf.S" # elif defined(OF_SPARC64) # include "forwarding-sparc64-elf.S" # endif # elif defined(OF_MACH_O) # if defined(OF_X86_64) # include "forwarding-x86_64-macho.S" # endif # elif defined(OF_WINDOWS) # if defined(OF_X86_64) # include "forwarding-x86_64-win64.S" # elif defined(OF_X86) # include "forwarding-x86-win32.S" # endif # endif #endif |
Modified src/macros.h from [b2dbaa72d1] to [dd08d3d070].
︙ | ︙ | |||
286 287 288 289 290 291 292 | # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif #else # if defined(OF_ELF) # if defined(OF_X86_64) || defined(OF_X86) || \ defined(OF_ARM64) || defined(OF_ARM) || defined(OF_POWERPC) || \ | | | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif #else # if defined(OF_ELF) # if defined(OF_X86_64) || defined(OF_X86) || \ defined(OF_ARM64) || defined(OF_ARM) || defined(OF_POWERPC) || \ defined(OF_MIPS) || defined(OF_SPARC64) # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR # if __OBJFW_RUNTIME_ABI__ >= 800 # define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET # endif # endif # elif defined(OF_MACH_O) # if defined(OF_X86_64) |
︙ | ︙ |
Modified tests/ForwardingTests.m from [505a6ff075] to [ebeac08388].
︙ | ︙ | |||
32 33 34 35 36 37 38 | static OFString *module = @"Forwarding"; static size_t forwardings = 0; static bool success = false; static id target = nil; struct stret_test { | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | static OFString *module = @"Forwarding"; static size_t forwardings = 0; static bool success = false; static id target = nil; struct stret_test { char s[1024]; }; @interface ForwardingTest: OFObject @end @interface ForwardingTest (Test) + (void)test; |
︙ | ︙ | |||
168 169 170 171 172 173 174 | OF_ENSURE(self == target); return 12345678.00006103515625; } - (struct stret_test)forwardingTargetStRetTest { | | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | OF_ENSURE(self == target); return 12345678.00006103515625; } - (struct stret_test)forwardingTargetStRetTest { struct stret_test ret = { 0 }; OF_ENSURE(self == target); memcpy(ret.s, "abcdefghijklmnopqrstuvwxyz", 27); return ret; } |
︙ | ︙ |