]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/linear-scan/debugger/debugger.factor
Merging in new codegen
[factor.git] / basis / compiler / cfg / linear-scan / debugger / debugger.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel sequences sets arrays
4 compiler.cfg.linear-scan.live-intervals
5 compiler.cfg.linear-scan.allocation ;
6 IN: compiler.cfg.linear-scan.debugger
7
8 : check-assigned ( live-intervals -- )
9     [
10         reg>>
11         [ "Not all intervals have registers" throw ] unless
12     ] each ;
13
14 : split-children ( live-interval -- seq )
15     dup split-before>> [
16         [ split-before>> ] [ split-after>> ] bi
17         [ split-children ] bi@
18         append
19     ] [ 1array ] if ;
20
21 : check-linear-scan ( live-intervals machine-registers -- )
22     [ [ clone ] map ] dip allocate-registers
23     [ split-children ] map concat check-assigned ;