Comment: | Rename AMD64 to x86_64 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
05f4b0a4f07f6988b9e5643e7fa6b2d1 |
User & Date: | js on 2014-02-22 01:14:03 |
Other Links: | manifest | tags |
2014-02-23
| ||
17:54 | Add __attribute__((gnu_inline)) for GCC < 4.3 check-in: 7a1e2de2d4 user: js tags: trunk | |
2014-02-22
| ||
01:14 | Rename AMD64 to x86_64 check-in: 05f4b0a4f0 user: js tags: trunk | |
00:58 | PLATFORMS.md: Add Win64 and Win64 forwarding check-in: 90d8affe47 user: js tags: trunk | |
Modified PLATFORMS.md from [707d93683f] to [593664a739].
︙ | ︙ | |||
149 150 151 152 153 154 155 | ========== As forwarding needs hand-written assembly for each combination of CPU architecture, executable format and calling convention, it is only available for the following platforms (except resolveClassMethod: and resolveInstanceMethod:, which are always available): | < > | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | ========== As forwarding needs hand-written assembly for each combination of CPU architecture, executable format and calling convention, it is only available for the following platforms (except resolveClassMethod: and resolveInstanceMethod:, which are always available): * ARM (EABI/ELF, Apple/Mach-O) * ARM64 (Apple/Mach-O) * MIPS (O32/ELF, EABI/ELF) * PPC (SysV/ELF, EABI/ELF, Apple/Mach-O) * x86 (SysV/ELF, Apple/Mach-O, Win32/PE) * x86_64 (SysV/ELF, Apple/Mach-O, Win64/PE) Apple means both, the Apple ABI and runtime. |
Modified configure.ac from [ee8a5fe8bc] to [5eda03f0e8].
︙ | ︙ | |||
538 539 540 541 542 543 544 | ]) atomic_ops="none" AC_MSG_CHECKING(whether we have an atomic ops assembly implementation) AC_EGREP_CPP(yes, [ #if defined(__GNUC__) && (defined(__i386__) || \ | | | 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | ]) atomic_ops="none" AC_MSG_CHECKING(whether we have an atomic ops assembly implementation) AC_EGREP_CPP(yes, [ #if defined(__GNUC__) && (defined(__i386__) || \ defined(__x86_64__) || defined(__amd64__)) yes #endif ], [ AC_MSG_RESULT(yes) atomic_ops="assembly implementation" ], [ AC_MSG_RESULT(no) |
︙ | ︙ |
Modified src/OFObject.h from [8e073ebf17] to [9b4e14f514].
︙ | ︙ | |||
113 114 115 116 117 118 119 | # 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__) | | | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | # 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(__x86_64__) || defined(__amd64__) || 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 |
︙ | ︙ |
Modified src/atomic.h from [a649199f5c] to [9f476a30f6].
︙ | ︙ | |||
29 30 31 32 33 34 35 | #endif static OF_INLINE int of_atomic_add_int(volatile int *p, int i) { #if !defined(OF_HAVE_THREADS) return (*p += i); | | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #endif static OF_INLINE int of_atomic_add_int(volatile int *p, int i) { #if !defined(OF_HAVE_THREADS) return (*p += i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) if (sizeof(int) == 4) __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %2\n\t" "addl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "lock\n\t" "xaddq %0, %2\n\t" "addq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) |
︙ | ︙ | |||
66 67 68 69 70 71 72 | } static OF_INLINE int32_t of_atomic_add_32(volatile int32_t *p, int32_t i) { #if !defined(OF_HAVE_THREADS) return (*p += i); | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | } static OF_INLINE int32_t of_atomic_add_32(volatile int32_t *p, int32_t i) { #if !defined(OF_HAVE_THREADS) return (*p += i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %2\n\t" "addl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); |
︙ | ︙ | |||
90 91 92 93 94 95 96 | } static OF_INLINE void* of_atomic_add_ptr(void* volatile *p, intptr_t i) { #if !defined(OF_HAVE_THREADS) return (*(char* volatile*)p += i); | | | | | | | | 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 | } static OF_INLINE void* of_atomic_add_ptr(void* volatile *p, intptr_t i) { #if !defined(OF_HAVE_THREADS) return (*(char* volatile*)p += i); #elif defined(OF_X86_64_ASM) __asm__ __volatile__ ( "lock\n\t" "xaddq %0, %2\n\t" "addq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; #elif defined(OF_X86_ASM) __asm__ __volatile__ ( "lock\n\t" "xaddl %0, %2\n\t" "addl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, (void*)i); |
︙ | ︙ | |||
128 129 130 131 132 133 134 | } static OF_INLINE int of_atomic_sub_int(volatile int *p, int i) { #if !defined(OF_HAVE_THREADS) return (*p -= i); | | | | 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 | } static OF_INLINE int of_atomic_sub_int(volatile int *p, int i) { #if !defined(OF_HAVE_THREADS) return (*p -= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) if (sizeof(int) == 4) __asm__ __volatile__ ( "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" "subl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "negq %0\n\t" "lock\n\t" "xaddq %0, %2\n\t" "subq %1, %0" : "+&r"(i) |
︙ | ︙ | |||
167 168 169 170 171 172 173 | } static OF_INLINE int32_t of_atomic_sub_32(volatile int32_t *p, int32_t i) { #if !defined(OF_HAVE_THREADS) return (*p -= i); | | | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | } static OF_INLINE int32_t of_atomic_sub_32(volatile int32_t *p, int32_t i) { #if !defined(OF_HAVE_THREADS) return (*p -= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" "subl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) |
︙ | ︙ | |||
192 193 194 195 196 197 198 199 200 201 202 203 204 205 | } static OF_INLINE void* of_atomic_sub_ptr(void* volatile *p, intptr_t i) { #if !defined(OF_HAVE_THREADS) return (*(char* volatile*)p -= i); #elif defined(OF_X86_ASM) __asm__ __volatile__ ( "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" "subl %1, %0" : "+&r"(i) | > > > > > > > > > > > < < < < < < < < < < < | 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 | } static OF_INLINE void* of_atomic_sub_ptr(void* volatile *p, intptr_t i) { #if !defined(OF_HAVE_THREADS) return (*(char* volatile*)p -= i); #elif defined(OF_X86_64_ASM) __asm__ __volatile__ ( "negq %0\n\t" "lock\n\t" "xaddq %0, %2\n\t" "subq %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; #elif defined(OF_X86_ASM) __asm__ __volatile__ ( "negl %0\n\t" "lock\n\t" "xaddl %0, %2\n\t" "subl %1, %0" : "+&r"(i) : "r"(i), "m"(*p) ); return (void*)i; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, (void*)i); #elif defined(OF_HAVE_OSATOMIC) |
︙ | ︙ | |||
232 233 234 235 236 237 238 | } static OF_INLINE int of_atomic_inc_int(volatile int *p) { #if !defined(OF_HAVE_THREADS) return ++*p; | | | | 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 | } static OF_INLINE int of_atomic_inc_int(volatile int *p) { #if !defined(OF_HAVE_THREADS) return ++*p; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) int i; if (sizeof(int) == 4) __asm__ __volatile__ ( "xorl %0, %0\n\t" "incl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" "incl %0" : "=&r"(i) : "m"(*p) ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "xorq %0, %0\n\t" "incq %0\n\t" "lock\n\t" "xaddq %0, %1\n\t" "incq %0" |
︙ | ︙ | |||
275 276 277 278 279 280 281 | } static OF_INLINE int32_t of_atomic_inc_32(volatile int32_t *p) { #if !defined(OF_HAVE_THREADS) return ++*p; | | | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | } static OF_INLINE int32_t of_atomic_inc_32(volatile int32_t *p) { #if !defined(OF_HAVE_THREADS) return ++*p; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) uint32_t i; __asm__ __volatile__ ( "xorl %0, %0\n\t" "incl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" |
︙ | ︙ | |||
303 304 305 306 307 308 309 | } static OF_INLINE int of_atomic_dec_int(volatile int *p) { #if !defined(OF_HAVE_THREADS) return --*p; | | | | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | } static OF_INLINE int of_atomic_dec_int(volatile int *p) { #if !defined(OF_HAVE_THREADS) return --*p; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) int i; if (sizeof(int) == 4) __asm__ __volatile__ ( "xorl %0, %0\n\t" "decl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" "decl %0" : "=&r"(i) : "m"(*p) ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "xorq %0, %0\n\t" "decq %0\n\t" "lock\n\t" "xaddq %0, %1\n\t" "decq %0" |
︙ | ︙ | |||
346 347 348 349 350 351 352 | } static OF_INLINE int32_t of_atomic_dec_32(volatile int32_t *p) { #if !defined(OF_HAVE_THREADS) return --*p; | | | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | } static OF_INLINE int32_t of_atomic_dec_32(volatile int32_t *p) { #if !defined(OF_HAVE_THREADS) return --*p; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) uint32_t i; __asm__ __volatile__ ( "xorl %0, %0\n\t" "decl %0\n\t" "lock\n\t" "xaddl %0, %1\n\t" |
︙ | ︙ | |||
374 375 376 377 378 379 380 | } static OF_INLINE unsigned int of_atomic_or_int(volatile unsigned int *p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p |= i); | | | | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | } static OF_INLINE unsigned int of_atomic_or_int(volatile unsigned int *p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p |= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) if (sizeof(int) == 4) __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "orl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0\n\t" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "0:\n\t" "movq %2, %0\n\t" "movq %0, %%rax\n\t" "orq %1, %0\n\t" "lock\n\t" |
︙ | ︙ | |||
421 422 423 424 425 426 427 | } static OF_INLINE uint32_t of_atomic_or_32(volatile uint32_t *p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p |= i); | | | 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | } static OF_INLINE uint32_t of_atomic_or_32(volatile uint32_t *p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p |= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "orl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | ︙ | |||
450 451 452 453 454 455 456 | } static OF_INLINE unsigned int of_atomic_and_int(volatile unsigned int *p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p &= i); | | | | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 | } static OF_INLINE unsigned int of_atomic_and_int(volatile unsigned int *p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p &= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) if (sizeof(int) == 4) __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "andl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0\n\t" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "0:\n\t" "movq %2, %0\n\t" "movq %0, %%rax\n\t" "andq %1, %0\n\t" "lock\n\t" |
︙ | ︙ | |||
497 498 499 500 501 502 503 | } static OF_INLINE uint32_t of_atomic_and_32(volatile uint32_t *p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p &= i); | | | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | } static OF_INLINE uint32_t of_atomic_and_32(volatile uint32_t *p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p &= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "andl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | ︙ | |||
526 527 528 529 530 531 532 | } static OF_INLINE unsigned int of_atomic_xor_int(volatile unsigned int *p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p ^= i); | | | | 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | } static OF_INLINE unsigned int of_atomic_xor_int(volatile unsigned int *p, unsigned int i) { #if !defined(OF_HAVE_THREADS) return (*p ^= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) if (sizeof(int) == 4) __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "xorl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" "jne 0\n\t" : "=&r"(i) : "r"(i), "m"(*p) : "eax", "cc" ); # ifdef OF_X86_64_ASM else if (sizeof(int) == 8) __asm__ __volatile__ ( "0:\n\t" "movq %2, %0\n\t" "movq %0, %%rax\n\t" "xorq %1, %0\n\t" "lock\n\t" |
︙ | ︙ | |||
573 574 575 576 577 578 579 | } static OF_INLINE uint32_t of_atomic_xor_32(volatile uint32_t *p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p ^= i); | | | 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 | } static OF_INLINE uint32_t of_atomic_xor_32(volatile uint32_t *p, uint32_t i) { #if !defined(OF_HAVE_THREADS) return (*p ^= i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "xorl %1, %0\n\t" "lock\n\t" "cmpxchgl %0, %2\n\t" |
︙ | ︙ | |||
607 608 609 610 611 612 613 | #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; | | | 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) int r; __asm__ __volatile__ ( "lock\n\t" "cmpxchg %2, %3\n\t" "sete %b0\n\t" "movzbl %b0, %0" |
︙ | ︙ | |||
640 641 642 643 644 645 646 | #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; | | | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 | #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) int r; __asm__ __volatile__ ( "lock\n\t" "cmpxchg %2, %3\n\t" "sete %b0\n\t" "movzbl %b0, %0" |
︙ | ︙ | |||
673 674 675 676 677 678 679 | #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; | | | 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) int r; __asm__ __volatile__ ( "lock\n\t" "cmpxchg %2, %3\n\t" "sete %b0\n\t" "movzbl %b0, %0" |
︙ | ︙ | |||
700 701 702 703 704 705 706 | #endif } static OF_INLINE void of_memory_barrier(void) { #if !defined(OF_HAVE_THREADS) | | | | | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | #endif } static OF_INLINE void of_memory_barrier(void) { #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "mfence" ); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) __sync_synchronize(); #elif defined(OF_HAVE_OSATOMIC) OSMemoryBarrier(); #else # error of_memory_barrier not implemented! #endif } static OF_INLINE void of_memory_read_barrier(void) { #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "lfence" ); #else of_memory_barrier(); #endif } static OF_INLINE void of_memory_write_barrier(void) { #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ __volatile__ ( "sfence" ); #else of_memory_barrier(); #endif } |
Deleted src/forwarding/forwarding-amd64-elf.S version [7cc00abdac].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted src/forwarding/forwarding-amd64-win64.S version [a444a7af93].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added src/forwarding/forwarding-x86_64-elf.S version [7cc00abdac].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 * 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 of_forward: pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0xC0, %rsp /* 16-byte alignment */ movq %rax, -0x8(%rbp) movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movq %r8, -0x30(%rbp) movq %r9, -0x38(%rbp) movdqa %xmm0, -0x50(%rbp) movdqa %xmm1, -0x60(%rbp) movdqa %xmm2, -0x70(%rbp) movdqa %xmm3, -0x80(%rbp) movdqa %xmm4, -0x90(%rbp) movdqa %xmm5, -0xA0(%rbp) movdqa %xmm6, -0xB0(%rbp) movdqa %xmm7, -0xC0(%rbp) call object_getClass@PLT movq %rax, %rdi leaq sel_forwardingTargetForSelector_(%rip), %rsi call class_respondsToSelector@PLT testq %rax, %rax jz 0f movq -0x10(%rbp), %rdi leaq sel_forwardingTargetForSelector_(%rip), %rsi call objc_msg_lookup@PLT movq -0x10(%rbp), %rdi leaq sel_forwardingTargetForSelector_(%rip), %rsi movq -0x18(%rbp), %rdx call *%rax testq %rax, %rax jz 0f cmpq -0x10(%rbp), %rax je 0f movq %rax, -0x10(%rbp) movq %rax, %rdi movq -0x18(%rbp), %rsi call objc_msg_lookup@PLT movq %rax, %r11 /* Restore all arguments */ movdqa -0xC0(%rbp), %xmm7 movdqa -0xB0(%rbp), %xmm6 movdqa -0xA0(%rbp), %xmm5 movdqa -0x90(%rbp), %xmm4 movdqa -0x80(%rbp), %xmm3 movdqa -0x70(%rbp), %xmm2 movdqa -0x60(%rbp), %xmm1 movdqa -0x50(%rbp), %xmm0 movq -0x38(%rbp), %r9 movq -0x30(%rbp), %r8 movq -0x28(%rbp), %rcx movq -0x20(%rbp), %rdx movq -0x18(%rbp), %rsi movq -0x10(%rbp), %rdi movq -0x8(%rbp), %rax movq %rbp, %rsp popq %rbp jmpq *%r11 0: movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi movq %rbp, %rsp popq %rbp jmp of_method_not_found@PLT .type of_forward, %function .size of_forward, .-of_forward of_forward_stret: pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0xC0, %rsp /* 16-byte alignment */ movq %rax, -0x8(%rbp) movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq %rdx, -0x20(%rbp) movq %rcx, -0x28(%rbp) movq %r8, -0x30(%rbp) movq %r9, -0x38(%rbp) movdqa %xmm0, -0x50(%rbp) movdqa %xmm1, -0x60(%rbp) movdqa %xmm2, -0x70(%rbp) movdqa %xmm3, -0x80(%rbp) movdqa %xmm4, -0x90(%rbp) movdqa %xmm5, -0xA0(%rbp) movdqa %xmm6, -0xB0(%rbp) movdqa %xmm7, -0xC0(%rbp) movq %rsi, %rdi call object_getClass@PLT movq %rax, %rdi leaq sel_forwardingTargetForSelector_(%rip), %rsi call class_respondsToSelector@PLT testq %rax, %rax jz 0f movq -0x18(%rbp), %rdi leaq sel_forwardingTargetForSelector_(%rip), %rsi call objc_msg_lookup@PLT movq -0x18(%rbp), %rdi leaq sel_forwardingTargetForSelector_(%rip), %rsi movq -0x20(%rbp), %rdx call *%rax testq %rax, %rax jz 0f cmpq -0x18(%rbp), %rax je 0f movq %rax, -0x18(%rbp) movq %rax, %rdi movq -0x20(%rbp), %rsi call objc_msg_lookup_stret@PLT movq %rax, %r11 /* Restore all arguments */ movdqa -0xC0(%rbp), %xmm7 movdqa -0xB0(%rbp), %xmm6 movdqa -0xA0(%rbp), %xmm5 movdqa -0x90(%rbp), %xmm4 movdqa -0x80(%rbp), %xmm3 movdqa -0x70(%rbp), %xmm2 movdqa -0x60(%rbp), %xmm1 movdqa -0x50(%rbp), %xmm0 movq -0x38(%rbp), %r9 movq -0x30(%rbp), %r8 movq -0x28(%rbp), %rcx movq -0x20(%rbp), %rdx movq -0x18(%rbp), %rsi movq -0x10(%rbp), %rdi movq -0x8(%rbp), %rax movq %rbp, %rsp popq %rbp jmpq *%r11 0: movq -0x10(%rbp), %rdi movq -0x18(%rbp), %rsi movq -0x20(%rbp), %rdx movq %rbp, %rsp popq %rbp jmp of_method_not_found_stret@PLT .type of_forward_stret, %function .size of_forward_stret, .-of_forward_stret init: leaq module(%rip), %rdi jmp __objc_exec_class@PLT .section .ctors, "aw", %progbits .quad init .section .rodata str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section .data sel_forwardingTargetForSelector_: .quad str_forwardingTargetForSelector_, 0 .quad 0, 0 symtab: .quad 0, sel_forwardingTargetForSelector_ .short 0, 0 .long 0 .quad 0 module: .quad 8, 32, 0, symtab #ifdef __linux__ .section .note.GNU-stack, "", %progbits #endif |
Added src/forwarding/forwarding-x86_64-win64.S version [a444a7af93].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 * 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 of_forward: pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0x90, %rsp /* 16-byte alignment */ movq %rax, -0x28(%rbp) movq %rcx, -0x30(%rbp) movq %rdx, -0x38(%rbp) movq %r8, -0x40(%rbp) movq %r9, -0x48(%rbp) movdqa %xmm0, -0x60(%rbp) movdqa %xmm1, -0x70(%rbp) movdqa %xmm2, -0x80(%rbp) movdqa %xmm3, -0x90(%rbp) call object_getClass movq %rax, %rcx leaq sel_forwardingTargetForSelector_(%rip), %rdx call class_respondsToSelector testq %rax, %rax jz 0f movq -0x30(%rbp), %rcx leaq sel_forwardingTargetForSelector_(%rip), %rdx call objc_msg_lookup movq -0x30(%rbp), %rcx leaq sel_forwardingTargetForSelector_(%rip), %rdx movq -0x38(%rbp), %r8 call *%rax testq %rax, %rax jz 0f cmpq -0x30(%rbp), %rax je 0f movq %rax, -0x30(%rbp) movq %rax, %rcx movq -0x38(%rbp), %rdx call objc_msg_lookup movq %rax, %r11 /* Restore all arguments */ movdqa -0x90(%rbp), %xmm3 movdqa -0x80(%rbp), %xmm2 movdqa -0x70(%rbp), %xmm1 movdqa -0x60(%rbp), %xmm0 movq -0x48(%rbp), %r9 movq -0x40(%rbp), %r8 movq -0x38(%rbp), %rdx movq -0x30(%rbp), %rcx movq -0x28(%rbp), %rax movq %rbp, %rsp popq %rbp jmpq *%r11 0: movq -0x30(%rbp), %rcx movq -0x38(%rbp), %rdx movq %rbp, %rsp popq %rbp jmp of_method_not_found of_forward_stret: pushq %rbp movq %rsp, %rbp /* Save all arguments */ subq $0x90, %rsp /* 16-byte alignment */ movq %rax, -0x28(%rbp) movq %rcx, -0x30(%rbp) movq %rdx, -0x38(%rbp) movq %r8, -0x40(%rbp) movq %r9, -0x48(%rbp) movdqa %xmm0, -0x60(%rbp) movdqa %xmm1, -0x70(%rbp) movdqa %xmm2, -0x80(%rbp) movdqa %xmm3, -0x90(%rbp) movq %rdx, %rcx call object_getClass movq %rax, %rcx leaq sel_forwardingTargetForSelector_(%rip), %rdx call class_respondsToSelector testq %rax, %rax jz 0f movq -0x38(%rbp), %rcx leaq sel_forwardingTargetForSelector_(%rip), %rdx call objc_msg_lookup movq -0x38(%rbp), %rcx leaq sel_forwardingTargetForSelector_(%rip), %rdx movq -0x40(%rbp), %r8 call *%rax testq %rax, %rax jz 0f cmpq -0x38(%rbp), %rax je 0f movq %rax, -0x38(%rbp) movq %rax, %rcx movq -0x40(%rbp), %rdx call objc_msg_lookup_stret@PLT movq %rax, %r11 /* Restore all arguments */ movdqa -0x90(%rbp), %xmm3 movdqa -0x80(%rbp), %xmm2 movdqa -0x70(%rbp), %xmm1 movdqa -0x60(%rbp), %xmm0 movq -0x48(%rbp), %r9 movq -0x40(%rbp), %r8 movq -0x38(%rbp), %rdx movq -0x30(%rbp), %rcx movq -0x28(%rbp), %rax movq %rbp, %rsp popq %rbp jmpq *%r11 0: movq -0x30(%rbp), %rcx movq -0x38(%rbp), %rdx movq -0x40(%rbp), %r8 movq %rbp, %rsp popq %rbp jmp of_method_not_found_stret init: leaq module(%rip), %rcx jmp __objc_exec_class .section .ctors, "aw" .quad init .section .rodata str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section .data sel_forwardingTargetForSelector_: .quad str_forwardingTargetForSelector_, 0 .quad 0, 0 symtab: .long 0, 0 .quad sel_forwardingTargetForSelector_ .short 0, 0 .long 0 .quad 0 module: .long 8, 32 .quad 0, symtab |
Modified src/forwarding/forwarding.S from [ca904fa35a] to [a0b3d7cc15].
︙ | ︙ | |||
26 27 28 29 30 31 32 | # elif defined(__arm__) # include "apple-forwarding-arm.S" # elif defined(__ppc__) # include "apple-forwarding-ppc.S" # endif #else # if defined(__ELF__) | | | | | 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 | # elif defined(__arm__) # include "apple-forwarding-arm.S" # elif defined(__ppc__) # include "apple-forwarding-ppc.S" # endif #else # if defined(__ELF__) # if defined(__x86_64__) || defined(__amd64__) # include "forwarding-x86_64-elf.S" # elif defined(__i386__) # include "forwarding-x86-elf.S" # elif defined(__arm__) || defined(__ARM__) # include "forwarding-arm-elf.S" # elif defined(__ppc__) || defined(__PPC__) # include "forwarding-ppc-elf.S" # elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \ (defined(__mips_eabi) && _MIPS_SZPTR == 32) # include "forwarding-mips-elf.S" # endif # elif defined(_WIN32) # if defined(__x86_64__) # include "forwarding-x86_64-win64.S" # elif defined(__i386__) # include "forwarding-x86-win32.S" # endif # endif #endif |
Modified src/macros.h from [0fd9e55556] to [e55751e201].
︙ | ︙ | |||
62 63 64 65 66 67 68 | # else # /* Hopefully no arch needs more than 16 bytes padding */ # define OF_BIGGEST_ALIGNMENT 16 # endif #endif #ifdef __GNUC__ | | | | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | # else # /* Hopefully no arch needs more than 16 bytes padding */ # define OF_BIGGEST_ALIGNMENT 16 # endif #endif #ifdef __GNUC__ # if defined(__x86_64__) || defined(__amd64__) # define OF_X86_64_ASM # elif defined(__i386__) # define OF_X86_ASM # elif defined(__ppc__) || defined(__PPC__) # define OF_PPC_ASM # elif defined(__arm__) || defined(__ARM__) # define OF_ARM_ASM # ifdef __ARM_ARCH_7__ |
︙ | ︙ | |||
199 200 201 202 203 204 205 | (i & UINT64_C(0x000000000000FF00)) << 40 | (i & UINT64_C(0x00000000000000FF)) << 56; } static OF_INLINE uint16_t OF_CONST_FUNC OF_BSWAP16_NONCONST(uint16_t i) { | | | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | (i & UINT64_C(0x000000000000FF00)) << 40 | (i & UINT64_C(0x00000000000000FF)) << 56; } static OF_INLINE uint16_t OF_CONST_FUNC OF_BSWAP16_NONCONST(uint16_t i) { #if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ ( "xchgb %h0, %b0" : "=Q"(i) : "0"(i) ); #elif defined(OF_PPC_ASM) __asm__ ( |
︙ | ︙ | |||
227 228 229 230 231 232 233 | #endif return i; } static OF_INLINE uint32_t OF_CONST_FUNC OF_BSWAP32_NONCONST(uint32_t i) { | | | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | #endif return i; } static OF_INLINE uint32_t OF_CONST_FUNC OF_BSWAP32_NONCONST(uint32_t i) { #if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ ( "bswap %0" : "=q"(i) : "0"(i) ); #elif defined(OF_PPC_ASM) __asm__ ( |
︙ | ︙ | |||
257 258 259 260 261 262 263 | #endif return i; } static OF_INLINE uint64_t OF_CONST_FUNC OF_BSWAP64_NONCONST(uint64_t i) { | | | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | #endif return i; } static OF_INLINE uint64_t OF_CONST_FUNC OF_BSWAP64_NONCONST(uint64_t i) { #if defined(OF_X86_64_ASM) __asm__ ( "bswap %0" : "=r"(i) : "0"(i) ); #elif defined(OF_X86_ASM) __asm__ ( |
︙ | ︙ |
Deleted src/runtime/lookup-asm/lookup-asm-amd64-elf.S version [12b1d6de58].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted src/runtime/lookup-asm/lookup-asm-amd64-macho.S version [f898194a7d].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted src/runtime/lookup-asm/lookup-asm-amd64-win64.S version [0e61521df8].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added src/runtime/lookup-asm/lookup-asm-x86_64-elf.S version [12b1d6de58].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 * 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. */ #include "config.h" .globl objc_msg_lookup .globl objc_msg_lookup_stret .globl objc_msg_lookup_super .globl objc_msg_lookup_super_stret .section .text .macro generate_lookup name not_found \name: testq %rdi, %rdi jz ret_nil movq (%rdi), %r8 movq 64(%r8), %r8 .Lmain_\name: movq (%rsi), %rax movzbl %ah, %ecx movzbl %al, %edx #ifdef OF_SELUID24 shrl $16, %eax movq (%r8,%rax,8), %r8 #endif movq (%r8,%rcx,8), %r8 movq (%r8,%rdx,8), %rax testq %rax, %rax jz \not_found@PLT ret .type \name, %function .size \name, .-\name .endm .macro generate_lookup_super name lookup \name: movq (%rdi), %rax testq %rax, %rax jz ret_nil movq 8(%rdi), %r8 movq 64(%r8), %r8 jmp .Lmain_\lookup .type \name, %function .size \name, .-\name .endm generate_lookup objc_msg_lookup objc_method_not_found generate_lookup objc_msg_lookup_stret objc_method_not_found_stret generate_lookup_super objc_msg_lookup_super objc_msg_lookup generate_lookup_super objc_msg_lookup_super_stret objc_msg_lookup_stret ret_nil: leaq nil_method(%rip), %rax ret nil_method: xorq %rax, %rax ret #ifdef __linux__ .section .note.GNU-stack, "", %progbits #endif |
Added src/runtime/lookup-asm/lookup-asm-x86_64-macho.S version [f898194a7d].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 * 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. */ #include "config.h" .globl _objc_msg_lookup .globl _objc_msg_lookup_stret .globl _objc_msg_lookup_super .globl _objc_msg_lookup_super_stret .section __TEXT, __text, regular, pure_instructions .macro generate_lookup $0: testq %rdi, %rdi jz ret_nil movq (%rdi), %r8 movq 64(%r8), %r8 Lmain_$0: movq (%rsi), %rax movzbl %ah, %ecx movzbl %al, %edx #ifdef OF_SELUID24 shrl $16, %eax movq (%r8,%rax,8), %r8 #endif movq (%r8,%rcx,8), %r8 movq (%r8,%rdx,8), %rax testq %rax, %rax jz $1 ret .endmacro .macro generate_lookup_super $0: movq (%rdi), %rax testq %rax, %rax jz ret_nil movq 8(%rdi), %r8 movq 64(%r8), %r8 jmp Lmain_$1 .endmacro generate_lookup _objc_msg_lookup, _objc_method_not_found generate_lookup _objc_msg_lookup_stret, _objc_method_not_found_stret generate_lookup_super _objc_msg_lookup_super, _objc_msg_lookup generate_lookup_super _objc_msg_lookup_super_stret, _objc_msg_lookup_stret ret_nil: leaq nil_method(%rip), %rax ret nil_method: movq %rdi, %rax ret |
Added src/runtime/lookup-asm/lookup-asm-x86_64-win64.S version [0e61521df8].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | /* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 * 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. */ #include "config.h" .globl objc_msg_lookup .globl objc_msg_lookup_stret .globl objc_msg_lookup_super .globl objc_msg_lookup_super_stret .section .text .macro generate_lookup name not_found \name: testq %rcx, %rcx jz ret_nil movq (%rcx), %r8 movq 56(%r8), %r8 .Lmain_\name: movq %rcx, %r10 movq %rdx, %r11 movq (%rdx), %rax movzbl %ah, %ecx movzbl %al, %edx #ifdef OF_SELUID24 shrl $16, %eax movq (%r8,%rax,8), %r8 #endif movq (%r8,%rcx,8), %r8 movq (%r8,%rdx,8), %rax testq %rax, %rax jz 0f ret 0: movq %r10, %rcx movq %r11, %rdx jmp \not_found .endm .macro generate_lookup_super name lookup \name: movq (%rcx), %rax testq %rax, %rax jz ret_nil movq 8(%rcx), %r8 movq 56(%r8), %r8 jmp .Lmain_\lookup .endm generate_lookup objc_msg_lookup objc_method_not_found generate_lookup objc_msg_lookup_stret objc_method_not_found_stret generate_lookup_super objc_msg_lookup_super objc_msg_lookup generate_lookup_super objc_msg_lookup_super_stret objc_msg_lookup_stret ret_nil: leaq nil_method(%rip), %rax ret nil_method: xorq %rax, %rax ret |
Modified src/runtime/lookup-asm/lookup-asm.S from [fd112afaa8] to [0b17d4b290].
︙ | ︙ | |||
13 14 15 16 17 18 19 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #if defined(__ELF__) | | | | | | 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 | * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #if defined(__ELF__) # if defined(__x86_64__) || defined(__amd64__) # include "lookup-asm-x86_64-elf.S" # elif defined(__i386__) # include "lookup-asm-x86-elf.S" # elif defined(__arm__) || defined(__ARM__) # include "lookup-asm-arm-elf.S" # elif defined(__ppc__) || defined(__PPC__) # include "lookup-asm-ppc-elf.S" # elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \ (defined(__mips_eabi) && _MIPS_SZPTR == 32) # include "lookup-asm-mips-elf.S" # endif #elif defined(__MACH__) # if defined(__x86_64__) # include "lookup-asm-x86_64-macho.S" # elif defined(__ppc__) # include "lookup-asm-ppc-macho.S" # endif #elif defined(_WIN32) # if defined(__x86_64__) # include "lookup-asm-x86_64-win64.S" # elif defined(__i386__) # include "lookup-asm-x86-win32.S" # endif #endif |
Modified src/runtime/runtime-private.h from [bccc1d0efc] to [0e0bd3f946].
︙ | ︙ | |||
172 173 174 175 176 177 178 | uint8_t j = idx; return (void*)s->buckets[i]->buckets[j]; #endif } #if defined(__ELF__) | | | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | uint8_t j = idx; return (void*)s->buckets[i]->buckets[j]; #endif } #if defined(__ELF__) # if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) || \ defined(__ppc__) || defined(__PPC__) || defined(__arm__) || \ defined(__ARM__) # define OF_ASM_LOOKUP # endif # if (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \ (defined(__mips_eabi) && _MIPS_SZPTR == 32) # define OF_ASM_LOOKUP |
︙ | ︙ |