Loading the code workspace…
Implement basic register allocation using a linear scan algorithm.
Implement liveness analysis:
Implement linear scan allocation:
Generate load/store for spilled variables:
Handle register constraints:
Deciding which values live in registers is the eternal compiler problem — x86-64 gives you 16 GPRs for programs with thousands of live values. The spilling logic you write here is what V8's linear-scan allocator does under 16ms frame budgets, and why 'register pressure' appears in every serious performance postmortem.
Sample case for Run. Submit grades this sample plus all hidden tests.