register-free-windows ( interval reg -- windows )


Vocabulary
compiler.cfg.register-allocation.greedy

Inputs
intervalan object
regan object


Outputs
windowsan object


Definition


:: register-free-windows ( interval reg -- windows )
interval live-interval-start :> cursor! interval
live-interval-end 1 + :> end
V{ } clone :> windows interval reg register-index entries>>
[| entry |
entry second cursor >= entry first end <= and [
entry first cursor >
[ cursor entry first 1 - 2array windows push ] when
cursor entry second 1 + max cursor!
] when
] each cursor end <= [ cursor end 2array windows push ] when
windows ;