Skip to content

Commit

Permalink
Bug 1657135 - make aarch64 assembly glue suitable for compiling with …
Browse files Browse the repository at this point in the history
…macOS r=glandium,xpcom-reviewers,nika

Depends on D87007

Differential Revision: https://phabricator.services.mozilla.com/D87008
  • Loading branch information
froydnj committed Aug 18, 2020
1 parent b633392 commit 771807a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
19 changes: 15 additions & 4 deletions xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_aarch64.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

.section ".text"
.globl _NS_InvokeByIndex
#ifdef __APPLE__
#define SYM(x) _ ## x
#else
#define SYM(x) x
#endif

.text
.align 2
.globl SYM(_NS_InvokeByIndex)
#ifndef __APPLE__
.type _NS_InvokeByIndex,@function
#endif

/*
* _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
* uint32_t paramCount, nsXPTCVariant* params)
*/

_NS_InvokeByIndex:
SYM(_NS_InvokeByIndex):
.cfi_startproc
# set up frame
stp x29, x30, [sp,#-32]!
Expand Down Expand Up @@ -44,7 +53,7 @@ _NS_InvokeByIndex:

# start of stack area passed to invoke_copy_to_stack
mov x0, sp
bl invoke_copy_to_stack
bl SYM(invoke_copy_to_stack)

# load arguments passed in r0-r7
ldp x6, x7, [sp, #48]
Expand Down Expand Up @@ -76,6 +85,8 @@ _NS_InvokeByIndex:
ret
.cfi_endproc

#ifndef __APPLE__
.size _NS_InvokeByIndex, . - _NS_InvokeByIndex

.section .note.GNU-stack, "", @progbits
#endif
15 changes: 13 additions & 2 deletions xpcom/reflect/xptcall/md/unix/xptcstubs_asm_aarch64.S
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifdef __APPLE__
#define SYM(x) _ ## x
#else
#define SYM(x) x
#endif

.set NGPREGS,8
.set NFPREGS,8

.section ".text"
.text
.align 2
.globl SharedStub
#ifndef __APPLE__
.hidden SharedStub
.type SharedStub,@function
#endif
SharedStub:
.cfi_startproc
stp x29, x30, [sp,#-16]!
Expand All @@ -35,7 +44,7 @@ SharedStub:
add x3, sp, #8*NFPREGS
add x4, sp, #0

bl PrepareAndDispatch
bl SYM(PrepareAndDispatch)

add sp, sp, #8*(NGPREGS+NFPREGS)
.cfi_def_cfa_register sp
Expand All @@ -46,6 +55,8 @@ SharedStub:
ret
.cfi_endproc

#ifndef __APPLE__
.size SharedStub, . - SharedStub

.section .note.GNU-stack, "", @progbits
#endif

0 comments on commit 771807a

Please sign in to comment.