[commit: ghc] master: Produce new-style Cmm from the Cmm parser (a7c0387)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/a7c0387d20c1c9994d1100b14fbb8fb4e28a259e

>---------------------------------------------------------------

commit a7c0387d20c1c9994d1100b14fbb8fb4e28a259e
Author: Simon Marlow <[email protected]>
Date:   Wed Oct 3 09:30:56 2012 +0100

    Produce new-style Cmm from the Cmm parser
    
    The main change here is that the Cmm parser now allows high-level cmm
    code with argument-passing and function calls.  For example:
    
    foo ( gcptr a, bits32 b )
    {
      if (b > 0) {
         // we can make tail calls passing arguments:
         jump stg_ap_0_fast(a);
      }
    
      return (x,y);
    }
    
    More details on the new cmm syntax are in Note [Syntax of .cmm files]
    in CmmParse.y.
    
    The old syntax is still more-or-less supported for those occasional
    code fragments that really need to explicitly manipulate the stack.
    However there are a couple of differences: it is now obligatory to
    give a list of live GlobalRegs on every jump, e.g.
    
      jump %ENTRY_CODE(Sp(0)) [R1];
    
    Again, more details in Note [Syntax of .cmm files].
    
    I have rewritten most of the .cmm files in the RTS into the new
    syntax, except for AutoApply.cmm which is generated by the genapply
    program: this file could be generated in the new syntax instead and
    would probably be better off for it, but I ran out of enthusiasm.
    
    Some other changes in this batch:
    
     - The PrimOp calling convention is gone, primops now use the ordinary
       NativeNodeCall convention.  This means that primops and "foreign
       import prim" code must be written in high-level cmm, but they can
       now take more than 10 arguments.
    
     - CmmSink now does constant-folding (should fix #7219)
    
     - .cmm files now go through the cmmPipeline, and as a result we
       generate better code in many cases.  All the object files generated
       for the RTS .cmm files are now smaller.  Performance should be
       better too, but I haven't measured it yet.
    
     - RET_DYN frames are removed from the RTS, lots of code goes away
    
     - we now have some more canned GC points to cover unboxed-tuples with
       2-4 pointers, which will reduce code size a little.

 compiler/cmm/CLabel.hs                             |   15 +-
 compiler/cmm/Cmm.hs                                |    7 +-
 compiler/cmm/CmmBuildInfoTables.hs                 |    7 +-
 compiler/cmm/CmmCallConv.hs                        |   66 +-
 compiler/cmm/CmmContFlowOpt.hs                     |   12 +-
 compiler/cmm/CmmCvt.hs                             |   31 +-
 compiler/cmm/CmmInfo.hs                            |   46 +-
 compiler/cmm/CmmLayoutStack.hs                     |    6 +-
 compiler/cmm/CmmLex.x                              |   16 +-
 compiler/cmm/CmmMachOp.hs                          |    9 +-
 compiler/cmm/CmmNode.hs                            |   46 +-
 compiler/cmm/CmmOpt.hs                             |   21 +-
 compiler/cmm/CmmParse.y                            | 1267 +++++++++++---------
 compiler/cmm/CmmPipeline.hs                        |   13 +-
 compiler/cmm/CmmProcPoint.hs                       |    7 +-
 compiler/cmm/CmmSink.hs                            |   58 +-
 compiler/cmm/CmmType.hs                            |   18 +-
 compiler/cmm/CmmUtils.hs                           |   18 +-
 compiler/cmm/MkGraph.hs                            |  144 ++-
 compiler/cmm/OldCmm.hs                             |    9 +-
 compiler/cmm/OldPprCmm.hs                          |    8 +-
 compiler/cmm/PprC.hs                               |    1 -
 compiler/cmm/PprCmm.hs                             |   17 +-
 compiler/cmm/SMRep.lhs                             |   37 +-
 compiler/codeGen/CgCallConv.hs                     |    9 +-
 compiler/codeGen/CgCon.lhs                         |    4 +-
 compiler/codeGen/CgHeapery.lhs                     |    2 +-
 compiler/codeGen/CgProf.hs                         |   13 +-
 compiler/codeGen/CgUtils.hs                        |    4 +-
 compiler/codeGen/ClosureInfo.lhs                   |   24 +-
 compiler/codeGen/StgCmm.hs                         |    2 +-
 compiler/codeGen/StgCmmBind.hs                     |   41 +-
 compiler/codeGen/StgCmmClosure.hs                  |   25 +-
 compiler/codeGen/StgCmmCon.hs                      |    4 +-
 compiler/codeGen/StgCmmExpr.hs                     |    4 +-
 .../codeGen/{CgExtCode.hs => StgCmmExtCode.hs}     |  125 +--
 compiler/codeGen/StgCmmForeign.hs                  |   61 +-
 compiler/codeGen/StgCmmGran.hs                     |    6 +-
 compiler/codeGen/StgCmmHeap.hs                     |  161 ++--
 compiler/codeGen/StgCmmHpc.hs                      |    4 +-
 compiler/codeGen/StgCmmLayout.hs                   |   44 +-
 compiler/codeGen/StgCmmMonad.hs                    |  135 ++-
 compiler/codeGen/StgCmmPrim.hs                     |    4 +-
 compiler/codeGen/StgCmmProf.hs                     |   35 +-
 compiler/codeGen/StgCmmTicky.hs                    |    2 +-
 compiler/codeGen/StgCmmUtils.hs                    |    7 +-
 compiler/ghc.cabal.in                              |    2 +-
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs            |    1 -
 compiler/main/HscMain.hs                           |    6 +-
 compiler/nativeGen/AsmCodeGen.lhs                  |    9 +-
 compiler/nativeGen/RegAlloc/Linear/Main.hs         |   13 +-
 compiler/prelude/ForeignCall.lhs                   |   11 +-
 compiler/typecheck/TcForeign.lhs                   |    1 -
 includes/Cmm.h                                     |  293 ++++--
 includes/Rts.h                                     |    1 -
 includes/rts/Constants.h                           |   24 -
 includes/rts/storage/ClosureMacros.h               |    8 -
 includes/rts/storage/ClosureTypes.h                |   55 +-
 includes/rts/storage/Closures.h                    |   56 +-
 includes/rts/storage/Liveness.h                    |   34 -
 includes/rts/storage/SMPClosureOps.h               |    2 +-
 includes/stg/MiscClosures.h                        |   55 +-
 includes/stg/Regs.h                                |  331 +-----
 rts/Apply.cmm                                      |   72 +-
 rts/AutoApply.h                                    |    8 +-
 rts/ClosureFlags.c                                 |    5 +-
 rts/Exception.cmm                                  |  238 ++--
 rts/HeapStackCheck.cmm                             |  510 ++++-----
 rts/Interpreter.c                                  |   60 +-
 rts/LdvProfile.c                                   |    1 -
 rts/Linker.c                                       |  577 +++++-----
 rts/PrimOps.cmm                                    | 1159 ++++++++----------
 rts/Printer.c                                      |   35 +-
 rts/RaiseAsync.c                                   |    2 +-
 rts/RetainerProfile.c                              |   29 +-
 rts/StgMiscClosures.cmm                            |  126 ++-
 rts/StgStartup.cmm                                 |   56 +-
 rts/StgStdThunks.cmm                               |  302 +++---
 rts/Updates.cmm                                    |   97 +-
 rts/Updates.h                                      |   17 +-
 rts/sm/Compact.c                                   |   32 +-
 rts/sm/Evac.c                                      |    1 -
 rts/sm/Sanity.c                                    |   27 -
 rts/sm/Scav.c                                      |   26 -
 utils/genapply/GenApply.hs                         |   14 +-
 85 files changed, 3292 insertions(+), 3599 deletions(-)


Diff suppressed because of size. To see it, use:

    git show a7c0387d20c1c9994d1100b14fbb8fb4e28a259e
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.