Changes between Version 10 and Version 11 of Commentary/Compiler/NewCodeGenPipeline


Ignore:
Timestamp:
Jul 29, 2008 1:56:50 PM (7 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/NewCodeGenPipeline

    v10 v11  
    2222 * '''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`.
    2323
    24  * '''Lay out the stack'''
     24 * '''Figure out the stack layout'''
    2525   * 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. 
    2626   * The stack layout pass produces a mapping of: ''(`Area` -> `StackOffset`)''. For more detail, see [wiki:Commentary/Compiler/StackAreas#Layingoutthestack the description of stack layout.]
    2727   * 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.
    2928
     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 
    3033 * '''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.
    3134   * `LastCall` and `LastReturn` nodes are replaced by `Jump`s.