Fix the build
parent
0e2a3e4292
commit
daff63071f
|
@ -1,18 +1,22 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel compiler.cfg.instructions compiler.cfg.rpo
|
USING: kernel combinators.short-circuit accessors math sequences
|
||||||
compiler.cfg.def-use compiler.cfg.linearization compiler.cfg.utilities
|
sets assocs compiler.cfg.instructions compiler.cfg.rpo
|
||||||
compiler.cfg.mr combinators.short-circuit accessors math
|
compiler.cfg.def-use compiler.cfg.linearization
|
||||||
sequences sets assocs ;
|
compiler.cfg.utilities compiler.cfg.mr compiler.utilities ;
|
||||||
IN: compiler.cfg.checker
|
IN: compiler.cfg.checker
|
||||||
|
|
||||||
|
! Check invariants
|
||||||
|
|
||||||
ERROR: bad-kill-block bb ;
|
ERROR: bad-kill-block bb ;
|
||||||
|
|
||||||
: check-kill-block ( bb -- )
|
: check-kill-block ( bb -- )
|
||||||
dup instructions>> first2
|
dup instructions>> dup penultimate ##epilogue? [
|
||||||
swap ##epilogue? [
|
{
|
||||||
{ [ ##return? ] [ ##callback-return? ] [ ##jump? ] } 1||
|
[ length 2 = ]
|
||||||
] [ ##branch? ] if
|
[ last { [ ##return? ] [ ##callback-return? ] [ ##jump? ] } 1|| ]
|
||||||
|
} 1&&
|
||||||
|
] [ last ##branch? ] if
|
||||||
[ drop ] [ bad-kill-block ] if ;
|
[ drop ] [ bad-kill-block ] if ;
|
||||||
|
|
||||||
ERROR: last-insn-not-a-jump bb ;
|
ERROR: last-insn-not-a-jump bb ;
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel namespaces accessors compiler.cfg
|
USING: kernel namespaces accessors compiler.cfg
|
||||||
compiler.cfg.linearization compiler.cfg.gc-checks
|
compiler.cfg.linearization compiler.cfg.gc-checks
|
||||||
compiler.cfg.linear-scan compiler.cfg.build-stack-frame ;
|
compiler.cfg.save-contexts compiler.cfg.linear-scan
|
||||||
|
compiler.cfg.build-stack-frame ;
|
||||||
IN: compiler.cfg.mr
|
IN: compiler.cfg.mr
|
||||||
|
|
||||||
: build-mr ( cfg -- mr )
|
: build-mr ( cfg -- mr )
|
||||||
insert-gc-checks
|
insert-gc-checks
|
||||||
|
insert-save-contexts
|
||||||
linear-scan
|
linear-scan
|
||||||
flatten-cfg
|
flatten-cfg
|
||||||
build-stack-frame ;
|
build-stack-frame ;
|
|
@ -13,7 +13,6 @@ compiler.cfg.dce
|
||||||
compiler.cfg.write-barrier
|
compiler.cfg.write-barrier
|
||||||
compiler.cfg.representations
|
compiler.cfg.representations
|
||||||
compiler.cfg.two-operand
|
compiler.cfg.two-operand
|
||||||
compiler.cfg.save-contexts
|
|
||||||
compiler.cfg.ssa.destruction
|
compiler.cfg.ssa.destruction
|
||||||
compiler.cfg.empty-blocks
|
compiler.cfg.empty-blocks
|
||||||
compiler.cfg.checker ;
|
compiler.cfg.checker ;
|
||||||
|
@ -39,7 +38,6 @@ SYMBOL: check-optimizer?
|
||||||
eliminate-write-barriers
|
eliminate-write-barriers
|
||||||
select-representations
|
select-representations
|
||||||
convert-two-operand
|
convert-two-operand
|
||||||
insert-save-contexts
|
|
||||||
destruct-ssa
|
destruct-ssa
|
||||||
delete-empty-blocks
|
delete-empty-blocks
|
||||||
?check ;
|
?check ;
|
||||||
|
|
|
@ -1,19 +1,22 @@
|
||||||
USING: accessors compiler.cfg.debugger
|
USING: accessors compiler.cfg.debugger
|
||||||
compiler.cfg.instructions compiler.cfg.save-contexts namespaces
|
compiler.cfg.instructions compiler.cfg.registers
|
||||||
tools.test ;
|
compiler.cfg.save-contexts kernel namespaces tools.test ;
|
||||||
IN: compiler.cfg.save-contexts.tests
|
IN: compiler.cfg.save-contexts.tests
|
||||||
|
|
||||||
|
0 vreg-counter set-global
|
||||||
|
H{ } clone representations set
|
||||||
|
|
||||||
V{
|
V{
|
||||||
T{ ##save-context f 0 1 f }
|
T{ ##unary-float-function f 2 3 "sqrt" }
|
||||||
T{ ##save-context f 0 1 t }
|
|
||||||
T{ ##branch }
|
T{ ##branch }
|
||||||
} 0 test-bb
|
} 0 test-bb
|
||||||
|
|
||||||
0 get combine-in-block
|
0 get insert-save-context
|
||||||
|
|
||||||
[
|
[
|
||||||
V{
|
V{
|
||||||
T{ ##save-context f 0 1 t }
|
T{ ##save-context f 1 2 f }
|
||||||
|
T{ ##unary-float-function f 2 3 "sqrt" }
|
||||||
T{ ##branch }
|
T{ ##branch }
|
||||||
}
|
}
|
||||||
] [
|
] [
|
||||||
|
@ -25,7 +28,7 @@ V{
|
||||||
T{ ##branch }
|
T{ ##branch }
|
||||||
} 0 test-bb
|
} 0 test-bb
|
||||||
|
|
||||||
0 get combine-in-block
|
0 get insert-save-context
|
||||||
|
|
||||||
[
|
[
|
||||||
V{
|
V{
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs combinators combinators.short-circuit
|
USING: accessors assocs combinators combinators.short-circuit
|
||||||
cpu.architecture kernel layouts locals make math namespaces sequences
|
cpu.architecture kernel layouts locals make math namespaces sequences
|
||||||
sets vectors fry compiler.cfg compiler.cfg.instructions
|
sets vectors fry arrays compiler.cfg compiler.cfg.instructions
|
||||||
compiler.cfg.rpo arrays ;
|
compiler.cfg.rpo compiler.utilities ;
|
||||||
IN: compiler.cfg.utilities
|
IN: compiler.cfg.utilities
|
||||||
|
|
||||||
PREDICATE: kill-block < basic-block
|
PREDICATE: kill-block < basic-block
|
||||||
instructions>> {
|
instructions>> {
|
||||||
[ length 2 = ]
|
[ length 2 >= ]
|
||||||
[ first kill-vreg-insn? ]
|
[ penultimate kill-vreg-insn? ]
|
||||||
} 1&& ;
|
} 1&& ;
|
||||||
|
|
||||||
: back-edge? ( from to -- ? )
|
: back-edge? ( from to -- ? )
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
unportable
|
Loading…
Reference in New Issue