Handbook
Glossary
exchange-affinity-colors ( graph order affinities colors -- )
Vocabulary
compiler
.
cfg
.
register-allocation
.
chordal
Inputs
graph
an
object
order
an
object
affinities
an
object
colors
an
object
Outputs
None
Definition
USING:
assocs
kernel
math
sequences
;
IN:
compiler.cfg.register-allocation.chordal
::
exchange-affinity-colors
( graph order affinities colors -- )
0
:>
passes!
t
:>
changed!
[
changed passes 2
<
and
]
[
f
changed! passes 1
+
passes! order
[|
vertex |
vertex affinities
at
[|
partner |
vertex colors
at
:>
first-color partner colors
at
:>
second-color second-color
[
first-color second-color
=
not
partner vertex graph
at
member?
not
and
]
[
f
]
if
[
vertex first-color second-color graph colors
two-color-component
:>
component partner component
key?
[
]
[
component first-color second-color
affinities colors
exchange-benefit
0
>
~quotation~
when
]
if
]
when
]
each
]
each
]
while
;