compiler.cfg.*: better stack effect for end-stack-analysis

locals-and-roots
Björn Lindqvist 2016-03-16 00:09:55 +01:00
parent c51f518911
commit 3a9b297b3b
3 changed files with 10 additions and 9 deletions

View File

@ -19,9 +19,10 @@ SYMBOL: loops
: with-cfg-builder ( nodes word label quot: ( ..a block -- ..b ) -- )
'[
begin-stack-analysis
begin-cfg dup procedures get push
entry>> @
end-stack-analysis
begin-cfg
[ procedures get push ]
[ entry>> @ ]
[ end-stack-analysis ] tri
] with-scope ; inline
: with-dummy-cfg-builder ( node quot -- )

View File

@ -1,4 +1,4 @@
USING: compiler.cfg.instructions compiler.cfg.registers
USING: compiler.cfg compiler.cfg.instructions compiler.cfg.registers
compiler.cfg.stacks.local compiler.tree help.markup help.syntax math
sequences ;
IN: compiler.cfg.stacks
@ -12,6 +12,7 @@ HELP: begin-stack-analysis
{ $see-also height-state } ;
HELP: end-stack-analysis
{ $values { "cfg" cfg } }
{ $description "Ends the stack analysis of the current cfg. This is the last step of the cfg construction (but comes before all optimization passes)." } ;
HELP: adjust-d

View File

@ -1,9 +1,9 @@
! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors biassocs compiler.cfg compiler.cfg.registers
USING: accessors biassocs compiler.cfg.registers
compiler.cfg.stacks.finalize compiler.cfg.stacks.global
compiler.cfg.stacks.height compiler.cfg.stacks.local compiler.cfg.utilities
fry kernel math namespaces sequences ;
compiler.cfg.stacks.height compiler.cfg.stacks.local
compiler.cfg.utilities kernel math namespaces sequences ;
IN: compiler.cfg.stacks
: begin-stack-analysis ( -- )
@ -15,8 +15,7 @@ IN: compiler.cfg.stacks
H{ } clone kill-sets set
initial-height-state height-state set ;
: end-stack-analysis ( -- )
cfg get
: end-stack-analysis ( cfg -- )
{
compute-anticip-sets
compute-live-sets