Register allocation

Register allocation is the process of turning IR into a more platform-dependent representation by assigning hardware registers to virtual registers/variables. Normally, there exist fewer hardware registers than variables in the program, and if more registers than available have to be in use at the same time, the register allocator will have to "spill" some of them to memory (typically, the user stack). This adds execution overhead to the generated code since additional instructions are used for the spills. Optimal register allocation is a non-trivial and computationally intensive problem.

See also Spilling.

Get Oracle JRockit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.