Skip to content

Commit b6f17be

Browse files
davidwrightonfilipnavara
authored andcommitted
Builds with write barrier moved
More adjustment In theory all mucked up to make this work on Windows Amd64... Or at least, somewhat close. Fix config settings for write barrier Get the Arm64 build to work on Windows Fix arm64 build Fix arm build Fix RiscV build Fix Loongarch64 build Fix Windows X86 build Attempt to fix Windows Arm64 and Windows X86 issues Attempt to fix Linux Arm build Fix Linux Arm32 Alternative approach to fixing the EH issue that may fix OSX as well. If it does... I'll likely do this logic for all architectures Revert "Alternative approach to fixing the EH issue that may fix OSX as well. If it does... I'll likely do this logic for all architectures" This reverts commit a882fbf. Fix the Linux Arm32 Rhp write barrier to support FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP Remove ALTERNATE_ENTRY AVLocations Reapply "Alternative approach to fixing the EH issue that may fix OSX as well. If it does... I'll likely do this logic for all architectures" This reverts commit f5a07a7. Use the different style of lookup only on apple platforms on CoreCLR Fix build breaks Go back to using AVLocation alternate entries (The stae of Fix th Linux RhpWriteBarrier to support FEATURE_USE_SORTWARE_WRITE_WATCH Attempt to fix arm32 build issue Attempt to fix NullRefernce problem by moving ALTERNATE_ENTRY to start of all functions that use them on Apple platforms. Experiments indicate this should work without messing with any of the general purpose code. Fix Windows X86 build Linux X86 builds, and probably works Fix arm build Attempt to workaround build failures on apple platforms Sigh... Fix more build breaks Put the write watch table update in the right spot
1 parent 4a75bea commit b6f17be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1000
-264
lines changed

src/coreclr/inc/clrconfigvalues.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ CONFIG_DWORD_INFO(INTERNAL_FastGCCheckStack, W("FastGCCheckStack"), 0, "")
254254
CONFIG_DWORD_INFO(INTERNAL_FastGCStress, W("FastGCStress"), 0, "Reduce the number of GCs done by enabling GCStress")
255255
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCBreakOnOOM, W("GCBreakOnOOM"), 0, "Does a DebugBreak at the soonest time we detect an OOM")
256256
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcConcurrent, W("gcConcurrent"), (DWORD)-1, "Enables/Disables concurrent GC")
257+
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_UseGCWriteBarrierCopy, W("UseGCWriteBarrierCopy"), 0, "Use a copy of the write barrier for the GC. This is somewhat faster and for optimizations where the barrier is mutated as the program runs.")
257258

258259
#ifdef FEATURE_CONSERVATIVE_GC
259260
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcConservative, W("gcConservative"), 0, "Enables/Disables conservative GC")

src/coreclr/inc/jithelpers.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@
184184
JITHELPER(CORINFO_HELP_CHECK_OBJ, JIT_CheckObj, METHOD__NIL)
185185

186186
// GC Write barrier support
187-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF, JIT_WriteBarrier, METHOD__NIL)
188-
DYNAMICJITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF, JIT_CheckedWriteBarrier,METHOD__NIL)
187+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF, RhpAssignRef, METHOD__NIL)
188+
DYNAMICJITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF, RhpCheckedAssignRef,METHOD__NIL)
189189
JITHELPER(CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP, JIT_WriteBarrierEnsureNonHeapTarget,METHOD__NIL)
190190

191-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_BYREF, JIT_ByRefWriteBarrier,METHOD__NIL)
191+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_BYREF, RhpByRefAssignRef,METHOD__NIL)
192192
DYNAMICJITHELPER(CORINFO_HELP_BULK_WRITEBARRIER, NULL, METHOD__BUFFER__MEMCOPYGC)
193193

194194
// Accessing fields
@@ -286,19 +286,19 @@
286286
#endif // !FEATURE_EH_FUNCLETS
287287

288288
#ifdef TARGET_X86
289-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, JIT_WriteBarrierEAX, METHOD__NIL)
290-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, JIT_WriteBarrierEBX, METHOD__NIL)
291-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, JIT_WriteBarrierECX, METHOD__NIL)
292-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, JIT_WriteBarrierESI, METHOD__NIL)
293-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, JIT_WriteBarrierEDI, METHOD__NIL)
294-
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, JIT_WriteBarrierEBP, METHOD__NIL)
295-
296-
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, JIT_CheckedWriteBarrierEAX, METHOD__NIL)
297-
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, JIT_CheckedWriteBarrierEBX, METHOD__NIL)
298-
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, JIT_CheckedWriteBarrierECX, METHOD__NIL)
299-
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, JIT_CheckedWriteBarrierESI, METHOD__NIL)
300-
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, JIT_CheckedWriteBarrierEDI, METHOD__NIL)
301-
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, JIT_CheckedWriteBarrierEBP, METHOD__NIL)
289+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, RhpAssignRefEAX, METHOD__NIL)
290+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, RhpAssignRefEBX, METHOD__NIL)
291+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, RhpAssignRefECX, METHOD__NIL)
292+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, RhpAssignRefESI, METHOD__NIL)
293+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, RhpAssignRefEDI, METHOD__NIL)
294+
DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, RhpAssignRefEBP, METHOD__NIL)
295+
296+
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, RhpCheckedAssignRefEAX, METHOD__NIL)
297+
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, RhpCheckedAssignRefEBX, METHOD__NIL)
298+
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, RhpCheckedAssignRefECX, METHOD__NIL)
299+
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, RhpCheckedAssignRefESI, METHOD__NIL)
300+
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, RhpCheckedAssignRefEDI, METHOD__NIL)
301+
JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, RhpCheckedAssignRefEBP, METHOD__NIL)
302302
#else
303303
JITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, NULL, METHOD__NIL)
304304
JITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, NULL, METHOD__NIL)

src/coreclr/jit/targetarm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@
138138
// On exit:
139139
// r0: trashed
140140
// r3: trashed
141-
// CORINFO_HELP_ASSIGN_BYREF (JIT_ByRefWriteBarrier):
141+
// r12: trashed
142+
// CORINFO_HELP_ASSIGN_BYREF (JIT_ByRefWriteBarrier):
142143
// On entry:
143144
// r0: the destination address (object reference written here)
144145
// r1: the source address (points to object reference to write)
@@ -147,6 +148,7 @@
147148
// r1: incremented by 4
148149
// r2: trashed
149150
// r3: trashed
151+
// r12: trashed
150152

151153
#define REG_WRITE_BARRIER_DST REG_ARG_0
152154
#define RBM_WRITE_BARRIER_DST RBM_ARG_0

src/coreclr/nativeaot/Runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ list(APPEND RUNTIME_SOURCES_ARCH_ASM
213213
${ARCH_SOURCES_DIR}/InteropThunksHelpers.${ASM_SUFFIX}
214214
${RUNTIME_DIR}/${ARCH_SOURCES_DIR}/StubDispatch.${ASM_SUFFIX}
215215
${ARCH_SOURCES_DIR}/UniversalTransition.${ASM_SUFFIX}
216-
${ARCH_SOURCES_DIR}/WriteBarriers.${ASM_SUFFIX}
216+
${RUNTIME_DIR}/${ARCH_SOURCES_DIR}/WriteBarriers.${ASM_SUFFIX}
217217
)
218218

219219
if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// This file is used to allow sharing of assembly code between NativeAOT and CoreCLR, which have different conventions about how to ensure that constants offsets are accessible
5+
6+
#include "AsmOffsets.inc"
7+
#include <unixasmmacros.inc>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// This file is used to allow sharing of assembly code between NativeAOT and CoreCLR, which have different conventions about how to ensure that constants offsets are accessible
5+
6+
// TODO: Implement
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; Licensed to the .NET Foundation under one or more agreements.
2+
; The .NET Foundation licenses this file to you under the MIT license.
3+
4+
; This file is used to allow sharing of assembly code between NativeAOT and CoreCLR, which have different conventions about how to ensure that constants offsets are accessible
5+
6+
include AsmMacros.inc

src/coreclr/nativeaot/Runtime/i386/WriteBarriers.S

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// This file is used to allow sharing of assembly code between NativeAOT and CoreCLR, which have different conventions about how to ensure that constants offsets are accessible
5+
6+
#include <unixasmmacros.inc>
7+
#include "AsmOffsets.inc"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// This file is used to allow sharing of assembly code between NativeAOT and CoreCLR, which have different conventions about how to ensure that constants offsets are accessible
5+
6+
#include <unixasmmacros.inc>
7+
#include "AsmOffsets.inc"

0 commit comments

Comments
 (0)