Changes between Version 2 and Version 3 of Commentary/Compiler/GeneratedCode


Ignore:
Timestamp:
Oct 29, 2013 5:15:50 AM (21 months ago)
Author:
Tarrasch
Comment:

Fix nested levels of bullets

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/GeneratedCode

    v2 v3  
    110110       practicably stored in actual available processor registers on most
    111111       architectures.
    112      * To deal with the lack of processor registers, most of the STG
     112     * To deal with the lack of processor registers, most of the STG 
    113113       registers are actually kept on the stack in a block of memory
    114        pointed to by a special STG register called the "base register" (or
     114       pointed to by a special STG register called the "base register" (or 
    115115       `BaseReg`). To get or set values of registers which are not kept in
    116116       processor registers, the STG machine generates an instruction to
     
    118118     * The most important four registers are the `BaseReg`, the stack
    119119       pointer (`Sp`), the heap pointer (`Hp`), and the general purpose
    120        register `R1` which is used for intermediate values, as well as for
    121        returning evaluated values when unwinding the stack. These are the
     120       register `R1` which is used for intermediate values, as well as for 
     121       returning evaluated values when unwinding the stack. These are the 
    122122       four registers which are assigned actual processor registers when
    123123       implementing the STG machine on x86.
    124      * The STG stack:
    125         * Stores function arguments and continuations (i.e. the stack
    126           frames which are executed when a function returns)
    127         * Grows downwards in memory
    128         * The top of the stack is pointed to by the STG register `Sp`, and
    129           the maximum available stack pointer is stored in `SpLim`. There is
    130           no frame pointer.
    131 
    132      * The heap:
    133         * Used to store many different sorts of heap object: notably
    134           functions, thunks and data constructors
    135         * Grows upwards in memory, towards the stack
    136         * All allocation occurs using a bump-allocator: the heap pointer is
    137           simply incremented by the number of bytes desired (subject to to a
    138           check that this does not exhaust available memory). The garbage
    139           collector is responsible for moving objects out of the area of the
    140           heap managed by the bump allocator and into the care of its
    141           generational collector.
    142         * The last address in the bump-allocated part of the heap that has
    143           been used is pointed to by the STG register `Hp`, with `HpLim`
    144           holding the maximum address available for bump-allocation.
    145 
    146 
     124 2. The STG stack:
     125     * Stores function arguments and continuations (i.e. the stack
     126       frames which are executed when a function returns)
     127     * Grows downwards in memory
     128     * The top of the stack is pointed to by the STG register `Sp`, and
     129       the maximum available stack pointer is stored in `SpLim`. There is
     130       no frame pointer.
     131
     132 3. The heap:
     133    * Used to store many different sorts of heap object: notably
     134      functions, thunks and data constructors
     135    * Grows upwards in memory, towards the stack
     136    * All allocation occurs using a bump-allocator: the heap pointer is
     137      simply incremented by the number of bytes desired (subject to to a
     138      check that this does not exhaust available memory). The garbage
     139      collector is responsible for moving objects out of the area of the
     140      heap managed by the bump allocator and into the care of its
     141      generational collector.
     142    * The last address in the bump-allocated part of the heap that has
     143      been used is pointed to by the STG register `Hp`, with `HpLim`
     144      holding the maximum address available for bump-allocation.
    147145
    148146=== Important concepts in the machine ===