Global write barrier elimination tracks newly allocated objects
parent
ad772cd261
commit
5a3e350490
|
@ -93,6 +93,24 @@ cfg new 1 get >>entry 0 set
|
||||||
T{ ##set-slot-imm f 2 1 3 4 }
|
T{ ##set-slot-imm f 2 1 3 4 }
|
||||||
} ] [ 2 get instructions>> ] unit-test
|
} ] [ 2 get instructions>> ] unit-test
|
||||||
|
|
||||||
|
V{
|
||||||
|
T{ ##allot f 1 }
|
||||||
|
} 1 test-bb
|
||||||
|
V{
|
||||||
|
T{ ##set-slot-imm f 2 1 3 4 }
|
||||||
|
T{ ##write-barrier f 1 2 3 }
|
||||||
|
} 2 test-bb
|
||||||
|
1 get 2 get 1vector >>successors drop
|
||||||
|
cfg new 1 get >>entry 0 set
|
||||||
|
|
||||||
|
[ ] [ 0 [ eliminate-write-barriers ] change ] unit-test
|
||||||
|
[ V{
|
||||||
|
T{ ##allot f 1 }
|
||||||
|
} ] [ 1 get instructions>> ] unit-test
|
||||||
|
[ V{
|
||||||
|
T{ ##set-slot-imm f 2 1 3 4 }
|
||||||
|
} ] [ 2 get instructions>> ] unit-test
|
||||||
|
|
||||||
V{
|
V{
|
||||||
T{ ##set-slot-imm f 2 1 3 4 }
|
T{ ##set-slot-imm f 2 1 3 4 }
|
||||||
T{ ##write-barrier f 1 2 3 }
|
T{ ##write-barrier f 1 2 3 }
|
||||||
|
|
|
@ -36,12 +36,15 @@ FORWARD-ANALYSIS: safe
|
||||||
: has-allocation? ( bb -- ? )
|
: has-allocation? ( bb -- ? )
|
||||||
instructions>> [ { [ ##allocation? ] [ ##call? ] } 1|| ] any? ;
|
instructions>> [ { [ ##allocation? ] [ ##call? ] } 1|| ] any? ;
|
||||||
|
|
||||||
|
GENERIC: safe-slot ( insn -- slot ? )
|
||||||
|
M: object safe-slot drop f f ;
|
||||||
|
M: ##write-barrier safe-slot src>> t ;
|
||||||
|
M: ##allot safe-slot dst>> t ;
|
||||||
|
|
||||||
M: safe-analysis transfer-set
|
M: safe-analysis transfer-set
|
||||||
drop [ H{ } assoc-clone-like ] dip
|
drop [ H{ } assoc-clone-like ] dip
|
||||||
instructions>> over '[
|
instructions>> over '[
|
||||||
dup ##write-barrier? [
|
safe-slot [ _ conjoin ] [ drop ] if
|
||||||
src>> _ conjoin
|
|
||||||
] [ drop ] if
|
|
||||||
] each ;
|
] each ;
|
||||||
|
|
||||||
M: safe-analysis join-sets
|
M: safe-analysis join-sets
|
||||||
|
|
Loading…
Reference in New Issue