Handbook
Glossary
greedy-allocate-one ( interval -- )
Vocabulary
compiler
.
cfg
.
register-allocation
.
greedy
Inputs
interval
an
object
Outputs
None
Definition
USING:
arrays
combinators
kernel
math.order
sequences
;
IN:
compiler.cfg.register-allocation.greedy
::
greedy-allocate-one
( interval -- )
interval
interval-stage
{
"stage-assign"
"stage-region"
"stage-local"
"stage-spill"
"stage-done"
}
nth
greedy-count
f
:>
cheapest! interval
allocation-order
[|
reg |
interval reg
register-conflicts
:>
conflicts conflicts
empty?
[
interval reg
greedy-assign
t
]
[
interval
interval-stage
region-stage
=
[
]
[
interval conflicts
evictable?
[
interval reg conflicts
candidate-cost
:>
cost cheapest
[
cost cheapest
second
before?
]
[
t
]
if
[
reg cost
2array
cheapest!
]
when
]
when
]
if
f
]
if
]
any?
[
cheapest
[
first
interval
swap
greedy-evict
]
[
interval
interval-stage
{
{
0
[
interval
region-stage
advance-stage
interval
greedy-enqueue
"stage-deferrals"
greedy-count
]
}
{
4
[
interval
last-chance-recolor
~quotation~
unless
]
}
{
3
[
interval
last-chance-recolor
~quotation~
unless
]
}
{
1
[
interval
global-split-plan
~quotation~
~quotation~
if*
]
}
{
2
[
interval
local-split-plan
~quotation~
~quotation~
if*
]
}
[
drop
interval
greedy-register-pressure
]
}
case
]
if*
]
unless
;