moved cards_offset and decks_offset into vm struct (for x86)
parent
c6d855d494
commit
5bb04857bf
|
@ -449,10 +449,10 @@ M:: ppc %allot ( dst size class nursery-ptr -- )
|
||||||
dst class store-tagged ;
|
dst class store-tagged ;
|
||||||
|
|
||||||
: load-cards-offset ( dst -- )
|
: load-cards-offset ( dst -- )
|
||||||
[ "cards_offset" f %alien-global ] [ dup 0 LWZ ] bi ;
|
[ "cards_offset" %load-vm-field-addr ] [ dup 0 LWZ ] bi ;
|
||||||
|
|
||||||
: load-decks-offset ( dst -- )
|
: load-decks-offset ( dst -- )
|
||||||
[ "decks_offset" f %alien-global ] [ dup 0 LWZ ] bi ;
|
[ "decks_offset" %load-vm-field-addr ] [ dup 0 LWZ ] bi ;
|
||||||
|
|
||||||
M:: ppc %write-barrier ( src card# table -- )
|
M:: ppc %write-barrier ( src card# table -- )
|
||||||
card-mark scratch-reg LI
|
card-mark scratch-reg LI
|
||||||
|
|
|
@ -587,18 +587,22 @@ M:: x86 %allot ( dst size class nursery-ptr -- )
|
||||||
dst class store-tagged
|
dst class store-tagged
|
||||||
nursery-ptr size inc-allot-ptr ;
|
nursery-ptr size inc-allot-ptr ;
|
||||||
|
|
||||||
|
: %vm-field-ptr ( reg field -- )
|
||||||
|
[ drop 0 MOV rc-absolute-cell rt-vm rel-fixup ]
|
||||||
|
[ vm-field-offset ADD ] 2bi ;
|
||||||
|
|
||||||
M:: x86 %write-barrier ( src card# table -- )
|
M:: x86 %write-barrier ( src card# table -- )
|
||||||
#! Mark the card pointed to by vreg.
|
#! Mark the card pointed to by vreg.
|
||||||
! Mark the card
|
! Mark the card
|
||||||
card# src MOV
|
card# src MOV
|
||||||
card# card-bits SHR
|
card# card-bits SHR
|
||||||
table "cards_offset" f %alien-global
|
table "cards_offset" %vm-field-ptr
|
||||||
table table [] MOV
|
table table [] MOV
|
||||||
table card# [+] card-mark <byte> MOV
|
table card# [+] card-mark <byte> MOV
|
||||||
|
|
||||||
! Mark the card deck
|
! Mark the card deck
|
||||||
card# deck-bits card-bits - SHR
|
card# deck-bits card-bits - SHR
|
||||||
table "decks_offset" f %alien-global
|
table "decks_offset" %vm-field-ptr
|
||||||
table table [] MOV
|
table table [] MOV
|
||||||
table card# [+] card-mark <byte> MOV ;
|
table card# [+] card-mark <byte> MOV ;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ C-STRUCT: zone
|
||||||
C-STRUCT: vm
|
C-STRUCT: vm
|
||||||
{ "context*" "stack_chain" }
|
{ "context*" "stack_chain" }
|
||||||
{ "zone" "nursery" }
|
{ "zone" "nursery" }
|
||||||
|
{ "cell" "cards_offset" }
|
||||||
|
{ "cell" "decks_offset" }
|
||||||
;
|
;
|
||||||
|
|
||||||
: vm-field-offset ( field -- offset ) "vm" offset-of ;
|
: vm-field-offset ( field -- offset ) "vm" offset-of ;
|
|
@ -4,9 +4,9 @@ namespace factor
|
||||||
struct factorvm {
|
struct factorvm {
|
||||||
// if you change this struct, also change vm.factor
|
// if you change this struct, also change vm.factor
|
||||||
context *stack_chain;
|
context *stack_chain;
|
||||||
/* new objects are allocated here */
|
zone nursery; /* new objects are allocated here */
|
||||||
zone nursery;
|
cell cards_offset;
|
||||||
|
cell decks_offset;
|
||||||
|
|
||||||
// segments
|
// segments
|
||||||
inline cell align_page(cell a);
|
inline cell align_page(cell a);
|
||||||
|
|
|
@ -2,6 +2,4 @@
|
||||||
|
|
||||||
using namespace factor;
|
using namespace factor;
|
||||||
|
|
||||||
cell cards_offset;
|
|
||||||
cell decks_offset;
|
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,6 @@ card has a slot written to.
|
||||||
|
|
||||||
the offset of the first object is set by the allocator. */
|
the offset of the first object is set by the allocator. */
|
||||||
|
|
||||||
VM_C_API factor::cell cards_offset;
|
|
||||||
VM_C_API factor::cell decks_offset;
|
|
||||||
|
|
||||||
namespace factor
|
namespace factor
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue