Assigning registers to live intervals


The compiler.cfg.linear-scan.assignment assigns registers to live intervals. Before this compiler pass, all values in the cfg were represented as simple integers called "virtual registers" or vregs. In this pass, using the live interval data computed in the register allocation pass (compiler.cfg.linear-scan.allocation), those vregs are translated into physical registers.

Since there is an infinite number of vregs but the number of physical registers is limited, some values must be spilled. So this pass also handles spilling decisions and inserts ##spill and ##reload instructions where needed.

GC maps:
change-insn-gc-roots ( gc-map-insn quot: ( x -- x ) -- )

emit-##call-gc ( insn -- )


Pending intervals:
activate-interval ( live-interval -- )

add-pending ( live-interval -- )

pending-interval-assoc

expire-old-intervals ( n pending-heap -- )

remove-pending ( live-interval -- )


Spilling & reloading:
insert-reload ( live-interval -- )

insert-spill ( live-interval -- )


Vreg transformations:
vreg>reg ( vreg -- reg/spill-slot )

vreg>spill-slot ( vreg -- spill-slot )

vregs>regs ( assoc -- assoc' )