michael@0: /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: .section ".text" michael@0: .globl _NS_InvokeByIndex michael@0: .type _NS_InvokeByIndex,@function michael@0: michael@0: /* michael@0: * _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, michael@0: * uint32_t paramCount, nsXPTCVariant* params) michael@0: */ michael@0: michael@0: _NS_InvokeByIndex: michael@0: # set up frame michael@0: stp x29, x30, [sp,#-32]! michael@0: mov x29, sp michael@0: stp x19, x20, [sp,#16] michael@0: michael@0: # save methodIndex across function calls michael@0: mov w20, w1 michael@0: michael@0: # end of stack area passed to invoke_copy_to_stack michael@0: mov x1, sp michael@0: michael@0: # assume 8 bytes of stack for each argument with 16-byte alignment michael@0: add w19, w2, #1 michael@0: and w19, w19, #0xfffffffe michael@0: sub sp, sp, w19, uxth #3 michael@0: michael@0: # temporary place to store args passed in r0-r7,v0-v7 michael@0: sub sp, sp, #128 michael@0: michael@0: # save 'that' on stack michael@0: str x0, [sp] michael@0: michael@0: # start of stack area passed to invoke_copy_to_stack michael@0: mov x0, sp michael@0: bl invoke_copy_to_stack michael@0: michael@0: # load arguments passed in r0-r7 michael@0: ldp x6, x7, [sp, #48] michael@0: ldp x4, x5, [sp, #32] michael@0: ldp x2, x3, [sp, #16] michael@0: ldp x0, x1, [sp],#64 michael@0: michael@0: # load arguments passed in v0-v7 michael@0: ldp d6, d7, [sp, #48] michael@0: ldp d4, d5, [sp, #32] michael@0: ldp d2, d3, [sp, #16] michael@0: ldp d0, d1, [sp],#64 michael@0: michael@0: # call the method michael@0: ldr x16, [x0] michael@0: add x16, x16, w20, uxth #3 michael@0: ldr x16, [x16] michael@0: blr x16 michael@0: michael@0: add sp, sp, w19, uxth #3 michael@0: ldp x19, x20, [sp,#16] michael@0: ldp x29, x30, [sp],#32 michael@0: ret michael@0: michael@0: .size _NS_InvokeByIndex, . - _NS_InvokeByIndex michael@0: michael@0: