Lecture 11: Compiling to Register Machines
About Register Machines
Register machines are an alternative to compilation to stack-based machines; they are closer to modern processors.
Picture of JVM State with:
- Procedure Stacks
- Slots
- Operand Stack
- Global Heap
Register Machine Model in Scala
xyz Example using GCC and digression on computer arithmetic
Organizing the global memory:
Memory Layout for Compiled Program
We next examine how to map various data in the program to the appropriate parts of the memory.
Mapping Variables to Registers
We start with local and intermediate variables of procedures.
Stack Frames and Procedure Calls
From Stack Machine to Register Machine
Register Allocation using Liveness Information
Continued in Lecture 12