Handbook
Glossary
check-value-flow-roots ( insn expected state snapshot -- )
Vocabulary
compiler
.
cfg
.
register-allocation
.
verifier
Inputs
insn
an
object
expected
an
object
state
an
object
snapshot
an
object
Outputs
None
Definition
USING:
accessors
assocs
compiler.cfg.instructions
cpu.architecture
kernel
sequences
sets
;
IN:
compiler.cfg.register-allocation.verifier
::
check-value-flow-roots
( insn expected state snapshot -- )
insn
gc-map-insn?
[
insn
gc-map>>
[
gc-roots>>
]
[
derived-roots>>
keys
]
bi
intersect
empty?
[
]
[
insn
overlapping-allocation-gc-roots
]
if
insn
gc-map>>
gc-roots>>
[|
slot |
slot
tagged-rep
state
value-flow-read
[
dup
value-flow-false
eq?
[
drop
t
]
[
snapshot
tagged-values>>
member?
]
if
]
any?
[
]
[
insn slot
invalid-allocation-gc-root
]
if
]
each
]
when
expected
roots>>
empty?
[
]
[
insn
gc-map>>
gc-roots>>
[
tagged-rep
state
value-flow-read
]
map
concat
:>
available expected
roots>>
[|
value |
value snapshot
aliases>>
value-flow-root
available
member?
[
]
[
insn value
invalid-allocation-gc-root
]
if
]
each
]
if
expected
derived>>
[|
derived base |
derived snapshot
aliases>>
value-flow-root
:>
value base snapshot
aliases>>
value-flow-root
:>
base-value value base-value
=
[
]
[
insn
gc-map>>
derived-roots>>
[|
slot base-slot |
value slot
int-rep
state
value-flow-read
member?
base-value base-slot
tagged-rep
state
value-flow-read
member?
and
base-slot insn
gc-map>>
gc-roots>>
member?
and
]
assoc-find
2nip
[
]
[
insn derived base
invalid-allocation-derived-root
]
if
]
if
]
assoc-each
;