1. 26 May, 2011 1 commit
  2. 25 May, 2011 2 commits
  3. 22 May, 2011 1 commit
  4. 19 May, 2011 2 commits
  5. 18 May, 2011 1 commit
  6. 15 May, 2011 1 commit
  7. 14 May, 2011 1 commit
  8. 30 Apr, 2011 1 commit
  9. 12 Apr, 2011 2 commits
    • Simon Marlow's avatar
      Change the way module initialisation is done (#3252, #4417) · a52ff761
      Simon Marlow authored
      Previously the code generator generated small code fragments labelled
      with __stginit_M for each module M, and these performed whatever
      initialisation was necessary for that module and recursively invoked
      the initialisation functions for imported modules.  This appraoch had
      drawbacks:
      
       - FFI users had to call hs_add_root() to ensure the correct
         initialisation routines were called.  This is a non-standard,
         and ugly, API.
      
       - unless we were using -split-objs, the __stginit dependencies would
         entail linking the whole transitive closure of modules imported,
         whether they were actually used or not.  In an extreme case (#4387,
         #4417), a module from GHC might be imported for use in Template
         Haskell or an annotation, and that would force the whole of GHC to
         be needlessly linked into the final executable.
      
      So now instead we do our initialisation with C functions marked with
      __attribute__((constructor)), which are automatically invoked at
      program startup time (or DSO load-time).  The C initialisers are
      emitted into the stub.c file.  This means that every time we compile
      with -prof or -hpc, we now get a stub file, but thanks to #3687 that
      is now invisible to the user.
      
      There are some refactorings in the RTS (particularly for HPC) to
      handle the fact that initialisers now get run earlier than they did
      before.
      
      The __stginit symbols are still generated, and the hs_add_root()
      function still exists (but does nothing), for backwards compatibility.
      a52ff761
    • Simon Marlow's avatar
      Cleanup sweep and fix a bug in RTS flag processing. · 5463b55b
      Simon Marlow authored
      This code has accumulated a great deal of cruft over the years, this
      pass cleans up a lot of the surrounding cruft but leaves the actual
      argument processing alone - so there's still more that could be done.
      
      Bug fixed:
      
        - ghc_rts_opts should not be subject to the --rtsopts setting.  If
          the programmer explicitly declares options with ghc_rts_opts, they
          shouldn't also have to accept command-line RTS options to make them
          work.
      5463b55b
  10. 11 Apr, 2011 1 commit
  11. 30 Mar, 2011 1 commit
  12. 16 Mar, 2011 1 commit
  13. 01 Mar, 2011 1 commit
  14. 12 Jan, 2011 1 commit
  15. 10 Feb, 2011 1 commit
  16. 02 Feb, 2011 5 commits
    • Simon Marlow's avatar
      GC refactoring and cleanup · 18896fa2
      Simon Marlow authored
      Now we keep any partially-full blocks in the gc_thread[] structs after
      each GC, rather than moving them to the generation.  This should give
      us slightly better locality (though I wasn't able to measure any
      difference).
      
      Also in this patch: better sanity checking with THREADED.
      18896fa2
    • Simon Marlow's avatar
      A small GC optimisation · bef3da1e
      Simon Marlow authored
      Store the *number* of the destination generation in the Bdescr struct,
      so that in evacuate() we don't have to deref gen to get it.
      This is another improvement ported over from my GC branch.
      bef3da1e
    • Simon Marlow's avatar
      add a const · d0bfe30b
      Simon Marlow authored
      d0bfe30b
    • Simon Marlow's avatar
      add TRY_ACQUIRE_LOCK() · d52d50e4
      Simon Marlow authored
      d52d50e4
    • Simon Marlow's avatar
      Remove the per-generation mutable lists · 32907722
      Simon Marlow authored
      Now that we use the per-capability mutable lists exclusively.
      32907722
  17. 01 Feb, 2011 1 commit
  18. 27 Jan, 2011 1 commit
  19. 23 Jan, 2011 1 commit
    • Ian Lynagh's avatar
      Tweak some deps to avoid multiple $(wildcard ...)s · 032dd778
      Ian Lynagh authored
      Note that some things depending on the rts/includes header files now
      depend on more files: They used to include depend on includes/*.h, but
      now they also depend on header files in subdirectories. As far as I can
      see this was a bug.
      032dd778
  20. 11 Jan, 2011 1 commit
  21. 09 Jan, 2011 1 commit
    • Ian Lynagh's avatar
      Rejig the includes/ installation rules · e8a42ae2
      Ian Lynagh authored
      They're a little nicer now, and a regression in the cygwin build is
      fixed (the $i in the destination wasn't surviving being passed through
      cygpath).
      e8a42ae2
  22. 06 Jan, 2011 1 commit
    • Ian Lynagh's avatar
      On Cygwin, use a Cygwin-style path for /bin/install's destination · 57e2a81c
      Ian Lynagh authored
      cygwin's /bin/install doesn't set file modes correctly if the
      destination path is a C: style path:
      
      $ /bin/install -c -m 644 foo /cygdrive/c/cygwin/home/ian/foo2
      $ /bin/install -c -m 644 foo c:/cygwin/home/ian/foo3
      $ ls -l foo*
      -rw-r--r-- 1 ian None 0 2011-01-06 18:28 foo
      -rw-r--r-- 1 ian None 0 2011-01-06 18:29 foo2
      -rwxrwxrwx 1 ian None 0 2011-01-06 18:29 foo3
      
      This causes problems for bindisttest/checkBinaries.sh which then
      thinks that e.g. the userguide HTML files are binaries.
      
      We therefore use a /cygdrive path if we are on cygwin
      57e2a81c
  23. 21 Dec, 2010 1 commit
    • Simon Marlow's avatar
      Count allocations more accurately · db0c13a4
      Simon Marlow authored
      The allocation stats (+RTS -s etc.) used to count the slop at the end
      of each nursery block (except the last) as allocated space, now we
      count the allocated words accurately.  This should make allocation
      figures more predictable, too.
      
      This has the side effect of reducing the apparent allocations by a
      small amount (~1%), so remember to take this into account when looking
      at nofib results.
      db0c13a4
  24. 16 Dec, 2010 1 commit
  25. 15 Dec, 2010 1 commit
    • Simon Marlow's avatar
      Implement stack chunks and separate TSO/STACK objects · f30d5273
      Simon Marlow authored
      This patch makes two changes to the way stacks are managed:
      
      1. The stack is now stored in a separate object from the TSO.
      
      This means that it is easier to replace the stack object for a thread
      when the stack overflows or underflows; we don't have to leave behind
      the old TSO as an indirection any more.  Consequently, we can remove
      ThreadRelocated and deRefTSO(), which were a pain.
      
      This is obviously the right thing, but the last time I tried to do it
      it made performance worse.  This time I seem to have cracked it.
      
      2. Stacks are now represented as a chain of chunks, rather than
         a single monolithic object.
      
      The big advantage here is that individual chunks are marked clean or
      dirty according to whether they contain pointers to the young
      generation, and the GC can avoid traversing clean stack chunks during
      a young-generation collection.  This means that programs with deep
      stacks will see a big saving in GC overhead when using the default GC
      settings.
      
      A secondary advantage is that there is much less copying involved as
      the stack grows.  Programs that quickly grow a deep stack will see big
      improvements.
      
      In some ways the implementation is simpler, as nothing special needs
      to be done to reclaim stack as the stack shrinks (the GC just recovers
      the dead stack chunks).  On the other hand, we have to manage stack
      underflow between chunks, so there's a new stack frame
      (UNDERFLOW_FRAME), and we now have separate TSO and STACK objects.
      The total amount of code is probably about the same as before.
      
      There are new RTS flags:
      
         -ki<size> Sets the initial thread stack size (default 1k)  Egs: -ki4k -ki2m
         -kc<size> Sets the stack chunk size (default 32k)
         -kb<size> Sets the stack chunk buffer size (default 1k)
      
      -ki was previously called just -k, and the old name is still accepted
      for backwards compatibility.  These new options are documented.
      f30d5273
  26. 10 Dec, 2010 1 commit
  27. 09 Dec, 2010 1 commit
  28. 08 Dec, 2010 1 commit
  29. 06 Dec, 2010 1 commit
  30. 25 Nov, 2010 1 commit
  31. 23 Nov, 2010 2 commits
  32. 19 Sep, 2010 1 commit
    • Edward Z. Yang's avatar
      Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4 · 83d563cb
      Edward Z. Yang authored
      This is patch that adds support for interruptible FFI calls in the form
      of a new foreign import keyword 'interruptible', which can be used
      instead of 'safe' or 'unsafe'.  Interruptible FFI calls act like safe
      FFI calls, except that the worker thread they run on may be interrupted.
      
      Internally, it replaces BlockedOnCCall_NoUnblockEx with
      BlockedOnCCall_Interruptible, and changes the behavior of the RTS
      to not modify the TSO_ flags on the event of an FFI call from
      a thread that was interruptible.  It also modifies the bytecode
      format for foreign call, adding an extra Word16 to indicate
      interruptibility.
      
      The semantics of interruption vary from platform to platform, but the
      intent is that any blocking system calls are aborted with an error code.
      This is most useful for making function calls to system library
      functions that support interrupting.  There is no support for pre-Vista
      Windows.
      
      There is a partner testsuite patch which adds several tests for this
      functionality.
      83d563cb