Changes between Version 5 and Version 6 of Commentary/Compiler/StackAreas


Ignore:
Timestamp:
May 19, 2008 12:45:01 PM (7 years ago)
Author:
dias
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/StackAreas

    v5 v6  
    5656}}}
    5757
    58 If g() returns x on the stack, we would like the return location be used as x's stack slot for the rest of the procedure.
    59 Issues raised by this (to be expounded upon):
     58If g() returns x on the stack, we would like the return location to be x's stack slot for the rest of the procedure.
     59Issues raised by this:
    6060 * Stack holes where return addresses were stored. Such a hole can be filled with a variable that can't be stored in a convenient return slot.
    6161 * Stack allocation must be based on control flow -- how else would you know if x has already been placed or if it can be stored on the bottom of the stack?
    62  
    63 Ah! Here's an argument for making the stack slots abstract and unique, instead of referring to two values that share the same stack slot (e.g. a call parameter and a return parameter) by the same name. Another apparently important GHC optimization is to keep a return address live on the stack if it can be reused in a subsequent call. It would be really easy to say that an abstract stack slot is live. But it's not so easy if the only way to name the slot is by its (non-distinct) address stack(L, 3) because stack(L, 3) may also be used by some other value that shares the same slot.