@@ -12,72 +12,74 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" + +.intel_syntax noprefix .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 notFound \name: - movl 4(%esp), %edx - testl %edx, %edx - jz returnNilMethod - - testb $1, %dl - jnz .LtaggedPointer_\name - - movl (%edx), %edx - movl 32(%edx), %edx + mov edx, [esp + 4] + test edx, edx + jz short returnNilMethod + + test dl, 1 + jnz short .LtaggedPointer_\name + + mov edx, [edx] + mov edx, [edx + 32] .Lmain_\name: - movl 8(%esp), %eax + mov eax, [esp + 8] #ifdef OF_SELUID24 - movzbl 2(%eax), %ecx - movl (%edx,%ecx,4), %edx + movzx ecx, byte ptr [eax + 2] + mov edx, [edx + 4 * ecx] #endif - movzbl 1(%eax), %ecx - movl (%edx,%ecx,4), %edx - movzbl (%eax), %ecx - movl (%edx,%ecx,4), %eax + movzx ecx, byte ptr [eax + 1] + mov edx, [edx + 4 * ecx] + movzx ecx, byte ptr [eax] + mov eax, [edx + 4 * ecx] - testl %eax, %eax - jz \notFound + test eax, eax + jz short \notFound ret .LtaggedPointer_\name: - xorl _objc_taggedPointerSecret, %edx - andb $0xE, %dl - movzbl %dl, %edx - - movl _objc_taggedPointerClasses(,%edx,2), %edx - movl 32(%edx), %edx - - jmp .Lmain_\name + xor edx, _objc_taggedPointerSecret + and dl, 0xE + movzx edx, dl + + mov edx, [_objc_taggedPointerClasses + 2 * edx] + mov edx, [edx + 32] + + jmp short .Lmain_\name .def \name .scl 2 .type 32 .endef .endm .macro GENERATE_LOOKUP_SUPER name lookup \name: - movl 4(%esp), %edx - movl (%edx), %eax - test %eax, %eax - jz returnNilMethod - - movl %eax, 4(%esp) - movl 4(%edx), %edx - movl 32(%edx), %edx - jmp .Lmain_\lookup + mov edx, [esp + 4] + mov eax, [edx] + test eax, eax + jz short returnNilMethod + + mov [esp + 4], eax + mov edx, [edx + 4] + mov edx, [edx + 32] + jmp short .Lmain_\lookup .def \name .scl 2 .type 32 .endef .endm @@ -86,11 +88,11 @@ 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: - movl $nilMethod, %eax + mov eax, offset nilMethod ret nilMethod: - xorl %eax, %eax + xor eax, eax ret