USING: accessors arrays assocs combinators compiler.cfg
compiler.cfg.instructions compiler.cfg.parallel-copy
compiler.cfg.registers compiler.cfg.stacks.height
-hash-sets kernel make math math.order namespaces sequences sets ;
+fry hash-sets kernel make math math.order namespaces sequences sets ;
FROM: namespaces => set ;
IN: compiler.cfg.stacks.local
: height-state>insns ( state -- insns )
[ second ] map { ds-loc rs-loc } [ new swap >>n ] 2map
- [ n>> 0 = not ] filter [ ##inc new swap >>loc ] map ;
+ [ n>> 0 = ] reject [ ##inc new swap >>loc ] map ;
: translate-local-loc ( loc state -- loc' )
[ clone ] dip over >loc< 0 1 ? rot nth first - >>n ;
: changes>insns ( replaces height-state -- insns )
[ replaces>copy-insns ] [ height-state>insns ] bi* append ;
-: emit-changes ( replaces height-state -- )
+: emit-changes ( replaces state -- )
building get pop -rot changes>insns % , ;
: peek-loc ( loc -- vreg )
height-state get translate-local-loc replaces get set-at ;
: compute-local-kill-set ( basic-block -- set )
- [ rs-heights get at ] [ ds-heights get at ] bi
+ [ ds-heights get at ] [ rs-heights get at ] bi
height-state get local-kill-set ;
: begin-local-analysis ( basic-block -- )