IN: compiler.cfg.stack-analysis.merge.tests USING: compiler.cfg.stack-analysis.merge tools.test arrays accessors compiler.cfg.instructions compiler.cfg.stack-analysis.state compiler.cfg compiler.cfg.registers compiler.cfg.debugger cpu.architecture make assocs sequences kernel classes ; [ { D 0 } { V int-regs 0 V int-regs 1 } ] [ V{ T{ ##branch } } >>instructions V{ T{ ##branch } } >>instructions 2array H{ { D 0 V int-regs 0 } } >>locs>vregs H{ { D 0 V int-regs 1 } } >>locs>vregs 2array [ merge-locs locs>vregs>> keys ] { } make first inputs>> values ] unit-test [ { D 0 } ##peek ] [ V{ T{ ##branch } } >>instructions V{ T{ ##branch } } >>instructions 2array [ H{ { D 0 V int-regs 1 } } >>locs>vregs 2array [ merge-locs locs>vregs>> keys ] { } make drop ] keep first instructions>> first class ] unit-test [ 0 ##inc-d ] [ V{ T{ ##branch } } >>instructions V{ T{ ##branch } } >>instructions 2array [ -1 >>ds-height 2array [ merge-ds-heights ds-height>> ] { } make drop ] keep first instructions>> first class ] unit-test [ 0 { D 0 } { 1 1 } ] [ V{ T{ ##branch } } >>instructions V{ T{ ##branch } } >>instructions 2array [ -1 >>ds-height H{ { D 1 V int-regs 0 } } >>locs>vregs H{ { D 0 V int-regs 1 } } >>locs>vregs 2array [ merge-locs [ ds-height>> ] [ locs>vregs>> keys ] bi ] { } make drop ] keep [ instructions>> length ] map ] unit-test [ -1 { D -1 } { 1 1 } ] [ V{ T{ ##branch } } >>instructions V{ T{ ##branch } } >>instructions 2array [ -1 >>ds-height H{ { D -1 V int-regs 0 } } >>locs>vregs -1 >>ds-height H{ { D -1 V int-regs 1 } } >>locs>vregs 2array [ [ merge-ds-heights ] [ merge-locs ] 2bi ] { } make drop [ ds-height>> ] [ locs>vregs>> keys ] bi ] keep [ instructions>> length ] map ] unit-test