summaryrefslogtreecommitdiff
path: root/src/vm/amd64/jithelpers_slow.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/amd64/jithelpers_slow.S')
-rw-r--r--src/vm/amd64/jithelpers_slow.S24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/vm/amd64/jithelpers_slow.S b/src/vm/amd64/jithelpers_slow.S
index 0a5da69393..f61b42afc7 100644
--- a/src/vm/amd64/jithelpers_slow.S
+++ b/src/vm/amd64/jithelpers_slow.S
@@ -94,16 +94,36 @@ LEAF_ENTRY JIT_WriteBarrier_Debug, _TEXT
// Check if we need to update the card table
// Calc pCardByte
shr rdi, 0x0B
+
PREPARE_EXTERNAL_VAR g_card_table, r10
- add rdi, [r10]
+ mov r10, [r10]
// Check if this card is dirty
- cmp byte ptr [rdi], 0FFh
+ cmp byte ptr [rdi + r10], 0FFh
+
jne UpdateCardTable_Debug
REPRET
UpdateCardTable_Debug:
+ mov byte ptr [rdi + r10], 0FFh
+
+#ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
+ // Shift rdi by 0x0A more to get the card bundle byte (we shifted by 0x0B already)
+ shr rdi, 0x0A
+
+ PREPARE_EXTERNAL_VAR g_card_bundle_table, r10
+ add rdi, [r10]
+
+ // Check if this bundle byte is dirty
+ cmp byte ptr [rdi], 0FFh
+
+ jne UpdateCardBundle_Debug
+ REPRET
+
+ UpdateCardBundle_Debug:
mov byte ptr [rdi], 0FFh
+#endif
+
ret
.balign 16