1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 03:27:04 +09:00
This commit is contained in:
vsadov 2024-08-25 13:04:48 -07:00
parent fad9f0477e
commit 2405cb36e0
3 changed files with 15 additions and 2 deletions

View file

@ -430,6 +430,8 @@ size_t SatoriRecycler::IncrementGen0Count()
void SatoriRecycler::TryStartGC(int generation, gc_reason reason)
{
generation = 2;
int newState = SatoriUtil::IsConcurrent() ? GC_STATE_CONCURRENT : GC_STATE_BLOCKING;
if (m_gcState == GC_STATE_NONE &&
Interlocked::CompareExchange(&m_gcState, newState, GC_STATE_NONE) == GC_STATE_NONE)

View file

@ -583,6 +583,11 @@ endif
AssignAndMarkCards:
mov [rcx], rdx
cmp byte ptr [g_sw_ww_enabled_for_gc_heap], 0h
jne Generational
ret
Generational:
xor rdx, rcx
shr rdx, 21
jz CheckConcurrent ; same region, just check if barrier is not concurrent

View file

@ -541,6 +541,13 @@ WRITE_BARRIER_ENTRY JIT_WriteBarrier
LOCAL_LABEL(AssignAndMarkCards):
stlr x15, [x14]
ldr x17, LOCAL_LABEL(wbs_sw_ww_table) // !wbs_sw_ww_table -> !concurrent
cbnz x17, LOCAL_LABEL(Generational)
// no marking needed
add x14, x14, 8
ret lr
LOCAL_LABEL(Generational):
and x12, x14, #0xFFFFFFFFFFE00000 // target aligned to region
cmp x12, x16
beq LOCAL_LABEL(CheckConcurrent) // same region, just check if barrier is not concurrent
@ -550,8 +557,7 @@ WRITE_BARRIER_ENTRY JIT_WriteBarrier
tbz x12, #1, LOCAL_LABEL(MarkCards)
LOCAL_LABEL(CheckConcurrent):
ldr x12, LOCAL_LABEL(wbs_sw_ww_table) // !wbs_sw_ww_table -> !concurrent
cbnz x12, LOCAL_LABEL(MarkCards)
cbnz x17, LOCAL_LABEL(MarkCards)
// no marking needed
add x14, x14, 8