1 USING: accessors compiler.cfg compiler.cfg.instructions
2 compiler.cfg.registers compiler.cfg.stacks.local
3 compiler.cfg.utilities compiler.test cpu.architecture kernel
4 kernel.private make math namespaces sequences.private slots.private
7 IN: compiler.cfg.stacks.local.tests
16 [ [ "eh" , end-local-analysis ] V{ } make drop ]
17 [ [ peeks>> ] [ replaces>> ] [ kills>> ] tri ] bi
24 [ [ 3 D: 3 replace-loc "eh" , end-local-analysis ] V{ } make drop ]
30 D: 3 3 0 0 0 height-state boa
38 3 4 0 0 height-state boa
39 [ D: 1 swap local-loc>global ]
40 [ R: 1 swap local-loc>global ] bi
72 T{ ##copy { dst 1 } { src 25 } { rep any-rep } }
73 T{ ##copy { dst 2 } { src 26 } { rep any-rep } }
76 { { D: 0 25 } { R: 0 26 } } replaces>copy-insns
79 ! remove-redundant-replaces
81 H{ { T{ ds-loc { n 3 } } 7 } }
83 D: 0 loc>vreg D: 2 loc>vreg 2drop
84 2 D: 2 replace-loc 7 D: 3 replace-loc
85 replaces get remove-redundant-replaces
91 T{ ##copy { dst 1 } { src 3 } { rep any-rep } }
97 replaces get height-state get emit-insns
101 ! compute-local-kill-set
103 0 0 0 0 height-state boa compute-local-kill-set
107 0 4 0 -1 height-state boa compute-local-kill-set
110 { HS{ D: -1 D: -2 } } [
111 2 0 -2 0 height-state boa compute-local-kill-set
116 D: 3 1 0 0 0 height-state boa global-loc>local
121 T{ height-state f 0 0 3 0 }
123 D: 3 inc-stack height-state get
127 T{ height-state f 2 0 3 0 }
129 2 0 0 0 height-state boa height-state set
130 D: 3 inc-stack height-state get
134 { T{ ##inc { loc D: 4 } } T{ ##inc { loc R: -2 } } }
136 0 0 4 -2 height-state boa height-state>insns
139 { H{ { D: -1 40 } } } [
140 D: 1 inc-stack 40 D: 0 replace-loc replaces get
143 ! Compiling these words used to make the compiler hang due to a bug in
144 ! end-local-analysis. So the test is just to compile them and if it
145 ! doesn't hang, the bug is fixed! See #1507
146 : my-new-key4 ( a i j -- i/j )
169 ] if ; inline recursive
173 { integer object } declare
175 { array-capacity object } declare nip
181 curry each-integer-from ;