Fixes dotnet/runtimelab#197.
Ran into this again when curiosity made my try a newly added JIT test with NativeAOT.
EXTERN_C void * RhpCheckedXchgAVLocation;
EXTERN_C void * RhpLockCmpXchg32AVLocation;
EXTERN_C void * RhpLockCmpXchg64AVLocation;
+EXTERN_C void * RhpByRefAssignRefAVLocation1;
+
+#if !defined(HOST_ARM64)
+EXTERN_C void * RhpByRefAssignRefAVLocation2;
+#endif
#if defined(HOST_ARM64) && !defined(LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT)
EXTERN_C void* RhpCheckedLockCmpXchgAVLocation2;
(uintptr_t)&RhpCheckedXchgAVLocation,
(uintptr_t)&RhpLockCmpXchg32AVLocation,
(uintptr_t)&RhpLockCmpXchg64AVLocation,
+ (uintptr_t)&RhpByRefAssignRefAVLocation1,
+#if !defined(HOST_ARM64)
+ (uintptr_t)&RhpByRefAssignRefAVLocation2,
+#endif
#if defined(HOST_ARM64) && !defined(LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT)
(uintptr_t)&RhpCheckedLockCmpXchgAVLocation2,
(uintptr_t)&RhpCheckedXchgAVLocation2,
// rdi, rsi are incremented by 8,
// rcx, r10, r11: trashed
//
+// WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular:
+// - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpByRefAssignRefAVLocation1/2
+// - Function "UnwindSimpleHelperToCaller" assumes the stack contains just the pushed return address
LEAF_ENTRY RhpByRefAssignRef, _TEXT
+ALTERNATE_ENTRY RhpByRefAssignRefAVLocation1
mov rcx, [rsi]
+ALTERNATE_ENTRY RhpByRefAssignRefAVLocation2
mov [rdi], rcx
// Check whether the writes were even into the heap. If not there's no card update required.
;; rdi, rsi are incremented by 8,
;; rcx, r10, r11: trashed
;;
+;; WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular:
+;; - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpByRefAssignRefAVLocation1/2
+;; - Function "UnwindSimpleHelperToCaller" assumes the stack contains just the pushed return address
LEAF_ENTRY RhpByRefAssignRef, _TEXT
+ALTERNATE_ENTRY RhpByRefAssignRefAVLocation1
mov rcx, [rsi]
+ALTERNATE_ENTRY RhpByRefAssignRefAVLocation2
mov [rdi], rcx
;; Check whether the writes were even into the heap. If not there's no card update required.
// r0, r1 are incremented by 4,
// r2, r3: trashed
//
+// WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular:
+// - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpByRefAssignRefAVLocation1/2
+// - Function "UnwindSimpleHelperToCaller" assumes no registers were pushed and LR contains the return address
LEAF_ENTRY RhpByRefAssignRef, _TEXT
// See comment in RhpAssignRef
dmb
+ALTERNATE_ENTRY RhpByRefAssignRefAVLocation1
ldr r2, [r1]
+ALTERNATE_ENTRY RhpByRefAssignRefAVLocation2
str r2, [r0]
// Check whether the writes were even into the heap. If not there's no card update required.
// x15 : trashed
// x12, x17 : trashed
//
+// WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular:
+// - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpByRefAssignRefAVLocation1
+// - Function "UnwindSimpleHelperToCaller" assumes no registers were pushed and LR contains the return address
LEAF_ENTRY RhpByRefAssignRefArm64, _TEXT
+ ALTERNATE_ENTRY RhpByRefAssignRefAVLocation1
ldr x15, [x13], 8
b C_FUNC(RhpCheckedAssignRefArm64)
;; x15 : trashed
;; x12, x17 : trashed
;;
+;; WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular:
+;; - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpByRefAssignRefAVLocation1
+;; - Function "UnwindSimpleHelperToCaller" assumes no registers were pushed and LR contains the return address
LEAF_ENTRY RhpByRefAssignRefArm64, _TEXT
+ ALTERNATE_ENTRY RhpByRefAssignRefAVLocation1
ldr x15, [x13], 8
b RhpCheckedAssignRefArm64
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/CLR-x86-JIT/v2.2/ddb/b429039/b429039/*">
<Issue>https://github.com/dotnet/runtimelab/issues/155: RuntimeHelpers.InitializeArray</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/GitHub_19444/GitHub_19444/*">
- <Issue>https://github.com/dotnet/runtimelab/issues/197</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/GitHub_22583/GitHub_22583/*">
<Issue>https://github.com/dotnet/runtimelab/issues/155: Type equivalence</Issue>
</ExcludeList>