1. 15 Dec, 2000 1 commit
  2. 14 Dec, 2000 2 commits
  3. 12 Dec, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-12-12 12:19:57 by simonmar] · 65ace55b
      simonmar authored
      - Add primops for {read,write,index}{Int,Word}{8,16,32,64}OffAddr.
          This enables us to remove all the _casm_s from Int/Word.
      
        - Replace new{Char,Int,etc.}Array# with newByteArray# (save a few primops,
          at the cost of having to know the size of these types in PrelArr).
      
        - Implement MArray/IArray support for sized types.  finally.
      
        - Move the guts of the sized types into ghc/lib/std, we'll need
          them for doing more FFIish things in the Prelude.
      65ace55b
  4. 13 Nov, 2000 1 commit
  5. 06 Oct, 2000 1 commit
  6. 28 Apr, 2000 1 commit
  7. 27 Apr, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-04-27 16:35:29 by sewardj] · f0901617
      sewardj authored
      A total rewrite of the BCO assembler/linker, and rationalisation of
      the code management and code generation phases of Hugs.
      
      Problems with the old linker:
      
      * Didn't have a clean way to insert a pointer to GHC code into a BCO.
        This meant CAF GC didn't work properly in combined mode.
      
      * Leaked memory.  Each BCO, caf and constructor generated by Hugs had
        a corresponding malloc'd record used in its construction.  These
        records existed forever.  Pointers from the Hugs symbol tables into
        the runtime heap always went via these intermediates, for no apparent
        reason.
      
      * A global variable holding a list of top-level stg trees was used
        during code generation.  It was hard to associate trees in this
        list with entries in the name/tycon tables.  Just too many
        mechanisms.
      
      The New World Order is as follows:
      
      * The global code list (stgGlobals) is gone.
      
      * Each name in the name table has a .closure field.  This points
        to the top-level code for that name.  Before bytecode generation
        this points to a STG tree.  During bytecode generation but before
        bytecode linking it is a MPtr pointing to a malloc'd intermediate
        structure (an AsmObject).  After linking, it is a real live pointer
        into the execution heap (CPtr) which is treated as a root during GC.
      
        Because tuples do not have name table entries, tycons which are
        tuples also have a .closure field, which is treated identically
        to those of name table entries.
      
      * Each module has a code list -- a list of names and tuples.  If you
        are a name or tuple and you have something (code, CAF or Con) which
        needs to wind up in the execution heap, you MUST be on your module's
        code list.  Otherwise you won't get code generated.
      
      * Lambda lifting generates new name table entries, which of course
        also wind up on the code list.
      
      * The initial phase of code generation for a module m traverses m's
        code list.  The stg trees referenced in the .closure fields are
        code generated, creating AsmObject (AsmBCO, AsmCAF, AsmCon) in
        mallocville.  The .closure fields then point to these AsmObjects.
        Since AsmObjects can be mutually recursive, they can contain
        references to:
           * Other AsmObjects            Asm_RefObject
           * Existing closures           Asm_RefNoOp
           * name/tycon table entries    Asm_RefHugs
        AsmObjects can also contain BCO insns and non-ptr words.
      
      * A second copy-and-link phase copies the AsmObjects into the
        execution heap, resolves the Asm_Ref* items, and frees up
        the malloc'd entities.
      
      * Minor cleanups in compile-time storage.  There are now 3 kinds of
        address-y things available:
           CPtr/mkCPtr/cptrOf    -- ptrs to Closures, probably in exec heap
                                    ie anything which the exec GC knows about
           MPtr/mkMPtr/mptrOf    -- ptrs to mallocville, which the exec GC
                                    knows nothing about
           Addr/mkAddr/addrOf    -- literal addresses (like literal ints)
      
      * Many hacky cases removed from codegen.c.  Referencing code or
        data during code generation is a lot simpler, since an entity
        is either:
            a CPtr, in which case use it as is
            a MPtr -- stuff it into the AsmObject and the linker will fix it
            a name or tycon
                   -- ditto
      
      * I've checked, using Purify that, at least in standalone mode,
        no longer leaks mallocd memory.  Prior to this it would leak at
        the rate of about 300k per Prelude.
      
      * Added this comment to the top of codegen.c.
      
      Still to do:
      
      * Reinstate peephole optimisation for BCOs.
      
      * Nuke magic number headers in AsmObjects, used for debugging.
      
      * Profile and accelerate.  Code generation is slower because linking
        is slower.  Evaluation GC is slower because markHugsObjects has
        slowed down.
      
      * Make setCurrentModule ignore name table entries created by the
        lambda-lifter.
      
      * Zap various #if 0's in codegen.c/Assembler.c.
      
      * Zap CRUDE_PROFILING.
      f0901617
  8. 11 Apr, 2000 1 commit
  9. 23 Mar, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-03-23 12:19:22 by sewardj] · 7e3624ba
      sewardj authored
      Allow clients of the linker library (object.[ch]) to specify, portably,
      symbols they wish to ignore in calls to ocGetNames().  Use this modification
      to support ignoring the multiple occurrences of ghc_cc_ID.
      7e3624ba
  10. 07 Mar, 2000 1 commit
  11. 03 Mar, 2000 1 commit
  12. 09 Feb, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-02-09 14:50:19 by sewardj] · 0198d561
      sewardj authored
      More bug fixes resulting from trying to load small programs into Hugs
      using the GHC Prelude:
      
      -- Better handling of kinds on class method types.  It's still a kludge
         (I reckon) but works well enough to correctly handle methods in
         Monad and Functor.  See comment in startGHCClass() in interface.c.
      
      -- Add hugsprimReadField and hugsprimShowField.
      
      -- Make error be exported from the Prelude.  For some reason, PrelErr.hi
         doesn't give a signature for error, so we have to fake it by copying
         that of hugsprimError.
      
      -- Handle fixity declarations read from interfaces.
      
      -- Set nameListMonad so that list comprehensions can be translated.
      0198d561
  13. 10 Jan, 2000 1 commit
  14. 20 Dec, 1999 1 commit
    • sewardj's avatar
      [project @ 1999-12-20 16:55:26 by sewardj] · 0f92da17
      sewardj authored
      * Fix silly bugs in new linker, object.[ch].
      
      * Allow modules to have arbitrary numbers of "extra" object files
        as well as their primary object file.  Initial requirement is
        that Prelude needs libHS_cbits.o/.dll as well as Prelude.o
        module(m).object is the primary object
        module(m).objectExtras are the extra objects
        module(m).objectExtraNames :: [Text] are their names.
        Modify machdep.c to assume that extra objects for module M
        live in the same directory as M's primary object.
      
      * Stuff 130ish symbol names into the RTS symbol table, enough
        so that the whole Prelude can be linked.  That includes symbols
        in the C library needed by libHS_cbits.  This is very hacky
        and needs to be fixed properly.
      0f92da17
  15. 17 Dec, 1999 1 commit
    • sewardj's avatar
      [project @ 1999-12-17 16:34:08 by sewardj] · 3e47ab23
      sewardj authored
      Reorganised object code loader/linker to make it much more modular and
      cleaner.  All the machinery is now in object.[ch].  This stuff is
      packaged up as close to a standalone library as I can reasonably get
      it -- in particular, it knows nothing about Hugs -- so that the linker
      could easily be used in some entirely different application with
      almost no changes, if we so desire.
      
      Minor mods to interface.c & storage.c to use the new linker API.
      3e47ab23