// and each entry can be written atomically
//
WRITE_BARRIER_ENTRY JIT_UpdateWriteBarrierState
- // a0-a7 will contain intended new state
+ // a0-a7 and t3 will contain intended new state
// t0 will preserve skipEphemeralCheck
// t2 will be used for pointers
#ifdef WRITE_BARRIER_CHECK
lla a2, g_GCShadow
ld a2, 0(a2)
-#endif
-#ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
- lla a3, g_sw_ww_table
+ lla a3, g_GCShadowEnd
ld a3, 0(a3)
#endif
- lla a4, g_ephemeral_low
+#ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
+ lla a4, g_sw_ww_table
ld a4, 0(a4)
+#endif
- lla a5, g_ephemeral_high
+ lla a5, g_ephemeral_low
ld a5, 0(a5)
+ lla a6, g_ephemeral_high
+ ld a6, 0(a6)
+
beq t0, zero, LOCAL_LABEL(EphemeralCheckEnabled)
- ori a4, zero, 0
- addi a5, zero, -1
+ ori a5, zero, 0
+ addi a6, zero, -1
LOCAL_LABEL(EphemeralCheckEnabled):
- lla a6, g_lowest_address
- ld a6, 0(a6)
-
- lla a7, g_highest_address
+ lla a7, g_lowest_address
ld a7, 0(a7)
+ lla t3, g_highest_address
+ ld t3, 0(t3)
+
// Update wbs state
lla t2, JIT_WriteBarrier_Table_Loc
ld t2, 0(t2)
sd a5, 40(t2)
sd a6, 48(t2)
sd a7, 56(t2)
+ sd t3, 64(t2)
EPILOG_RETURN
// t3 : trashed (incremented by 8 to implement JIT_ByRefWriteBarrier contract)
//
WRITE_BARRIER_ENTRY JIT_WriteBarrier
-
// TODO: sync_release (runtime detection required)
fence rw, rw
add t0, t6, t1
// if (pShadow >= g_GCShadowEnd) goto end
- lla t6, g_GCShadowEnd
+ lla t6, wbs_GCShadowEnd
ld t6, 0(t6)
slt t6, t0, t6
.quad 0
wbs_GCShadow:
.quad 0
+wbs_GCShadowEnd:
+ .quad 0
wbs_sw_ww_table:
.quad 0
wbs_ephemeral_low: