Oops, we weren't doing TCO in some cases
parent
5792783760
commit
dd45c26234
|
@ -0,0 +1,18 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel accessors sequences
|
||||
compiler.tree compiler.tree.combinators ;
|
||||
IN: compiler.tree.finalization
|
||||
|
||||
GENERIC: finalize* ( node -- nodes )
|
||||
|
||||
M: #copy finalize* drop f ;
|
||||
|
||||
M: #shuffle finalize*
|
||||
dup shuffle-effect
|
||||
[ in>> ] [ out>> ] bi sequence=
|
||||
[ drop f ] when ;
|
||||
|
||||
M: node finalize* ;
|
||||
|
||||
: finalize ( nodes -- nodes' ) [ finalize* ] map-nodes ;
|
|
@ -11,6 +11,7 @@ compiler.tree.strength-reduction
|
|||
compiler.tree.loop.detection
|
||||
compiler.tree.loop.inversion
|
||||
compiler.tree.branch-fusion
|
||||
compiler.tree.finalization
|
||||
compiler.tree.checker ;
|
||||
IN: compiler.tree.optimizer
|
||||
|
||||
|
@ -25,6 +26,7 @@ IN: compiler.tree.optimizer
|
|||
unbox-tuples
|
||||
compute-def-use
|
||||
remove-dead-code
|
||||
finalize
|
||||
! strength-reduce
|
||||
! USE: kernel
|
||||
! compute-def-use
|
||||
|
|
|
@ -5,6 +5,6 @@ IN: benchmark.empty-loop-0
|
|||
dup 0 fixnum< [ drop ] [ 1 fixnum-fast empty-loop-0 ] if ;
|
||||
|
||||
: empty-loop-main ( -- )
|
||||
5000000 empty-loop-0 ;
|
||||
50000000 empty-loop-0 ;
|
||||
|
||||
MAIN: empty-loop-main
|
||||
|
|
|
@ -5,6 +5,6 @@ IN: benchmark.empty-loop-2
|
|||
[ drop ] each ;
|
||||
|
||||
: empty-loop-main ( -- )
|
||||
5000000 empty-loop-2 ;
|
||||
50000000 empty-loop-2 ;
|
||||
|
||||
MAIN: empty-loop-main
|
||||
|
|
Loading…
Reference in New Issue