xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_aarch64.s

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_aarch64.s	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +        .section ".text"
    1.10 +            .globl _NS_InvokeByIndex
    1.11 +            .type  _NS_InvokeByIndex,@function
    1.12 +
    1.13 +/*
    1.14 + * _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
    1.15 + *                   uint32_t paramCount, nsXPTCVariant* params)
    1.16 + */
    1.17 +
    1.18 +_NS_InvokeByIndex:
    1.19 +            # set up frame
    1.20 +            stp         x29, x30, [sp,#-32]!
    1.21 +            mov         x29, sp
    1.22 +            stp         x19, x20, [sp,#16]
    1.23 +
    1.24 +            # save methodIndex across function calls
    1.25 +            mov         w20, w1
    1.26 +
    1.27 +            # end of stack area passed to invoke_copy_to_stack
    1.28 +            mov         x1, sp
    1.29 +
    1.30 +            # assume 8 bytes of stack for each argument with 16-byte alignment
    1.31 +            add         w19, w2, #1
    1.32 +            and         w19, w19, #0xfffffffe
    1.33 +            sub         sp, sp, w19, uxth #3
    1.34 +
    1.35 +            # temporary place to store args passed in r0-r7,v0-v7
    1.36 +            sub         sp, sp, #128
    1.37 +
    1.38 +            # save 'that' on stack
    1.39 +            str         x0, [sp]
    1.40 +
    1.41 +            # start of stack area passed to invoke_copy_to_stack
    1.42 +            mov         x0, sp
    1.43 +            bl          invoke_copy_to_stack
    1.44 +
    1.45 +            # load arguments passed in r0-r7
    1.46 +            ldp         x6, x7, [sp, #48]
    1.47 +            ldp         x4, x5, [sp, #32]
    1.48 +            ldp         x2, x3, [sp, #16]
    1.49 +            ldp         x0, x1, [sp],#64
    1.50 +
    1.51 +            # load arguments passed in v0-v7
    1.52 +            ldp         d6, d7, [sp, #48]
    1.53 +            ldp         d4, d5, [sp, #32]
    1.54 +            ldp         d2, d3, [sp, #16]
    1.55 +            ldp         d0, d1, [sp],#64
    1.56 +
    1.57 +            # call the method
    1.58 +            ldr         x16, [x0]
    1.59 +            add         x16, x16, w20, uxth #3
    1.60 +            ldr         x16, [x16]
    1.61 +            blr         x16
    1.62 +
    1.63 +            add         sp, sp, w19, uxth #3
    1.64 +            ldp         x19, x20, [sp,#16]
    1.65 +            ldp         x29, x30, [sp],#32
    1.66 +            ret
    1.67 +
    1.68 +            .size _NS_InvokeByIndex, . - _NS_InvokeByIndex
    1.69 +
    1.70 +

mercurial