diff --git a/core/cpu/ppc/intrinsics/intrinsics.factor b/core/cpu/ppc/intrinsics/intrinsics.factor index 34e9900893..95af9e4b4b 100755 --- a/core/cpu/ppc/intrinsics/intrinsics.factor +++ b/core/cpu/ppc/intrinsics/intrinsics.factor @@ -56,14 +56,25 @@ IN: cpu.ppc.intrinsics : load-cards-offset ( dest -- ) "cards_offset" f pick %load-dlsym dup 0 LWZ ; +: load-decks-offset ( dest -- ) + "decks_offset" f pick %load-dlsym dup 0 LWZ ; + : %write-barrier ( -- ) "val" get operand-immediate? "obj" get fresh-object? or [ + ! Mark the card "obj" operand "scratch" operand card-bits SRWI "val" operand load-cards-offset "scratch" operand dup "val" operand ADD "val" operand "scratch" operand 0 LBZ "val" operand dup card-mark ORI "val" operand "scratch" operand 0 STB + + ! Mark the card deck + "obj" operand "scratch" operand deck-bits SRWI + "val" operand load-decks-offset + "scratch" operand dup "val" operand ADD + card-mark "val" operand LI + "val" operand "scratch" operand 0 STB ] unless ; \ set-slot { diff --git a/core/cpu/x86/intrinsics/intrinsics.factor b/core/cpu/x86/intrinsics/intrinsics.factor index a8bcf00d15..e0004f5f61 100755 --- a/core/cpu/x86/intrinsics/intrinsics.factor +++ b/core/cpu/x86/intrinsics/intrinsics.factor @@ -71,7 +71,7 @@ IN: cpu.x86.intrinsics ! Mark the card deck "obj" operand deck-bits card-bits - SHR "decks_offset" f temp-reg v>operand %alien-global - temp-reg v>operand "obj" operand [+] card-mark OR + temp-reg v>operand "obj" operand [+] card-mark MOV ] unless ; \ set-slot {