Differences From Artifact [f313fe156e]:
- File
src/runtime/lookup-asm/lookup-asm-amd64-macho.S
— part of check-in
[b7a4e61b88]
at
2023-04-22 20:22:08
on branch trunk
— Rename x86_64 to AMD64
It's just a less awkward name and also what the BSDs use. (user: js, size: 1844) [annotate] [blame] [check-ins using] [more...]
- File src/runtime/lookup-asm/lookup-asm-x86_64-macho.S — part of check-in [8939cbdb52] at 2023-01-06 09:04:02 on branch trunk — Update copyright (user: js, size: 1844) [annotate] [blame] [check-ins using]
To Artifact [ca53a90db3]:
- File
src/runtime/lookup-asm/lookup-asm-amd64-macho.S
— part of check-in
[18c524e13d]
at
2023-10-28 18:04:09
on branch trunk
— Move x86/Mach-O assembly to Intel syntax
A workaround for the assembler bugs has been found. (user: js, size: 2087) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
15 16 17 18 19 20 21 22 23 24 25 | #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: | > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | #include "config.h" .globl _objc_msg_lookup .globl _objc_msg_lookup_stret .globl _objc_msg_lookup_super .globl _objc_msg_lookup_super_stret .intel_syntax /* Work around assembler bugs. */ .macro jmp .att_syntax /* Use uppercase instruction to avoid recursion. */ JMP $0 .intel_syntax noprefix .endmacro .macro jz .att_syntax /* Use uppercase instruction to avoid recursion. */ JZ $0 .intel_syntax noprefix .endmacro .section __TEXT, __text, regular, pure_instructions .macro GENERATE_LOOKUP $0: test rdi, rdi jz returnNilMethod test dil, 1 jnz LtaggedPointer_$0 mov r8, [rdi] mov r8, [r8 + 64] Lmain_$0: mov rax, [rsi] movzx ecx, ah movzx edx, al #ifdef OF_SELUID24 shr eax, 16 mov r8, [r8 + 8 * rax] #endif movq r8, [r8 + 8 * rcx] movq rax, [r8 + 8 * rdx] test rax, rax jz $1 ret LtaggedPointer_$0: mov rax, [rip + _objc_taggedPointerSecret@GOTPCREL] xor rdi, [rax] andb dil, 0xE movzx r8d, dil mov rax, [rip + _objc_taggedPointerClasses@GOTPCREL] mov r8, [rax + 4 * r8] mov r8, [r8 + 64] jmp Lmain_$0 .endmacro .macro GENERATE_LOOKUP_SUPER $0: mov r8, rdi mov rdi, [rdi] test rdi, rdi jz returnNilMethod movq r8, [r8 + 8] movq r8, [r8 + 64] jmp Lmain_$1 .endmacro GENERATE_LOOKUP _objc_msg_lookup, _objc_methodNotFound GENERATE_LOOKUP _objc_msg_lookup_stret, _objc_methodNotFound_stret GENERATE_LOOKUP_SUPER _objc_msg_lookup_super, _objc_msg_lookup GENERATE_LOOKUP_SUPER _objc_msg_lookup_super_stret, _objc_msg_lookup_stret returnNilMethod: lea rax, [rip + nilMethod] ret nilMethod: xor rax, rax ret |