1 ! Copyright (C) 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays compiler.cfg compiler.units kernel sequences
4 stack-checker tools.test vocabs words ;
7 : decompile ( word -- )
8 dup def>> 2array 1array t t modify-code-heap ;
10 : recompile-all ( -- )
13 : compile-call ( quot -- )
14 [ dup infer define-temp ] with-compilation-unit execute ;
16 << \ compile-call t "no-compile" set-word-prop >>
18 : compiler-test ( name -- )
19 "resource:basis/compiler/tests/" ".factor" surround run-test-file ;
21 USING: compiler.cfg.registers compiler.cfg.stacks compiler.cfg.stacks.local
24 : init-cfg-test ( -- )
25 reset-vreg-counter begin-stack-analysis
26 <basic-block> dup basic-block set begin-local-analysis
27 H{ } clone representations set
28 H{ } clone replaces set ;
30 : cfg-unit-test ( result quot -- )
31 '[ init-cfg-test @ ] unit-test ; inline