Changes between Version 8 and Version 9 of Commentary/Compiler/NewCodeGenPipeline
- Jul 29, 2008 1:02:31 PM (6 years ago)
v8 v9 20 20 * The transformation inserts a function prologue at the start of each proc-point, and a function epilogue just before each branch to a proc-point. 21 21 22 * '''Add spill/reload''', implemented in `CmmSpillReload`, to spill live C-- variables before a call and reload them afterwards. The middle node of the result is `Middle` (from `ZipCfgCmm` extended with `Spill` and `Reload` constructors. 23 Invariant: (something like) all variables in a block are gotten from `CopyIn` or `Reload`. 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`. 24 23 25 24 * '''Lay out the stack''' 26 25 * A `SlotId` is the offset of a stack slot from the old end (high address) of the frame. It doesn't vary as the physical stack pointer moves. 27 * A particular variable has one and only one `SlotId`. 26 * A particular variable 'x' has one and only one `SlotId`, written `SS(x)`. 27 * A proc-point label K has a `SlotId`, written `SS(K)`, from which its (perhaps multiple) fields can be accessed. 28 28 * The stack layout pass produces a mapping of: ''(Area -> slotid)''. For more detail, see [wiki:Commentary/Compiler/StackAreas#Layingoutthestack the description of stack layout.] 29 29 * Walk over the graph, replacing references to stack areas with offsets from the stack pointer.