process-bundle ( bundle -- )


Vocabulary
compiler.cfg.register-allocation.backtracking

Inputs
bundlean object


Outputs
None

Definition


:: process-bundle ( bundle -- )
f :> cheapest! f :> split-option! bundle
bundle-register-order [| reg |
bundle reg bundle-conflicts
:> conflicts conflicts empty?
[ bundle reg assign-bundle t ] [
conflicts conflict-cost :> cost bundle conflicts
first-bundle-conflict
:> conflict conflict spill-site-weights get at 1 or
cost + :> move-cost split-option [
move-cost split-option third <
move-cost split-option third =
conflict split-option second > and or
] [ t ] if
[ reg conflict move-cost 3array split-option! ] when
cheapest [ cost cheapest third < ] [ t ] if
[ reg conflicts cost 3array cheapest! ] when f
] if
] any? [
cheapest third bundle weight>> <
[ bundle cheapest assign-with-eviction ] [
bundle split-budget-exhausted?
[ bundle split-bundle-minimally ] [
bundle split-option second conflict-split-site
[| site |
bundle spillset>>
[ split-option first >>hint drop ] when*
bundle site split-bundle-at
] [ bundle split-bundle ] if*
] if
] if
] unless ;