|
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 .section ".text" |
|
7 .globl _NS_InvokeByIndex |
|
8 .type _NS_InvokeByIndex,@function |
|
9 |
|
10 /* |
|
11 * _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, |
|
12 * uint32_t paramCount, nsXPTCVariant* params) |
|
13 */ |
|
14 |
|
15 _NS_InvokeByIndex: |
|
16 # set up frame |
|
17 stp x29, x30, [sp,#-32]! |
|
18 mov x29, sp |
|
19 stp x19, x20, [sp,#16] |
|
20 |
|
21 # save methodIndex across function calls |
|
22 mov w20, w1 |
|
23 |
|
24 # end of stack area passed to invoke_copy_to_stack |
|
25 mov x1, sp |
|
26 |
|
27 # assume 8 bytes of stack for each argument with 16-byte alignment |
|
28 add w19, w2, #1 |
|
29 and w19, w19, #0xfffffffe |
|
30 sub sp, sp, w19, uxth #3 |
|
31 |
|
32 # temporary place to store args passed in r0-r7,v0-v7 |
|
33 sub sp, sp, #128 |
|
34 |
|
35 # save 'that' on stack |
|
36 str x0, [sp] |
|
37 |
|
38 # start of stack area passed to invoke_copy_to_stack |
|
39 mov x0, sp |
|
40 bl invoke_copy_to_stack |
|
41 |
|
42 # load arguments passed in r0-r7 |
|
43 ldp x6, x7, [sp, #48] |
|
44 ldp x4, x5, [sp, #32] |
|
45 ldp x2, x3, [sp, #16] |
|
46 ldp x0, x1, [sp],#64 |
|
47 |
|
48 # load arguments passed in v0-v7 |
|
49 ldp d6, d7, [sp, #48] |
|
50 ldp d4, d5, [sp, #32] |
|
51 ldp d2, d3, [sp, #16] |
|
52 ldp d0, d1, [sp],#64 |
|
53 |
|
54 # call the method |
|
55 ldr x16, [x0] |
|
56 add x16, x16, w20, uxth #3 |
|
57 ldr x16, [x16] |
|
58 blr x16 |
|
59 |
|
60 add sp, sp, w19, uxth #3 |
|
61 ldp x19, x20, [sp,#16] |
|
62 ldp x29, x30, [sp],#32 |
|
63 ret |
|
64 |
|
65 .size _NS_InvokeByIndex, . - _NS_InvokeByIndex |
|
66 |
|
67 |