 
 : insn>gc-map ( insn -- pair )
     gc-map>> [ scrub-d>> ] [ scrub-r>> ] bi 2array ;
-
-! : log-gc-map-insn ( state insn -- )
-!     [ state>gc-map ] [ [ class-of ] [ insn>gc-map ] bi ] bi* rot
-!     2dup = not [ "%u: given %u have %u\n" printf ] [ 3drop ] if ;
 
 : insn>location ( insn -- n ds? )
     loc>> [ n>> ] [ ds-loc? ] bi ;

USING: accessors arrays byte-arrays classes compiler.cfg.dataflow-analysis
compiler.cfg.instructions compiler.cfg.registers
formatting fry io kernel math math.order sequences sets ;
QUALIFIED: sets
IN: compiler.cfg.stacks.vacant

! Operations on the stack info
: register-write ( n stack -- stack' )
    first2 rot suffix sets:members 2array ;

: adjust-stack ( n stack -- stack' )
    first2 pick '[ _ + ] map [ + ] dip 2array ;


M: gc-map-insn visit-insn ( state insn -- state' )
    dupd set-gc-map [ register-gc ] map ;

M: insn visit-insn ( state insn -- state' )
    drop ;
