Handbook
Glossary
escape-analysis* ( node -- )
Vocabulary
compiler
.
tree
.
escape-analysis
.
nodes
Inputs
node
a
node
Outputs
None
Word description
Performs escape analysis for one SSA node.
Definition
IN:
compiler.tree.escape-analysis.nodes
GENERIC:
escape-analysis*
( node -- )
Methods
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.nodes
;
M:
#alien-callback
escape-analysis*
child>>
(escape-analysis)
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
kernel
;
M:
#alien-node
escape-analysis*
[
in-d>>
add-escaping-values
]
[
out-d>>
unknown-allocations
]
bi
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
compiler.tree.propagation.branches
kernel
sequences
;
M:
#branch
escape-analysis*
[
in-d>>
add-escaping-values
]
[
live-children
[
[
(escape-analysis)
]
when*
]
each
]
bi
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
compiler.tree.escape-analysis.recursive
kernel
;
M:
#call-recursive
escape-analysis*
[
]
[
label>>
return>>
]
[
node-output-allocations
]
tri
[
[
node-input-allocations
]
dip
check-fixed-point
]
[
drop
swap
[
in-d>>
]
[
out-d>>
]
bi*
copy-values
]
3bi
;
USING:
accessors
classes.tuple.private
combinators
compiler.tree
compiler.tree.escape-analysis.nodes
compiler.tree.escape-analysis.simple
kernel
slots.private
;
M:
#call
escape-analysis*
dup
word>>
{
{
\
<tuple-boa>
[
record-tuple-allocation
]
}
{
\
slot
[
record-slot-call
]
}
[
drop
record-unknown-allocation
]
}
case
;
USING:
compiler.tree
compiler.tree.escape-analysis.nodes
kernel
;
M:
#declare
escape-analysis*
drop
;
USING:
compiler.tree
compiler.tree.escape-analysis.nodes
kernel
;
M:
#enter-recursive
escape-analysis*
drop
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.nodes
compiler.tree.escape-analysis.simple
kernel
sequences
;
M:
#introduce
escape-analysis*
out-d>>
[
dup
declared-class
record-param-allocation
]
each
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.branches
compiler.tree.escape-analysis.nodes
kernel
sequences
;
M:
#phi
escape-analysis*
[
phi-in-d>>
flip
]
[
out-d>>
]
bi
merge-allocations
;
USING:
accessors
classes.tuple.private
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
compiler.tree.escape-analysis.simple
kernel
sequences
;
M:
#push
escape-analysis*
dup
literal>>
layout-up-to-date?
[
[
out-d>>
first
]
[
literal>>
]
bi
record-literal-allocation
]
[
out-d>>
unknown-allocations
]
if
;
USING:
accessors
compiler.tree
compiler.tree.combinators
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
compiler.tree.escape-analysis.recursive
kernel
sequences
;
M:
#recursive
escape-analysis*
[
label>>
return>>
in-d>>
introduce-values
]
[
[
child>>
[
first
out-d>>
introduce-values
]
[
first
analyze-recursive-phi
]
[
(escape-analysis)
]
tri
]
until-fixed-point
]
bi
;
USING:
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
;
M:
#renaming
escape-analysis*
inputs/outputs
copy-values
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
disjoint-sets
generic
kernel
namespaces
sequences
;
M:
#return-recursive
escape-analysis*
[
M\
#return-recursive
escape-analysis*
(call-next-method)
]
[
[
in-d>>
]
[
label>>
calls>>
]
bi
[
node>>
out-d>>
escaping-values
get
[
equate
]
curry
2each
]
with
each
]
bi
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.allocations
compiler.tree.escape-analysis.nodes
;
M:
#return
escape-analysis*
in-d>>
add-escaping-values
;
USING:
compiler.tree
compiler.tree.escape-analysis.nodes
kernel
;
M:
#terminate
escape-analysis*
drop
;