summaryrefslogtreecommitdiff
path: root/src/vm/arm64
diff options
context:
space:
mode:
authorDavid Wrighton <davidwr@microsoft.com>2018-10-30 18:05:39 -0700
committerGitHub <noreply@github.com>2018-10-30 18:05:39 -0700
commite14a9ad013ad307b282def301cbf86e4252cca16 (patch)
tree6811e0c0148ab8d8706388cb2fc5817640babaf4 /src/vm/arm64
parentf68e75abf03e5a0320d1b9c8af4991ed941a7bba (diff)
downloadcoreclr-e14a9ad013ad307b282def301cbf86e4252cca16.tar.gz
coreclr-e14a9ad013ad307b282def301cbf86e4252cca16.tar.bz2
coreclr-e14a9ad013ad307b282def301cbf86e4252cca16.zip
Add support for large number of argumets in CCW call on Arm64 (#20670)
* Fix CCW with large numbers of arguments on arm64 - Correctly align the stack in COMToCLRDispatchHelper - Add tests for naturally 16 byte aligned stack growth, and non-aligned growth * New many arguments COM test * Add support for the IL stub ETW diagnostic event
Diffstat (limited to 'src/vm/arm64')
-rw-r--r--src/vm/arm64/asmhelpers.asm20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vm/arm64/asmhelpers.asm b/src/vm/arm64/asmhelpers.asm
index 0cbc0a82f4..07e78cbd56 100644
--- a/src/vm/arm64/asmhelpers.asm
+++ b/src/vm/arm64/asmhelpers.asm
@@ -742,12 +742,22 @@ GenericComCallStub_FirstStackAdjust SETA GenericComCallStub_FirstStackAdjust
cbz x0, COMToCLRDispatchHelper_RegSetup
add x9, x1, #SIZEOF__ComMethodFrame
- add x9, x9, x0, LSL #3
+
+ ; Compute number of 8 bytes slots to copy. This is done by rounding up the
+ ; dwStackSlots value to the nearest even value
+ add x0, x0, #1
+ bic x0, x0, #1
+
+ ; Compute how many slots to adjust the address to copy from. Since we
+ ; are copying 16 bytes at a time, adjust by -1 from the rounded value
+ sub x6, x0, #1
+ add x9, x9, x6, LSL #3
+
COMToCLRDispatchHelper_StackLoop
- ldr x8, [x9, #-8]!
- str x8, [sp, #-8]!
- sub x0, x0, #1
- cbnz x0, COMToCLRDispatchHelper_StackLoop
+ ldp x7, x8, [x9], #-16 ; post-index
+ stp x7, x8, [sp, #-16]! ; pre-index
+ subs x0, x0, #2
+ bne COMToCLRDispatchHelper_StackLoop
COMToCLRDispatchHelper_RegSetup