aboutsummaryrefslogtreecommitdiff
path: root/src/boot/be
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-06-25 20:46:11 -0700
committerGraydon Hoare <[email protected]>2010-06-25 20:46:11 -0700
commitdd2716f56c7cf55f2904fbbf4dfabaab1afbcd88 (patch)
treea2bf8d69dba8eb656fb6c867a87cee3cd563ecde /src/boot/be
parentFix marking logic. (diff)
downloadrust-dd2716f56c7cf55f2904fbbf4dfabaab1afbcd88.tar.xz
rust-dd2716f56c7cf55f2904fbbf4dfabaab1afbcd88.zip
Fix bad register use in GC sweep pass.
Diffstat (limited to 'src/boot/be')
-rw-r--r--src/boot/be/x86.ml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/boot/be/x86.ml b/src/boot/be/x86.ml
index dfd659d9..64eaea22 100644
--- a/src/boot/be/x86.ml
+++ b/src/boot/be/x86.ml
@@ -839,12 +839,16 @@ let gc_glue
(codefix exit_jmp_fix)); (* if nonzero *)
mov (rc ecx) (* Load GC ctrl word *)
(c (edx_n Abi.exterior_gc_slot_field_ctrl));
-
- band (* Clear in-memory mark. *)
- (edx_n Abi.exterior_gc_slot_field_ctrl)
+ mov (rc eax) (ro ecx);
+ band (rc eax) (immi 1L); (* Extract mark to eax. *)
+ band (* Clear mark in ecx. *)
+ (rc ecx)
(immi 0xfffffffffffffffeL);
- band (rc ecx) (immi 1L); (* Check in-reg mark. *)
- emit (Il.cmp (ro edx) (immi 0L));
+ mov
+ ((edx_n Abi.exterior_gc_slot_field_ctrl)) (* Write-back cleared. *)
+ (ro ecx);
+
+ emit (Il.cmp (ro eax) (immi 0L));
emit
(Il.jmp Il.JNE
(codefix skip_jmp_fix)); (* if unmarked (garbage) *)