Fix the build

db4
Slava Pestov 2009-09-09 13:44:54 -05:00
parent 0e2a3e4292
commit daff63071f
6 changed files with 30 additions and 22 deletions

View File

@ -1,18 +1,22 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel compiler.cfg.instructions compiler.cfg.rpo
compiler.cfg.def-use compiler.cfg.linearization compiler.cfg.utilities
compiler.cfg.mr combinators.short-circuit accessors math
sequences sets assocs ;
USING: kernel combinators.short-circuit accessors math sequences
sets assocs compiler.cfg.instructions compiler.cfg.rpo
compiler.cfg.def-use compiler.cfg.linearization
compiler.cfg.utilities compiler.cfg.mr compiler.utilities ;
IN: compiler.cfg.checker
! Check invariants
ERROR: bad-kill-block bb ;
: check-kill-block ( bb -- )
dup instructions>> first2
swap ##epilogue? [
{ [ ##return? ] [ ##callback-return? ] [ ##jump? ] } 1||
] [ ##branch? ] if
dup instructions>> dup penultimate ##epilogue? [
{
[ length 2 = ]
[ last { [ ##return? ] [ ##callback-return? ] [ ##jump? ] } 1|| ]
} 1&&
] [ last ##branch? ] if
[ drop ] [ bad-kill-block ] if ;
ERROR: last-insn-not-a-jump bb ;

View File

@ -2,11 +2,13 @@
! See http://factorcode.org/license.txt for BSD license.
USING: kernel namespaces accessors compiler.cfg
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
: build-mr ( cfg -- mr )
insert-gc-checks
insert-save-contexts
linear-scan
flatten-cfg
build-stack-frame ;

View File

@ -13,7 +13,6 @@ compiler.cfg.dce
compiler.cfg.write-barrier
compiler.cfg.representations
compiler.cfg.two-operand
compiler.cfg.save-contexts
compiler.cfg.ssa.destruction
compiler.cfg.empty-blocks
compiler.cfg.checker ;
@ -39,7 +38,6 @@ SYMBOL: check-optimizer?
eliminate-write-barriers
select-representations
convert-two-operand
insert-save-contexts
destruct-ssa
delete-empty-blocks
?check ;

View File

@ -1,19 +1,22 @@
USING: accessors compiler.cfg.debugger
compiler.cfg.instructions compiler.cfg.save-contexts namespaces
tools.test ;
compiler.cfg.instructions compiler.cfg.registers
compiler.cfg.save-contexts kernel namespaces tools.test ;
IN: compiler.cfg.save-contexts.tests
0 vreg-counter set-global
H{ } clone representations set
V{
T{ ##save-context f 0 1 f }
T{ ##save-context f 0 1 t }
T{ ##unary-float-function f 2 3 "sqrt" }
T{ ##branch }
} 0 test-bb
0 get combine-in-block
0 get insert-save-context
[
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 }
}
] [
@ -25,7 +28,7 @@ V{
T{ ##branch }
} 0 test-bb
0 get combine-in-block
0 get insert-save-context
[
V{

View File

@ -2,14 +2,14 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs combinators combinators.short-circuit
cpu.architecture kernel layouts locals make math namespaces sequences
sets vectors fry compiler.cfg compiler.cfg.instructions
compiler.cfg.rpo arrays ;
sets vectors fry arrays compiler.cfg compiler.cfg.instructions
compiler.cfg.rpo compiler.utilities ;
IN: compiler.cfg.utilities
PREDICATE: kill-block < basic-block
instructions>> {
[ length 2 = ]
[ first kill-vreg-insn? ]
[ length 2 >= ]
[ penultimate kill-vreg-insn? ]
} 1&& ;
: back-edge? ( from to -- ? )

View File

@ -0,0 +1 @@
unportable