Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
#push
Vocabulary
compiler.tree
Class description
SSA tree node that puts a literal value on the stack. It has the following slots:
out-d
A one item array containing the
<value>
of the literal being pushed.
Notes
A
quotation
is also a literal.
Definition
IN:
compiler.tree
TUPLE:
#push
<
node
literal out-d
;
Methods
USING:
accessors
compiler.tree
compiler.tree.checker
kernel
sequences
;
M:
#push
check-node*
out-d>>
length
1
=
[
"Bad #push"
throw
]
unless
;
USING:
compiler.tree
compiler.tree.checker
;
M:
#push
check-stack-flow*
check-out-d
;
USING:
accessors
compiler.tree
compiler.tree.modular-arithmetic
kernel
math
sequences
;
M:
#push
compute-modular-candidates*
[
out-d>>
first
]
[
literal>>
]
bi
real?
[
[
modular-value
]
[
fixnum-value
]
bi
]
[
drop
]
if
;
USING:
accessors
compiler.cfg.builder
compiler.cfg.hats
compiler.cfg.stacks
compiler.tree
;
M:
#push
emit-node
literal>>
^^load-literal
ds-push
;
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:
compiler.tree
compiler.tree.def-use
kernel
;
M:
#push
node-uses-values
drop
f
;
USING:
accessors
compiler.tree
compiler.tree.debugger
make
quotations
;
M:
#push
node>quot
literal>>
literalize
,
;
USING:
accessors
compiler.tree
compiler.tree.modular-arithmetic
kernel
math
sequences
;
M:
#push
optimize-modular-arithmetic*
dup
[
out-d>>
first
modular-value?
]
[
literal>>
real?
]
bi
and
[
[
>fixnum
]
change-literal
]
when
;
USING:
accessors
compiler.tree
compiler.tree.propagation.info
compiler.tree.propagation.nodes
kernel
sequences
;
M:
#push
propagate-before
[
literal>>
<literal-info>
]
[
out-d>>
first
]
bi
set-value-info
;
USING:
accessors
compiler.tree
compiler.tree.dead-code.liveness
kernel
sequences
;
M:
#push
remove-dead-code*
dup
out-d>>
first
live-value?
[
drop
f
]
unless
;
USING:
compiler.tree
compiler.tree.normalization.renaming
;
M:
#push
rename-node-values*
;
USING:
accessors
classes
classes.tuple
compiler.tree
compiler.tree.escape-analysis.check
;
M:
#push
run-escape-analysis*
literal>>
class-of
immutable-tuple-class?
;
USING:
compiler.tree
compiler.tree.tuple-unboxing
kernel
;
M:
#push
unbox-tuples*
dup
unbox-output?
[
expand-#push
]
when
;