1 IN: compiler.cfg.stack-analysis.merge.tests
2 USING: compiler.cfg.stack-analysis.merge tools.test arrays accessors
3 compiler.cfg.instructions compiler.cfg.stack-analysis.state
4 compiler.cfg.utilities compiler.cfg compiler.cfg.registers
5 compiler.cfg.debugger cpu.architecture make assocs namespaces
6 sequences kernel classes ;
10 { V int-regs 0 V int-regs 1 }
14 <basic-block> V{ T{ ##branch } } >>instructions dup 1 set
15 <basic-block> V{ T{ ##branch } } >>instructions dup 2 set 2array
17 <state> H{ { D 0 V int-regs 0 } } >>locs>vregs
18 <state> H{ { D 0 V int-regs 1 } } >>locs>vregs 2array
20 H{ } clone added-instructions set
21 V{ } clone added-phis set
22 merge-locs locs>vregs>> keys added-phis get values first
31 <basic-block> V{ T{ ##branch } } >>instructions dup 1 set
32 <basic-block> V{ T{ ##branch } } >>instructions dup 2 set 2array
35 <state> H{ { D 0 V int-regs 1 } } >>locs>vregs 2array
37 H{ } clone added-instructions set
38 V{ } clone added-phis set
39 [ merge-locs locs>vregs>> keys ] { } make drop
40 1 get added-instructions get at first class
48 <basic-block> V{ T{ ##branch } } >>instructions dup 1 set
49 <basic-block> V{ T{ ##branch } } >>instructions dup 2 set 2array
51 H{ } clone added-instructions set
52 V{ } clone added-phis set
54 <state> -1 >>ds-height
57 [ merge-ds-heights ds-height>> ] { } make drop
58 1 get added-instructions get at first class
68 <basic-block> V{ T{ ##branch } } >>instructions
69 <basic-block> V{ T{ ##branch } } >>instructions 2array
71 H{ } clone added-instructions set
72 V{ } clone added-phis set
75 <state> -1 >>ds-height H{ { D 1 V int-regs 0 } } >>locs>vregs
76 <state> H{ { D 0 V int-regs 1 } } >>locs>vregs 2array
78 [ merge-locs [ ds-height>> ] [ locs>vregs>> keys ] bi ] { } make drop
80 [ instructions>> length ] map
90 <basic-block> V{ T{ ##branch } } >>instructions
91 <basic-block> V{ T{ ##branch } } >>instructions 2array
93 H{ } clone added-instructions set
94 V{ } clone added-phis set
97 <state> -1 >>ds-height H{ { D -1 V int-regs 0 } } >>locs>vregs
98 <state> -1 >>ds-height H{ { D -1 V int-regs 1 } } >>locs>vregs 2array
100 [ [ merge-ds-heights ] [ merge-locs ] 2bi ] { } make drop
101 [ ds-height>> ] [ locs>vregs>> keys ] bi
103 [ instructions>> length ] map