Changes between Version 10 and Version 11 of Commentary/Compiler/NewCodeGenPipeline
- Jul 29, 2008 1:56:50 PM (9 years ago)
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 * '''''' 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 30 31 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.