]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compiler/cfg/gc-checks/gc-checks.factor
GC maps for more compact inline GC checks
[factor.git] / basis / compiler / cfg / gc-checks / gc-checks.factor
index 255e5476e684992d433e6ef530d12f204422fb0d..60f81f77d97d2f9fe62fd84d4b070a42d34765c0 100644 (file)
@@ -50,16 +50,12 @@ IN: compiler.cfg.gc-checks
         ] bi*
     ] V{ } make >>instructions ;
 
-: wipe-locs ( uninitialized-locs -- )
-    '[
-        int-rep next-vreg-rep
-        [ 0 ##load-tagged ]
-        [ '[ [ _ ] dip ##replace ] each ] bi
-    ] unless-empty ;
+: scrubbed ( uninitialized-locs -- scrub-d scrub-r )
+    [ ds-loc? ] partition [ [ n>> ] map ] bi@ ;
 
 : <gc-call> ( uninitialized-locs gc-roots -- bb )
     [ <basic-block> ] 2dip
-    [ [ wipe-locs ] [ ##call-gc ] bi* ##branch ] V{ } make
+    [ [ scrubbed ] dip ##gc-map ##call-gc ##branch ] V{ } make
     >>instructions t >>unlikely? ;
 
 :: insert-guard ( body check bb -- )