Changes between Version 3 and Version 4 of Building/Porting


Ignore:
Timestamp:
Oct 17, 2006 10:44:03 AM (9 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Porting

    v3 v4  
    326326The mangler is an evil Perl-script
    327327([[GhcFile(driver/mangler/ghc-asm.lprl)]]) that rearranges the assembly
    328 code output from gcc to do two main things:
    329 
    330  * Remove function prologues and epilogues, and all movement of the C
    331    stack pointer.  This is to support tail-calls: every code block in
    332    Haskell code ends in an explicit jump, so we don't want the C-stack
    333    overflowing while we're jumping around between code blocks.
    334 
    335  * Move the ''info table'' for a closure next to the entry code for
    336    that closure.  In unregisterised code, info tables contain a
    337    pointer to the entry code, but in registerised compilation we
    338    arrange that the info table is shoved right up against the entry
    339    code, and addressed backwards from the entry code pointer (this
    340    saves a word in the info table and an extra indirection when
    341    jumping to the closure entry code).
     328code output from gcc.  To understand what the manger does and how it works, see
     329[wiki:Commentary/EvilMangler].
    342330
    343331The mangler is abstracted to a certain extent over some
    344332architecture-specific things such as the particular assembler
    345333directives used to herald symbols.  Take a look at the definitions for
    346 other architectures and use these as a starting point.
     334other architectures and use these as a starting point for porting it to
     335your platform.
    347336
    348337=== The splitter ===
     
    364353registerised build going, but it's a desirable thing to have
    365354because it can cut compilation times in half.  The native code
    366 generator is described in some detail in the [wiki:Commentary].
     355generator is described in detail in [wiki:Commentary/BackEnds/NCG].
    367356
    368357=== GHCi ===