]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tree/escape-analysis/nodes/nodes.factor
generalize stack effects so we can bootstrap with the stricter stack effect checking
[factor.git] / basis / compiler / tree / escape-analysis / nodes / nodes.factor
1 ! Copyright (C) 2008, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel sequences fry math namespaces
4 compiler.tree
5 compiler.tree.def-use
6 compiler.tree.escape-analysis.allocations ;
7 IN: compiler.tree.escape-analysis.nodes
8
9 GENERIC: escape-analysis* ( node -- )
10
11 SYMBOL: next-node
12
13 : each-with-next ( ... seq quot: ( ... elt -- ... ) -- ... )
14     dupd '[ 1 + _ ?nth next-node set @ ] each-index ; inline
15
16 : (escape-analysis) ( node -- )
17     [
18         [ node-defs-values introduce-values ]
19         [ escape-analysis* ]
20         bi
21     ] each-with-next ;