     dup
     [ src>> resolve ] [ insn-slot# ] [ insn-object ] tri
     3dup idempotent? [ 3drop ] [
-        [ remember-set-slot drop ] [ load-slot ] 3bi
+        [ 2drop heap-ac get merge-acs ]
+        [ remember-set-slot drop ]
+        [ load-slot ]
+        3tri
     ] if ;
 
 M: ##copy analyze-aliases*

! See http://factorcode.org/license.txt for BSD license.
USING: kernel math namespaces assocs hashtables sequences arrays
accessors words vectors combinators combinators.short-circuit
sets classes layouts cpu.architecture
compiler.cfg
compiler.cfg.rpo
compiler.cfg.def-use

: each-alias ( vreg quot -- )
    [ aliases ] dip each ; inline

: merge-acs ( vreg into -- )
    [ vreg>ac ] dip
    2dup eq? [ 2drop ] [
        [ ac>vregs ] dip
        [ vregs>acs get '[ [ _ ] dip _ set-at ] each ]
        [ acs>vregs get at push-all ]
        2bi
    ] if ;

! Map vregs -> slot# -> vreg
SYMBOL: live-slots

