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 ) -- ) : with-cfg-builder ( nodes word label quot: ( ..a block -- ..b ) -- )
'[ '[
begin-stack-analysis begin-stack-analysis
begin-cfg dup procedures get push begin-cfg
entry>> @ [ procedures get push ]
end-stack-analysis [ entry>> @ ]
[ end-stack-analysis ] tri
] with-scope ; inline ] with-scope ; inline
: with-dummy-cfg-builder ( node quot -- ) : 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 compiler.cfg.stacks.local compiler.tree help.markup help.syntax math
sequences ; sequences ;
IN: compiler.cfg.stacks IN: compiler.cfg.stacks
@ -12,6 +12,7 @@ HELP: begin-stack-analysis
{ $see-also height-state } ; { $see-also height-state } ;
HELP: end-stack-analysis 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)." } ; { $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 HELP: adjust-d

View File

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