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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
     6         .section ".text"
     7             .globl _NS_InvokeByIndex
     8             .type  _NS_InvokeByIndex,@function
    10 /*
    11  * _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
    12  *                   uint32_t paramCount, nsXPTCVariant* params)
    13  */
    15 _NS_InvokeByIndex:
    16             # set up frame
    17             stp         x29, x30, [sp,#-32]!
    18             mov         x29, sp
    19             stp         x19, x20, [sp,#16]
    21             # save methodIndex across function calls
    22             mov         w20, w1
    24             # end of stack area passed to invoke_copy_to_stack
    25             mov         x1, sp
    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
    32             # temporary place to store args passed in r0-r7,v0-v7
    33             sub         sp, sp, #128
    35             # save 'that' on stack
    36             str         x0, [sp]
    38             # start of stack area passed to invoke_copy_to_stack
    39             mov         x0, sp
    40             bl          invoke_copy_to_stack
    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
    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
    54             # call the method
    55             ldr         x16, [x0]
    56             add         x16, x16, w20, uxth #3
    57             ldr         x16, [x16]
    58             blr         x16
    60             add         sp, sp, w19, uxth #3
    61             ldp         x19, x20, [sp,#16]
    62             ldp         x29, x30, [sp],#32
    63             ret
    65             .size _NS_InvokeByIndex, . - _NS_InvokeByIndex

mercurial