Artifact 09fe8e02cc7c6080926be8c25aadaf1f0dbfb80f386ef6157438c3854f36e223:
- File
src/forwarding/forwarding-arm64-elf.S
— part of check-in
[21244a7e62]
at
2024-02-24 22:30:47
on branch 1.0
— Use `bti c` instead of `bti jc`
The `j` isn't necessary, as tail call eliminations can just use x16/x17,
which allow any type. (user: js, size: 2592) [annotate] [blame] [check-ins using] [more...]
/* * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im> * * 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 OFForward .globl OFForward_stret .section .text OFForward: OFForward_stret: #ifdef HAVE_BTI bti c #endif 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, sel_forwardingTargetForSelector_ add x19, x19, :lo12:sel_forwardingTargetForSelector_ mov x1, x19 bl class_respondsToSelector cbz x0, 0f ldr x0, [sp] mov x1, x19 bl objc_msg_lookup mov x1, x19 mov x19, x0 ldp x0, x2, [sp] blr x19 cbz x0, 0f ldr x1, [sp] cmp x0, x1 b.eq 0f mov x19, x0 ldr x1, [sp, #8] bl objc_msg_lookup mov x16, x0 mov x0, x19 /* 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 br x16 0: ldp x0, x1, [sp] ldr x19, [sp, #72] mov sp, fp ldp fp, lr, [sp], #208 b OFMethodNotFound .type OFForward, %function .size OFForward, .-OFForward .type OFForward_stret, %function .size OFForward_stret, .-OFForward_stret init: #ifdef HAVE_BTI bti c #endif adrp x0, module add x0, x0, :lo12:module b __objc_exec_class .section .init_array, "aw", %init_array .xword init .section .rodata str_forwardingTargetForSelector_: .asciz "forwardingTargetForSelector:" .section .data sel_forwardingTargetForSelector_: .xword str_forwardingTargetForSelector_, 0 .xword 0, 0 symtab: .xword 0, sel_forwardingTargetForSelector_ .short 0, 0 .long 4 .xword 0 module: .xword 8, 32, 0, symtab #if defined(OF_LINUX) || defined(OF_HAIKU) || defined(OF_HURD) .section .note.GNU-stack, "", %progbits #endif