1. 28 Jan, 2003 1 commit
  2. 13 Jan, 2003 1 commit
  3. 27 Dec, 2002 1 commit
  4. 19 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-19 14:33:22 by simonmar] · 0d27d151
      simonmar authored
      Terrible hack to restore CAF handling behaviour in GHCi (it's
      currently broken).
      
      The story used to be this: in newCAF(), if the CAF is in dynamically
      loaded code, then we save the CAF's info ptr in a spare slot in the
      closure, and add the CAF to the caf_list.  The GC will retain
      everything on the caf_list.  At any point the CAFs can all be reverted
      by replacing their info pointers from the saved copies.
      
      CAFs need to be retained for GHCi because they might be required in a
      future execution; an optimisation would be to avoid retaining the CAFs
      if we're in "revert mode"; i.e. the CAFs are all going to be reverted
      after execution anyway.  Also, this only applies to CAFs in compiled
      code; CAFs in interpreted code are currently always retained.
      
      Anyway, the old story is harder now that I removed the code that
      checks whether a pointer is dynamically loaded or not (:-)).  Rather
      than re-instate that code, I created a new version of newCAF
      (newDynCAF), and arranged that the dynamic linker redirects any
      references to newCAF to point to newDynCAF instead.  The result is
      more efficient than before, and takes less code.
      0d27d151
  5. 11 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-11 15:36:20 by simonmar] · 0bffc410
      simonmar authored
      Merge the eval-apply-branch on to the HEAD
      ------------------------------------------
      
      This is a change to GHC's evaluation model in order to ultimately make
      GHC more portable and to reduce complexity in some areas.
      
      At some point we'll update the commentary to describe the new state of
      the RTS.  Pending that, the highlights of this change are:
      
        - No more Su.  The Su register is gone, update frames are one
          word smaller.
      
        - Slow-entry points and arg checks are gone.  Unknown function calls
          are handled by automatically-generated RTS entry points (AutoApply.hc,
          generated by the program in utils/genapply).
      
        - The stack layout is stricter: there are no "pending arguments" on
          the stack any more, the stack is always strictly a sequence of
          stack frames.
      
          This means that there's no need for LOOKS_LIKE_GHC_INFO() or
          LOOKS_LIKE_STATIC_CLOSURE() any more, and GHC doesn't need to know
          how to find the boundary between the text and data segments (BIG WIN!).
      
        - A couple of nasty hacks in the mangler caused by the neet to
          identify closure ptrs vs. info tables have gone away.
      
        - Info tables are a bit more complicated.  See InfoTables.h for the
          details.
      
        - As a side effect, GHCi can now deal with polymorphic seq.  Some bugs
          in GHCi which affected primitives and unboxed tuples are now
          fixed.
      
        - Binary sizes are reduced by about 7% on x86.  Performance is roughly
          similar, some programs get faster while some get slower.  I've seen
          GHCi perform worse on some examples, but haven't investigated
          further yet (GHCi performance *should* be about the same or better
          in theory).
      
        - Internally the code generator is rather better organised.  I've moved
          info-table generation from the NCG into the main codeGen where it is
          shared with the C back-end; info tables are now emitted as arrays
          of words in both back-ends.  The NCG is one step closer to being able
          to support profiling.
      
      This has all been fairly thoroughly tested, but no doubt I've messed
      up the commit in some way.
      0bffc410
  6. 23 Oct, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-10-23 08:52:26 by simonmar] · d12023f5
      simonmar authored
      Add atomicModifyIORefzh_fast symbol (should have been done with the
      rest of the atomicModifyIORef# commit, thanks to Manuel Chakravarty
      for pointing out the problem).
      d12023f5
  7. 12 Oct, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-10-12 23:12:08 by wolfgang] · 31442604
      wolfgang authored
      Make the Mac OS X build use the HaskellSupport.framework (a MacOS-style "framework" that includes the required libraries libgmp and dlcompat) if it is present. The HaskellSupport.framework is not yet in CVS, but is available from me.
      31442604
  8. 02 Oct, 2002 1 commit
  9. 13 Sep, 2002 1 commit
    • simonpj's avatar
      [project @ 2002-09-13 15:02:25 by simonpj] · 9af77fa4
      simonpj authored
      --------------------------------------
      	Make Template Haskell into the HEAD
      	--------------------------------------
      
      This massive commit transfers to the HEAD all the stuff that
      Simon and Tim have been doing on Template Haskell.  The
      meta-haskell-branch is no more!
      
      WARNING: make sure that you
      
        * Update your links if you are using link trees.
          Some modules have been added, some have gone away.
      
        * Do 'make clean' in all library trees.
          The interface file format has changed, and you can
          get strange panics (sadly) if GHC tries to read old interface files:
          e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
      	  Binary.get(TyClDecl): ForeignType
      
        * You need to recompile the rts too; Linker.c has changed
      
      
      However the libraries are almost unaltered; just a tiny change in
      Base, and to the exports in Prelude.
      
      
      NOTE: so far as TH itself is concerned, expression splices work
      fine, but declaration splices are not complete.
      
      
      		---------------
      		The main change
      		---------------
      
      The main structural change: renaming and typechecking have to be
      interleaved, because we can't rename stuff after a declaration splice
      until after we've typechecked the stuff before (and the splice
      itself).
      
      * Combine the renamer and typecheker monads into one
      	(TcRnMonad, TcRnTypes)
        These two replace TcMonad and RnMonad
      
      * Give them a single 'driver' (TcRnDriver).  This driver
        replaces TcModule.lhs and Rename.lhs
      
      * The haskell-src library package has a module
      	Language/Haskell/THSyntax
        which defines the Haskell data type seen by the TH programmer.
      
      * New modules:
      	hsSyn/Convert.hs 	converts THSyntax -> HsSyn
      	deSugar/DsMeta.hs 	converts HsSyn -> THSyntax
      
      * New module typecheck/TcSplice type-checks Template Haskell splices.
      
      		-------------
      		Linking stuff
      		-------------
      
      * ByteCodeLink has been split into
      	ByteCodeLink	(which links)
      	ByteCodeAsm	(which assembles)
      
      * New module ghci/ObjLink is the object-code linker.
      
      * compMan/CmLink is removed entirely (was out of place)
        Ditto CmTypes (which was tiny)
      
      * Linker.c initialises the linker when it is first used (no need to call
        initLinker any more).  Template Haskell makes it harder to know when
        and whether to initialise the linker.
      
      
      	-------------------------------------
      	Gathering the LIE in the type checker
      	-------------------------------------
      
      * Instead of explicitly gathering constraints in the LIE
      	tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
        we now dump the constraints into a mutable varabiable carried
        by the monad, so we get
      	tcExpr :: RenamedExpr -> TcM TypecheckedExpr
      
        Much less clutter in the code, and more efficient too.
        (Originally suggested by Mark Shields.)
      
      
      		-----------------
      		Remove "SysNames"
      		-----------------
      
      Because the renamer and the type checker were entirely separate,
      we had to carry some rather tiresome implicit binders (or "SysNames")
      along inside some of the HsDecl data structures.  They were both
      tiresome and fragile.
      
      Now that the typechecker and renamer are more intimately coupled,
      we can eliminate SysNames (well, mostly... default methods still
      carry something similar).
      
      		-------------
      		Clean up HsPat
      		-------------
      
      One big clean up is this: instead of having two HsPat types (InPat and
      OutPat), they are now combined into one.  This is more consistent with
      the way that HsExpr etc is handled; there are some 'Out' constructors
      for the type checker output.
      
      So:
      	HsPat.InPat	--> HsPat.Pat
      	HsPat.OutPat	--> HsPat.Pat
      	No 'pat' type parameter in HsExpr, HsBinds, etc
      
      	Constructor patterns are nicer now: they use
      		HsPat.HsConDetails
      	for the three cases of constructor patterns:
      		prefix, infix, and record-bindings
      
      	The *same* data type HsConDetails is used in the type
      	declaration of the data type (HsDecls.TyData)
      
      Lots of associated clean-up operations here and there.  Less code.
      Everything is wonderful.
      9af77fa4
  10. 05 Sep, 2002 1 commit
  11. 16 Aug, 2002 1 commit
  12. 18 Jul, 2002 1 commit
  13. 17 Jul, 2002 1 commit
  14. 08 Jul, 2002 1 commit
  15. 02 Jul, 2002 1 commit
  16. 15 Jun, 2002 1 commit
  17. 12 Jun, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-06-12 22:29:43 by wolfgang] · f55855f2
      wolfgang authored
      Initial support for GHCi on MacOS X.
      The code still has problems with global variables in compiled C code, but
      it _seems_ to work OK for GHC-compiled code. Many error checks are still
      missing.
      f55855f2
  18. 11 Jun, 2002 1 commit
  19. 10 Jun, 2002 1 commit
  20. 09 Jun, 2002 2 commits
  21. 04 Jun, 2002 1 commit
  22. 01 May, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-05-01 15:46:14 by simonmar] · 786db576
      simonmar authored
      Cleanup and overhaul the bogus dynamic library loading code in
      InteractiveUI.  Bugs fixed:
      
        - when linking in extra_libraries from a package,
          we now search library_paths in addition to the default
          dlopen() paths.
      
        - the path-searching machinery for dynamic libraries specified
          on the command line was broken, it didn't work unless the library
          was found on the first path in the list.
      786db576
  23. 23 Apr, 2002 1 commit
  24. 10 Apr, 2002 1 commit
    • stolz's avatar
      [project @ 2002-04-10 11:43:43 by stolz] · c1f3fad1
      stolz authored
      Two new scheduler-API primops:
      
      1) GHC.Conc.forkProcess/forkProcess# :: IO Int
         This is a low-level call to fork() to replace Posix.forkProcess().
         In a Concurrent Haskell setting, only the thread invoking forkProcess()
         is alive in the child process. Other threads will be GC'ed!
            This brings the RTS closer to pthreads, where a call to fork()
         doesn't clone any pthreads, either.
            The result is 0 for the child and the child's pid for the parent.
         The primop will barf() when used on mingw32, sorry.
      
      2) GHC.Conc.labelThread/forkProcess# :: String -> IO ()
         Useful for scheduler debugging: If the RTS is compiled with DEBUGging
         support, this primitive assigns a name to the current thread which
         will be used in debugging output (+RTS -D1). For larger applications,
         simply numbering threads is not sufficient.
           Notice: The Haskell side of this call is always available, but if
         you are not compiling with debugging support, the actual primop will
         turn into a no-op.
      c1f3fad1
  25. 01 Apr, 2002 1 commit
  26. 29 Mar, 2002 1 commit
    • krasimir's avatar
      [project @ 2002-03-29 20:46:50 by krasimir] · 57f83897
      krasimir authored
      Latest Win32 implementation allows dynamic loading only for *.dll libraries. This commit add checking for *.drv libraries (drivers). This allows loading of winspool.drv needed for ObjectIO
      57f83897
  27. 25 Mar, 2002 1 commit
  28. 12 Feb, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-02-12 15:17:13 by simonmar] · 2cc5b907
      simonmar authored
      Switch over to the new hierarchical libraries
      ---------------------------------------------
      
      This commit reorganises our libraries to use the new hierarchical
      module namespace extension.
      
      The basic story is this:
      
         - fptools/libraries contains the new hierarchical libraries.
           Everything in here is "clean", i.e. most deprecated stuff has
           been removed.
      
      	- fptools/libraries/base is the new base package
      	  (replacing "std") and contains roughly what was previously
      	  in std, lang, and concurrent, minus deprecated stuff.
      	  Things that are *not allowed* in libraries/base include:
      		Addr, ForeignObj, ByteArray, MutableByteArray,
      		_casm_, _ccall_, ``'', PrimIO
      
      	  For ByteArrays and MutableByteArrays we use UArray and
      	  STUArray/IOUArray respectively now.
      
      	  Modules previously called PrelFoo are now under
      	  fptools/libraries/GHC.  eg. PrelBase is now GHC.Base.
      
      	- fptools/libraries/haskell98 provides the Haskell 98 std.
      	  libraries (Char, IO, Numeric etc.) as a package.  This
      	  package is enabled by default.
      
      	- fptools/libraries/network is a rearranged version of
      	  the existing net package (the old package net is still
      	  available; see below).
      
      	- Other packages will migrate to fptools/libraries in
      	  due course.
      
           NB. you need to checkout fptools/libraries as well as
           fptools/hslibs now.  The nightly build scripts will need to be
           tweaked.
      
         - fptools/hslibs still contains (almost) the same stuff as before.
           Where libraries have moved into the new hierarchy, the hslibs
           version contains a "stub" that just re-exports the new version.
           The idea is that code will gradually migrate from fptools/hslibs
           into fptools/libraries as it gets cleaned up, and in a version or
           two we can remove the old packages altogether.
      
         - I've taken the opportunity to make some changes to the build
           system, ripping out the old hslibs Makefile stuff from
           mk/target.mk; the new package building Makefile code is in
           mk/package.mk (auto-included from mk/target.mk).
      
           The main improvement is that packages now register themselves at
           make boot time using ghc-pkg, and the monolithic package.conf
           in ghc/driver is gone.
      
           I've updated the standard packages but haven't tested win32,
           graphics, xlib, object-io, or OpenGL yet.  The Makefiles in
           these packages may need some further tweaks, and they'll need
           pkg.conf.in files added.
      
         - Unfortunately all this rearrangement meant I had to bump the
           interface-file version and create a bunch of .hi-boot-6 files :-(
      2cc5b907
  29. 04 Feb, 2002 1 commit
    • sewardj's avatar
      [project @ 2002-02-04 16:30:20 by sewardj] · c5ab8000
      sewardj authored
      Adding section descriptions, for ELF: don't record sections satisfying
      
         size == 0
         ||
         kind `notElem` [SECTIONKIND_CODE_OR_RODATA, SECTIONKIND_RWDATA]
      
      The latter condition is really an optimisation based on knowledge of
      what queries will be made of the table.  Still, seems to work, and
      reduces the number of sections in the list by about a factor of 3,
      so hopefully will improve GC performance in GHCi.
      
      If you get wierd GC problems in GHCi ... this may be to blame.
      c5ab8000
  30. 01 Feb, 2002 1 commit
  31. 29 Jan, 2002 2 commits
    • sof's avatar
      [project @ 2002-01-29 06:15:03 by sof] · a704ee9c
      sof authored
      Update comments re: reloc overflow. A careful re-read of the PE
      spec did prove useful; Sec 4.1 (last para) describes how overflow
      is handled.
      a704ee9c
    • sof's avatar
      [project @ 2002-01-29 02:41:21 by sof] · 9efa7107
      sof authored
      PEi386/COFF: handle relocation overflows, i.e., if a section is
      marked with the flag (MY)IMAGE_SCN_LNK_NRELOC_OVFL, then
      the first entry in the relocation table holds the 32-bit
      relocation count rather than 16-bit number in the section header.
      Apparently, a version of the MS PE spec exists that spells this
      out, but haven't been able to locate it (perhaps people on the
      'inside' could try to locate an up-to-date version...?) winnt.h
      is clear enough about it though (as is the GNU libbfd sources).
      
      This is the Right Way to compute the relocation count, but
      unfortunately libbfd / GNU ld is generating bogus output
      when the reloc field overflows (causing objdump/nm etc. to
      crash when trying to read the generated output!) Looking into it.
      
      Once this has been cleared up/fixed, the splitting up of HSstd.o
      (and HSwin32.o) should be a thing of the past. I've taken the
      liberty of disabling the suspiciously-large-reloc-section test
      already.
      9efa7107
  32. 23 Jan, 2002 1 commit
    • sewardj's avatar
      [project @ 2002-01-23 11:29:12 by sewardj] · 830c1108
      sewardj authored
      Fix two problems with the ELF linker:
      
      1.  Determine section attributes by examining various bits in the
          section header tables, rather than from the section names.  This
          makes it robust against future changes / additions to the set of
          section names.
      
      2.  Handle local symbols differently.  Do not add them to our own
          local symbol table for this object, since that's
      
          (a) wrong -- multiple local symbols can have the same name so long
              as each is in a different section, so if we just dump them into
              the local symbol table we'll wind up with apparently duplicate
              symbols
      
          (b) totally unnecessary, since the relocations against local symbols
              simply specify an index into the ELF symbol table for the object,
              from whence the address can be calculated without reference to the
              name.
      
      TODO: Test on sparc-solaris
            Investigate whether PEi386 linker needs fixing similarly
      and then
      MERGE TO STABLE
      830c1108
  33. 29 Dec, 2001 1 commit
  34. 10 Dec, 2001 2 commits
  35. 22 Nov, 2001 1 commit
  36. 08 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-08 12:46:31 by simonmar] · 0671ef05
      simonmar authored
      Fix the large block allocation bug (Yay!)
      -----------------------------------------
      
      In order to do this, I had to
      
       1. in each heap-check failure branch, return the amount of heap
          actually requested, in a known location (I added another slot
          in StgRegTable called HpAlloc for this purpose).  This is
          useful for other reasons - in particular it makes it possible
          to get accurate allocation statistics.
      
       2. In the scheduler, if a heap check fails and we wanted more than
          BLOCK_SIZE_W words, then allocate a special large block and place
          it in the nursery.  The nursery now has to be double-linked so
          we can insert the new block in the middle.
      
       3. The garbage collector has to be able to deal with multiple objects
          in a large block.  It turns out that this isn't a problem as long as
          the large blocks only occur in the nursery, because we always copy
          objects from the nursery during GC.  One small change had to be
          made: in evacuate(), we may need to follow the link field from the
          block descriptor to get to the block descriptor for the head of a
          large block.
      
       4. Various other parts of the storage manager had to be modified
          to cope with a nursery containing a mixture of block sizes.
      
      Point (3) causes a slight pessimization in the garbage collector.  I
      don't see a way to avoid this.  Point (1) causes some code bloat (a
      rough measurement is around 5%), so to offset this I made the
      following change which I'd been meaning to do for some time:
      
        - Store the values of some commonly-used absolute addresses
          (eg. stg_update_PAP) in the register table.  This lets us use
          shorter instruction forms for some absolute jumps and saves some
          code space.
      
        - The type of Capability is no longer the same as an StgRegTable.
          MainRegTable renamed to MainCapability.  See Regs.h for details.
      
      Other minor changes:
      
        - remove individual declarations for the heap-check-failure jump
          points, and declare them all in StgMiscClosures.h instead.  Remove
          HeapStackCheck.h.
      
      Updates to the native code generator to follow.
      0671ef05
  37. 26 Oct, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-10-26 11:33:13 by sewardj] · 3eb89949
      sewardj authored
      merge from stable, rev 1.60.2.10:
      
        Implement a debugging aid: look in GHCi's object symbol tables for
        symbols within DELTA bytes of the specified address, and show their
        names.  Only compiled with -DDEBUG.  The new fn is called ghci_enquire
        and you can call it from within a gdb session.
      3eb89949