1. 17 Oct, 2007 1 commit
    • Simon Marlow's avatar
      recordMutable: test for gen>0 before calling recordMutableCap · 3c58884e
      Simon Marlow authored
      For some reason the C-- version of recordMutable wasn't verifying that
      the object was in an old generation before attempting to add it to the
      mutable list, and this broke maessen_hashtab.  This version of
      recordMutable is only used in unsafeThaw#.
  2. 12 Oct, 2007 1 commit
  3. 11 Oct, 2007 1 commit
    • Simon Marlow's avatar
      Add a proper write barrier for MVars · 1ed01a87
      Simon Marlow authored
      Previously MVars were always on the mutable list of the old
      generation, which meant every MVar was visited during every minor GC.
      With lots of MVars hanging around, this gets expensive.  We addressed
      this problem for MUT_VARs (aka IORefs) a while ago, the solution is to
      use a traditional GC write-barrier when the object is modified.  This
      patch does the same thing for MVars.
      TVars are still done the old way, they could probably benefit from the
      same treatment too.
  4. 10 Oct, 2007 2 commits
  5. 27 Sep, 2007 1 commit
  6. 12 Sep, 2007 1 commit
  7. 11 Sep, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1466 (partly), which was causing concprog001(ghci) to fail · 066f1028
      Simon Marlow authored
      An AP_STACK now ensures that there is at least AP_STACK_SPLIM words of
      stack headroom available after unpacking the payload.  Continuations
      that require more than AP_STACK_SPLIM words of stack must do their own
      stack checks instead of aggregating their stack usage into the parent
      frame.  I have made this change for the interpreter, but not for
      compiled code yet - we should do this in the glorious rewrite of the
      code generator.
  8. 29 Aug, 2007 1 commit
  9. 28 Aug, 2007 1 commit
  10. 25 Aug, 2007 1 commit
  11. 16 Aug, 2007 1 commit
    • Ian Lynagh's avatar
      Fix the threaded RTS on Windows · 0ee85183
      Ian Lynagh authored
      When calling EnterCriticalSection and LeaveCriticalSection from C--
      code, we go via wrappers which use ccall (rather than stdcall).
  12. 15 Aug, 2007 1 commit
  13. 13 Aug, 2007 1 commit
    • gwright@antiope.com's avatar
      Fix build with external gmp library. · 24311993
      gwright@antiope.com authored
      ghc fails to build if you use an external gmp library. This is because
      ghc requires the header file gmp.h, which used to be provided by the
      internal gmp source code.  The file gmp.h is no longer part of the
      gmp source code, but is generated as part of the build procedure.
      If an external gmp is specified, the internal gmp is not build and the
      gmp.h file never gets generated.
      Of course, it was a bad idea anyway to use a header file from a potentially
      different version of the library.
      The patch sets HAVE_LIB_GMP if the gmp library is found during configuration
      and conditionalizes including the library header file on it.
  14. 08 Aug, 2007 1 commit
  15. 01 Aug, 2007 1 commit
    • Simon Marlow's avatar
      FIX recent PPC crashes introduced by the pointer-tagging patch (I hope) · e7c08550
      Simon Marlow authored
      There was an accidental endian-dependency in changes related to RET_FUN.
      The changes in question weren't strictly necessary - they were left
      over from the original workaround for the compacting GC problems, so
      I've just reverted those changes in this patch, which should hopefully
      fix the PPC problems.
  16. 27 Jul, 2007 1 commit
    • Simon Marlow's avatar
      Pointer Tagging · 6015a94f
      Simon Marlow authored
      This patch implements pointer tagging as per our ICFP'07 paper "Faster
      laziness using dynamic pointer tagging".  It improves performance by
      10-15% for most workloads, including GHC itself.
      The original patches were by Alexey Rodriguez Yakushev
      <mrchebas@gmail.com>, with additions and improvements by me.  I've
      re-recorded the development as a single patch.
      The basic idea is this: we use the low 2 bits of a pointer to a heap
      object (3 bits on a 64-bit architecture) to encode some information
      about the object pointed to.  For a constructor, we encode the "tag"
      of the constructor (e.g. True vs. False), for a function closure its
      arity.  This enables some decisions to be made without dereferencing
      the pointer, which speeds up some common operations.  In particular it
      enables us to avoid costly indirect jumps in many cases.
      More information in the commentary:
  17. 18 Jul, 2007 1 commit
  18. 17 Jul, 2007 1 commit
  19. 06 Jul, 2007 1 commit
  20. 05 Jul, 2007 1 commit
  21. 27 Jun, 2007 4 commits
  22. 26 Jun, 2007 1 commit
  23. 16 Jun, 2007 1 commit
  24. 15 Jun, 2007 1 commit
  25. 13 Jun, 2007 1 commit
    • Simon Marlow's avatar
      FIX #1418 (partially) · 23e5985c
      Simon Marlow authored
      When the con_desc field of an info table was made into a relative
      reference, this had the side effect of making the profiling fields
      (closure_desc and closure_type) also relative, but only when compiling
      via C, and the heap profiler was still treating them as absolute,
      leading to crashes when profiling with -hd or -hy.
      This patch fixes up the story to be consistent: these fields really
      should be relative (otherwise we couldn't make shared versions of the
      profiling libraries), so I've made them relative and fixed up the RTS
      to know about this.
  26. 05 Jun, 2007 1 commit
  27. 12 Jun, 2007 1 commit
    • andy@galois.com's avatar
      Adding new ffi calls into the Hpc rts subsystem · df58c2a5
      andy@galois.com authored
      foreign import ccall unsafe hs_hpc_write :: CString -> IO ()
      foreign import ccall unsafe hs_hpc_read  :: CString -> IO ()
      These write a Hpc description of the state of the world to a file, 
      or read a description into the current Hpc tickbox subsystem.
  28. 18 May, 2007 1 commit
  29. 16 May, 2007 1 commit
  30. 15 May, 2007 1 commit
    • Simon Marlow's avatar
      GHCi debugger: new flag -fbreak-on-exception · 17f848e1
      Simon Marlow authored
      When -fbreak-on-exception is set, an exception will cause GHCi to
      suspend the current computation and return to the prompt, where the
      history of the current evaluation can be inspected (if we are in
      :trace).  This isn't on by default, because the behaviour could be
      confusing: for example, ^C will cause a breakpoint.  It can be very
      useful for finding the cause of a "head []" or a "fromJust Nothing",
  31. 10 May, 2007 1 commit
  32. 30 Apr, 2007 1 commit
    • andy@galois.com's avatar
      Changing internal data structures used by Hpc · 55a5d8d9
      andy@galois.com authored
       - .tix files are now a list of MixModule, which contain a hash of the contents of the .mix file.
       - .mix files now have (the same) hash number.
      This changes allow different binaries that use the same module compiled in the same way
      to share coverage information.
  33. 27 Apr, 2007 1 commit
    • Simon Marlow's avatar
      Basic heap profile support without -prof · cbeb99ef
      Simon Marlow authored
      Now that constructor info tables contain the name of the constructor,
      we can generate useful heap profiles without requiring the whole
      program and libraries to be compiled with -prof.  So now, "+RTS -hT"
      generates a heap profile for any program, dividing the profile by
      constructor.  It wouldn't be hard to add support for grouping
      constructors by module, or to restrict the profile to certain
      This means that for the first time we can get heap profiles for GHCi,
      which was previously impossible because the byte-code
      interpreter and linker don't work with -prof.
  34. 24 Apr, 2007 1 commit
    • simonpj@microsoft.com's avatar
      Make ticky work, at least partly, on 64-bit machines · a01188d1
      simonpj@microsoft.com authored
      The ticky StgEntCounter structure was trying to be clever by using a
      fixed-width 32-bit field for the registeredp value.  But the code generators
      are not up to handling structures packed tightly like this (on a 64-bit
      architecture); result seg-fault on 64-bit.
      Really there should be some complaint from the code generators, not simply
      a seg fault.
      Anyway I switched to using native words for StgEntCounter fields, and
      now at least it works.
  35. 17 Apr, 2007 2 commits
    • Simon Marlow's avatar
      Re-working of the breakpoint support · cdce6477
      Simon Marlow authored
      This is the result of Bernie Pope's internship work at MSR Cambridge,
      with some subsequent improvements by me.  The main plan was to
       (a) Reduce the overhead for breakpoints, so we could enable 
           the feature by default without incurrent a significant penalty
       (b) Scatter more breakpoint sites throughout the code
      Currently we can set a breakpoint on almost any subexpression, and the
      overhead is around 1.5x slower than normal GHCi.  I hope to be able to
      get this down further and/or allow breakpoints to be turned off.
      This patch also fixes up :print following the recent changes to
      constructor info tables.  (most of the :print tests now pass)
      We now support single-stepping, which just enables all breakpoints.
        :step <expr>     executes <expr> with single-stepping turned on
        :step            single-steps from the current breakpoint
      The mechanism is quite different to the previous implementation.  We
      share code with the HPC (haskell program coverage) implementation now.
      The coverage pass annotates source code with "tick" locations which
      are tracked by the coverage tool.  In GHCi, each "tick" becomes a
      potential breakpoint location.
      Previously breakpoints were compiled into code that magically invoked
      a nested instance of GHCi.  Now, a breakpoint causes the current
      thread to block and control is returned to GHCi.
      See the wiki page for more details and the current ToDo list:
    • Simon Marlow's avatar