     src>> needs-write-barrier? ;
 
 M: gc-map-insn eliminate-write-barrier
-    fresh-allocations get clear-assoc ;
+    fresh-allocations get clear-set ;
 
 M: ##copy eliminate-write-barrier
     [ src>> resolve-copy ] [ dst>> ] bi copies get set-at t ;

M: insn eliminate-write-barrier drop t ;

: write-barriers-step ( insns -- insns' )
    H{ } clone fresh-allocations set
    H{ } clone mutated-objects set
    H{ } clone copies set
    [ eliminate-write-barrier ] filter! ;


GENERIC: eliminate-write-barrier ( insn -- ? )

: fresh-allocation ( vreg -- )
    fresh-allocations get adjoin ;

M: ##allot eliminate-write-barrier
    dst>> fresh-allocation t ;

: mutated-object ( vreg -- )
    resolve-copy mutated-objects get adjoin ;

M: ##set-slot eliminate-write-barrier
    obj>> mutated-object t ;
