Bug 1527471 - part 2 - generate unwind data for xptcall aarch64 windows routines; r=dmajor, a=lizzard
authorNathan Froyd <froydnj@mozilla.com>
Thu, 14 Feb 2019 20:34:53 +0000
changeset 516096 8d7fe5194e9399f47dd1a3abe65722c6b03cf78d
parent 516095 37dca6044dcba5ce00e928ce363f63a0f2118542
child 516097 c6abdbd324f774a4e3fe0edf7dcb2a5fa03f26eb
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor, lizzard
bugs1527471
milestone66.0
Bug 1527471 - part 2 - generate unwind data for xptcall aarch64 windows routines; r=dmajor, a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D19820
xpcom/reflect/xptcall/md/win32/xptcinvoke_asm_aarch64.asm
xpcom/reflect/xptcall/md/win32/xptcstubs_asm_aarch64.asm
--- a/xpcom/reflect/xptcall/md/win32/xptcinvoke_asm_aarch64.asm
+++ b/xpcom/reflect/xptcall/md/win32/xptcinvoke_asm_aarch64.asm
@@ -1,25 +1,27 @@
 ; This Source Code Form is subject to the terms of the Mozilla Public
 ; 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/.
 
-	AREA |.text|, CODE, ARM64
+#include "ksarm64.h"
+
 	IMPORT |invoke_copy_to_stack|
-	EXPORT |XPTC__InvokebyIndex|
+	TEXTAREA
 
 ;
 ;XPTC__InvokebyIndex(nsISupports* that, uint32_t methodIndex,
 ;                   uint32_t paramCount, nsXPTCVariant* params)
 ;
-|XPTC__InvokebyIndex| PROC
+
+	NESTED_ENTRY XPTC__InvokebyIndex
+
 	; set up frame
-	stp         x29, x30, [sp,#-32]!
-	mov         x29, sp
-	stp         x19, x20, [sp,#16]
+	PROLOG_SAVE_REG_PAIR fp, lr, #-32!
+	PROLOG_SAVE_REG_PAIR x19, x20, #16
 
 	; save methodIndex across function calls
 	mov         w20, w1
 
 	; end of stack area passed to invoke_copy_to_stack
 	mov         x1, sp
 
 	; assume 8 bytes of stack for each argument with 16-byte alignment
@@ -50,15 +52,15 @@
 	ldp         d0, d1, [sp],#64
 
 	; call the method
 	ldr         x16, [x0]
 	add         x16, x16, w20, uxth #3
 	ldr         x16, [x16]
 	blr         x16
 
-	add         sp, sp, w19, uxth #3
-	ldp         x19, x20, [sp,#16]
-	ldp         x29, x30, [sp],#32
-	ret
+	EPILOG_STACK_RESTORE
+	EPILOG_RESTORE_REG_PAIR x19, x20, #16
+	EPILOG_RESTORE_REG_PAIR x29, x30, #32!
+	EPILOG_RETURN
 
-        ENDP
+	NESTED_END XPTC__InvokebyIndex
 	END
--- a/xpcom/reflect/xptcall/md/win32/xptcstubs_asm_aarch64.asm
+++ b/xpcom/reflect/xptcall/md/win32/xptcstubs_asm_aarch64.asm
@@ -1,21 +1,24 @@
 ; This Source Code Form is subject to the terms of the Mozilla Public
 ; 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/.
 
+#include "ksarm64.h"
+
 NGPREGS EQU 8
 NFPREGS EQU 8
 
-	AREA |.text|, CODE, ARM64
 	IMPORT |PrepareAndDispatch|
 
-|SharedStub| PROC
-	stp         x29, x30, [sp,#-16]!
-	mov         x29, sp
+	TEXTAREA
+
+	NESTED_ENTRY SharedStub
+
+	PROLOG_SAVE_REG_PAIR x29, x30, #-16!
 
 	sub         sp, sp, #128 ; 8*(NGPREGS+NFPREGS)
 	stp         x0, x1, [sp, #64+(0*8)]
 	stp         x2, x3, [sp, #64+(2*8)]
 	stp         x4, x5, [sp, #64+(4*8)]
 	stp         x6, x7, [sp, #64+(6*8)]
 	stp         d0, d1, [sp, #(0*8)]
 	stp         d2, d3, [sp, #(2*8)]
@@ -26,29 +29,35 @@ NFPREGS EQU 8
 	mov         w1, w17
 
 	add         x2, sp, #144 ; 16+(8*(NGPREGS+NFPREGS))
 	add         x3, sp, #64 ; 8*NFPREGS
 	add         x4, sp, #0
 
 	bl          PrepareAndDispatch
 
-	add         sp, sp, #128 ; 8*(NGPREGS+NFPREGS)
-	ldp         x29, x30, [sp],#16
-	ret
-	ENDP
+	EPILOG_STACK_RESTORE
+	EPILOG_RESTORE_REG_PAIR x29, x30, #16!
+	EPILOG_RETURN
+
+	NESTED_END SharedStub
 
 
 	MACRO
 	STUBENTRY $functionname, $paramcount
 	EXPORT |$functionname|
-|$functionname| PROC
+	TEXTAREA
+
+	LEAF_ENTRY |$functionname|
+
 	mov	w17, $paramcount
 	b	SharedStub
-	ENDP
+
+	LEAF_END |$functionname|
+
 	MEND
 
     STUBENTRY ?Stub3@nsXPTCStubBase@@UEAA?AW4nsresult@@XZ, 3
     STUBENTRY ?Stub4@nsXPTCStubBase@@UEAA?AW4nsresult@@XZ, 4
     STUBENTRY ?Stub5@nsXPTCStubBase@@UEAA?AW4nsresult@@XZ, 5
     STUBENTRY ?Stub6@nsXPTCStubBase@@UEAA?AW4nsresult@@XZ, 6
     STUBENTRY ?Stub7@nsXPTCStubBase@@UEAA?AW4nsresult@@XZ, 7
     STUBENTRY ?Stub8@nsXPTCStubBase@@UEAA?AW4nsresult@@XZ, 8