Changes between Version 10 and Version 11 of Commentary/Compiler/NewCodeGenPipeline
- Timestamp:
- 07/29/08 06:56:50 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Compiler/NewCodeGenPipeline
v10 v11 22 22 * '''Add spill/reload''', implemented in `CmmSpillReload`, to spill live C-- variables before a call and reload them afterwards. The spill and reload instructions are simply memory stores and loads respectively, using symbolic stack offsets (see [wiki:Commentary/Compiler/StackAreas#Layingoutthestack stack layout]). For example, a spill of variable 'x' would look like `Ptr32[SS(x)] = x`. 23 23 24 * ''' Lay out the stack'''24 * '''Figure out the stack layout''' 25 25 * Each variable 'x', and each proc-point label 'K', has an associated ''Area'', written SS(x) and SS(k) resp, that names a contiguous portion of the stack frame. 26 26 * The stack layout pass produces a mapping of: ''(`Area` -> `StackOffset`)''. For more detail, see [wiki:Commentary/Compiler/StackAreas#Layingoutthestack the description of stack layout.] 27 27 * A `StackOffset` is the byte offset of a stack slot from the old end (high address) of the frame. It doesn't vary as the physical stack pointer moves. 28 * ONce the stack layout mapping has been determined, a second pass walks over the graph, replacing references to `Areas` with offsets from the stack pointer.29 28 29 * '''Manifest the stack pointer'''. Once the stack layout mapping has been determined, a second pass walks over the graph, making the stack pointer, `Sp` explicit. Before this pass, there is no `Sp` at all. After this, `Sp` is completely manifest. 30 * replacing references to `Areas` with offsets from `Sp`. 31 * adding adjustments to `Sp`. 32 30 33 * '''Split into multiple !CmmProcs'''. At this point we build an info-table for each of the !CmmProcs, including SRTs. Done on the basis of the live local variables (by now mapped to stack slots) and live CAF statics. 31 34 * `LastCall` and `LastReturn` nodes are replaced by `Jump`s.
