1 ! Copyright (C) 2008, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel sequences sets arrays math strings fry
4 namespaces prettyprint compiler.cfg.linear-scan.live-intervals
5 compiler.cfg.linear-scan.allocation compiler.cfg assocs ;
6 IN: compiler.cfg.linear-scan.debugger
8 : check-linear-scan ( live-intervals machine-registers -- )
10 [ clone ] map dup [ [ vreg>> ] keep ] H{ } map>assoc
14 allocate-registers drop ;
16 : picture ( uses -- str )
17 dup last 1 + CHAR: space <string>
18 [ '[ CHAR: * swap _ set-nth ] each ] keep ;
20 : interval-picture ( interval -- str )
25 : live-intervals. ( seq -- )
26 [ interval-picture ] map simple-table. ;