Fix non-Windows assembly code to match Windows calldescr/arg reg changes.
authorAditya Mandaleeka <adityam@microsoft.com>
Wed, 8 Aug 2018 00:47:43 +0000 (17:47 -0700)
committerAditya Mandaleeka <adityam@microsoft.com>
Wed, 8 Aug 2018 00:47:43 +0000 (17:47 -0700)
src/vm/arm64/asmhelpers.S
src/vm/arm64/calldescrworkerarm64.S

index 23f591f..ac6f965 100644 (file)
@@ -562,7 +562,7 @@ LEAF_END SinglecastDelegateInvokeStub, _TEXT
 #ifdef FEATURE_COMINTEROP
 
 #define ComCallPreStub_FrameSize (SIZEOF__GSCookie + SIZEOF__ComMethodFrame)
-#define ComCallPreStub_FirstStackAdjust  (SIZEOF__ArgumentRegisters + 2 * 8) // reg args , fp & lr already pushed
+#define ComCallPreStub_FirstStackAdjust  (8 + SIZEOF__ArgumentRegisters + 2 * 8) // x8, reg args , fp & lr already pushed
 #define ComCallPreStub_StackAlloc0        (ComCallPreStub_FrameSize - ComCallPreStub_FirstStackAdjust)
 #define ComCallPreStub_StackAlloc1        (ComCallPreStub_StackAlloc0 + SIZEOF__FloatArgumentRegisters + 8)// 8 for ErrorReturn
 #define ComCallPreStub_StackAlloc    (ComCallPreStub_StackAlloc1 + (ComCallPreStub_StackAlloc1 & 8))
@@ -692,7 +692,7 @@ COMToCLRDispatchHelper_RegSetup
     ldp x2, x3, [x1, #(SIZEOF__ComMethodFrame - SIZEOF__ArgumentRegisters + 16)]
     ldp x4, x5, [x1, #(SIZEOF__ComMethodFrame - SIZEOF__ArgumentRegisters + 32)]
     ldp x6, x7, [x1, #(SIZEOF__ComMethodFrame - SIZEOF__ArgumentRegisters + 48)]
-    ldr x8, [x1, #(SIZEOF__ComMethodFrame - SIZEOF__ArgumentRegisters + 64)]
+    ldr x8, [x1, #(SIZEOF__ComMethodFrame - SIZEOF__ArgumentRegisters - 8)]
 
     ldr x1, [x1, #(SIZEOF__ComMethodFrame - SIZEOF__ArgumentRegisters + 8)]
 
index 5bcad2f..c3ce06a 100644 (file)
@@ -62,7 +62,10 @@ LOCAL_LABEL(NoFloatingPoint):
     ldp     x2, x3, [x9, #16]
     ldp     x4, x5, [x9, #32]
     ldp     x6, x7, [x9, #48]
-    ldr     x8, [x9, #64]
+
+    // Copy pRetBuffArg into x8
+    ldr     x9, [x19,#CallDescrData__pRetBuffArg]
+    ldr     x8, [x9]
 
     // call pTarget
     ldr     x9, [x19,#CallDescrData__pTarget]