Changes between Version 72 and Version 73 of Commentary/Compiler/StackAreas


Ignore:
Timestamp:
Sep 19, 2013 2:36:00 PM (22 months ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/StackAreas

    v72 v73  
    6060An `Area` represents space on the stack; it may use either the `RegSlot` constructor to represent a single stack slot for a register or the `CallArea` constructor to represent parameters passed to/from a function call/return. In a young `CallArea`, the `BlockId` is the label of the function call's continuation, and it passes parameters to the call.  
    6161 
    62 '''Each `Area` grows down (towards lower addresses), with offset 0 pointing to the old end of the `Area`.''' 
    63 So offset 0 actually addresses the byte one beyond the high end of the `Area`. To address a 4-byte object at the old end of the `Area`, we use the offset 4. 
     62'''Area layout and addressing''' 
     63 * Each `Area` grows down, towards lower machine addresses.  
     64 * ''Offsets'' are always positive.  The low-offset end is also called the "old end" of the area, the high-offset end is also called the "young end". 
     65 * Offset 0 (if we allowed it) would address the byte one ''beyond'' the high-address end of the `Area`.  
     66 * Larger offsets (from the beginning of the `Area`) correspond to lower machine addresses. 
     67 * Hence, to address a 4-byte object at the old end of `Area` a, we use the offset +4, thus `(CmmStackSlot a 4)`. 
    6468 
    65  The old call area is the initial state of the stack on entry to the function (the overflow parameters and the return address) as well as any arguments that will be passed to a tail call. Note that `RegSlot` areas are very small (since they only need to store a single register), while `CallArea` are contiguous chunks of arguments. 
     69The `Old` call area is the initial state of the stack on entry to the function (the overflow parameters and the return address) as well as any arguments that will be passed to a tail call. Note that `RegSlot` areas are very small (since they only need to store a single register), while `CallArea` are contiguous chunks of arguments. 
    6670 
    6771To name a specific location on the stack, we represent its address with a new kind of `CmmExpr`: the `CmmStackSlot`.