1. 13 Jan, 2000 2 commits
    • hwloidl's avatar
      [project @ 2000-01-13 14:33:57 by hwloidl] · 1b28d4e1
      hwloidl authored
      Merged GUM-4-04 branch into the main trunk. In particular merged GUM and
      SMP code. Most of the GranSim code in GUM-4-04 still has to be carried over.
      1b28d4e1
    • simonmar's avatar
      [project @ 2000-01-13 12:40:15 by simonmar] · be587a37
      simonmar authored
      - remove AllBlocked scheduler return code.  Nobody owned up to having
        created it or even knowing what it was there for.
      
      - clean up fatal error condition handling somewhat.  The process
        exit code from a GHC program now indicates the kind of failure
        for certain kinds of exit:
      
      	general internal RTS error	254
      	program deadlocked		253
      	program interrupted (ctrl-C)	252
      	heap overflow			251
      	main thread killed		250
      
        and we leave exit codes 1-199 for the user (as is traditional at MS,
        200-249 are reserved for future expansion, and may contain
        undocumented extensions :-)
      be587a37
  2. 12 Jan, 2000 1 commit
  3. 07 Jan, 2000 1 commit
  4. 06 Jan, 2000 1 commit
  5. 20 Dec, 1999 1 commit
    • simonpj's avatar
      [project @ 1999-12-20 10:34:27 by simonpj] · e921b2e3
      simonpj authored
      This commit implements a substantial re-organisation of the Prelude
      It also fixes a couple of small renamer bugs that were reported recently
      	(notably, Sven pointed out that we weren't reporting
      	unused imports properly)
      
      My original goal was to get rid of all "orphan" modules (i.e. ones
      with instance decls that don't belong either to a tycon or a class
      defined in the same module).  This should reduce the number of
      interface files that have to be read when compiling small Haskell
      modules.
      
      But like most expeditions into the Prelude Swamp, it spiraled out
      of control.  The result is quite satisfactory, though.
      
      	GONE AWAY:	PrelCCall, PrelNumExtra
      
      	NEW:		PrelReal, PrelFloat, PrelByteArr, PrelNum.hi-boot
      
      (The extra PrelNum.hi-boot is because of a tiresome thin-air Id, addr2Integer,
      which used to be in PrelBase.)
      
      Quite a lot of types have moved from one module to another,
      which entails some changes to part of the compiler (PrelInfo, PrelMods) etc,
      and there are a few places in the RTS includes and even in the driver
      that know about these home modules (alas).
      
      So the rough structure is as follows, in (linearised) dependency order
      	[this list now appears in PrelBase.lhs]
      
      PrelGHC		Has no implementation.  It defines built-in things, and
      		by importing it you bring them into scope.
      		The source file is PrelGHC.hi-boot, which is just
      		copied to make PrelGHC.hi
      
      		Classes: CCallable, CReturnable
      
      PrelBase	Classes: Eq, Ord, Functor, Monad
      		Types:   list, (), Int, Bool, Ordering, Char, String
      
      PrelTup		Types: tuples, plus instances for PrelBase classes
      
      PrelShow	Class: Show, plus instances for PrelBase/PrelTup types
      
      PrelEnum	Class: Enum,  plus instances for PrelBase/PrelTup types
      
      PrelMaybe	Type: Maybe, plus instances for PrelBase classes
      
      PrelNum		Class: Num, plus instances for Int
      		Type:  Integer, plus instances for all classes so far (Eq, Ord, Num, Show)
      
      		Integer is needed here because it is mentioned in the signature
      		of 'fromInteger' in class Num
      
      PrelReal	Classes: Real, Integral, Fractional, RealFrac
      			 plus instances for Int, Integer
      		Types:  Ratio, Rational
      			plus intances for classes so far
      
      		Rational is needed here because it is mentioned in the signature
      		of 'toRational' in class Real
      
      Ix		Classes: Ix, plus instances for Int, Bool, Char, Integer, Ordering, tuples
      
      PrelArr		Types: Array, MutableArray, MutableVar
      
      		Does *not* contain any ByteArray stuff (see PrelByteArr)
      		Arrays are used by a function in PrelFloat
      
      PrelFloat	Classes: Floating, RealFloat
      		Types:   Float, Double, plus instances of all classes so far
      
      		This module contains everything to do with floating point.
      		It is a big module (900 lines)
      		With a bit of luck, many modules can be compiled without ever reading PrelFloat.hi
      
      PrelByteArr	Types: ByteArray, MutableByteArray
      
      		We want this one to be after PrelFloat, because it defines arrays
      		of unboxed floats.
      
      
      Other Prelude modules are much easier with fewer complex dependencies.
      e921b2e3
  6. 08 Dec, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-12-08 14:21:52 by simonmar] · 9c370d69
      simonmar authored
      Add Marc Van Dongen's Integer improvements.  Specifically:
      
      	- new primops: gcdInt#, gcdIntegerInt#, divExact#,
      	  quotInteger#, remInteger#.
      
      	- new definitions of quot and rem for Integer in
      	  PrelNum (using the new quotInteger# and remInteger#
      	  primops instead of quotRemInteger#).  Should be
      	  slightly faster than before.  div & mod aren't
      	  likewise optimised (yet).
      
      	- specialisations of gcd for Int and Integer, and
      	  lcm for Integer in PrelNum.
      9c370d69
  7. 07 Dec, 1999 1 commit
  8. 01 Dec, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-12-01 14:34:38 by simonmar] · e1dc924b
      simonmar authored
      Support for blocking & unblocking asynchronous exceptions.
      
        - new primops:
      
      	blockAsyncExceptions#, unblockAsyncExceptions# :: IO a -> IO a
      
        - raiseInThread will block if the target thread is currently
          blocking async exceptions.
      
        - async exceptions are currently implicitly blocked inside
          an exception handler.  This decision might be reversed when
          we have more experience with this stuff.
      
        - Move exception-related stuff in the RTS into its own file,
          Exception.{h,hc}.
      e1dc924b
  9. 30 Nov, 1999 1 commit
  10. 29 Nov, 1999 1 commit
    • sewardj's avatar
      [project @ 1999-11-29 18:59:23 by sewardj] · b3c8ae4e
      sewardj authored
      Make StgHugs use the same naming scheme as GHC does for class +
      instance machinery.
      
      Add machinery to do Z-encoding/decoding of names extracted from
      interface files.
      
      Make the ELF object loader work again.  It seemed to have suffered
      slight bitrot over the past couple of months.  Fix various minor bugs.
      
      Track a small change in interface file syntax.
      
      Make Printer.c print tagged-unboxed stack sections in a decent way
      now that Alastair-style stack tags have been abandoned.
      b3c8ae4e
  11. 22 Nov, 1999 1 commit
  12. 18 Nov, 1999 1 commit
  13. 16 Nov, 1999 1 commit
  14. 12 Nov, 1999 2 commits
  15. 11 Nov, 1999 1 commit
  16. 09 Nov, 1999 3 commits
    • simonmar's avatar
      [project @ 1999-11-09 15:57:39 by simonmar] · e77996aa
      simonmar authored
      Fix up some problems with the IN_STG_CODE macro.
      e77996aa
    • simonmar's avatar
      [project @ 1999-11-09 15:46:49 by simonmar] · 30681e79
      simonmar authored
      A slew of SMP-related changes.
      
       - New locking scheme for thunks: we now check whether the thunk
         being entered is in our private allocation area, and if so
         we don't lock it.  Well, that's the upshot.  In practice it's
         a lot more fiddly than that.
      
       - I/O blocking is handled a bit more sanely now (but still not
         properly, methinks)
      
       - deadlock detection is back
      
       - remove old pre-SMP scheduler code
      
       - revamp the timing code.  We actually get reasonable-looking
         timing info for SMP programs now.
      
       - fix a bug in the garbage collector to do with IND_OLDGENs appearing
         on the mutable list of the old generation.
      
       - move BDescr() function from rts/BlockAlloc.h to includes/Block.h.
      
       - move struct generation and struct step into includes/StgStorage.h (sigh)
      
       - add UPD_IND_NOLOCK for updating with an indirection where locking
         the black hole is not required.
      30681e79
    • sewardj's avatar
      [project @ 1999-11-09 10:05:07 by sewardj] · b38a2d75
      sewardj authored
      mulIntCzh (i386_TARGET_ARCH): xor --> xorl
      b38a2d75
  17. 05 Nov, 1999 1 commit
  18. 02 Nov, 1999 2 commits
    • simonmar's avatar
      [project @ 1999-11-02 17:04:28 by simonmar] · 85b05cb2
      simonmar authored
      make the prototypes of suspendThread and resumeThread available to the RTS.
      85b05cb2
    • simonmar's avatar
      [project @ 1999-11-02 15:05:38 by simonmar] · f6692611
      simonmar authored
      This commit adds in the current state of our SMP support.  Notably,
      this allows the new way 's' to be built, providing support for running
      multiple Haskell threads simultaneously on top of any pthreads
      implementation, the idea being to take advantage of commodity SMP
      boxes.
      
      Don't expect to get much of a speedup yet; due to the excessive
      locking required to synchronise access to mutable heap objects, you'll
      see a slowdown in most cases, even on a UP machine.  The best I've
      seen is a 1.6-1.7 speedup on an example that did no locking (two
      optimised nfibs in parallel).
      
      	- new RTS -N flag specifies how many pthreads to start.
      
      	- new driver -smp flag, tells the driver to use way 's'.
      
      	- new compiler -fsmp option (not for user comsumption)
      	  tells the compiler not to generate direct jumps to
      	  thunk entry code.
      
      	- largely rewritten scheduler
      
      	- _ccall_GC is now done by handing back a "token" to the
      	  RTS before executing the ccall; it should now be possible
      	  to execute blocking ccalls in the current thread while
      	  allowing the RTS to continue running Haskell threads as
      	  normal.
      
      	- you can only call thread-safe C libraries from a way 's'
      	  build, of course.
      
      Pthread support is still incomplete, and weird things (including
      deadlocks) are likely to happen.
      f6692611
  19. 01 Nov, 1999 1 commit
  20. 27 Oct, 1999 2 commits
  21. 26 Oct, 1999 1 commit
    • sewardj's avatar
      [project @ 1999-10-26 17:27:25 by sewardj] · 6642714e
      sewardj authored
      Add foreign import/export implementations for x86 stdcall convention.
      
      Make parser notice calling conventions on f-i and f-x declarations,
      check they are supported on the platform Hugs is compiled on.  Pass
      them all the way through the code generator to the interpreter.
      
      Allow f-i/f-x decls to omit the calling convention, in which case
      ccall is used.  Remove calling convention from all such decls
      in the Prelude so it will work on any platform.
      6642714e
  22. 20 Oct, 1999 2 commits
  23. 19 Oct, 1999 1 commit
  24. 15 Oct, 1999 1 commit
    • sewardj's avatar
      [project @ 1999-10-15 11:02:06 by sewardj] · dfb12323
      sewardj authored
      Added basic support for foreign export dynamic.
      
      Many aspects of it are still broken:
      * Only supports x86-linux.
      * The range of allowable types is small: Char Int Float Double
        Addr and Word.
      * Adjustor thunks are never freed.
      * Returning Doubles or Floats doesn't work at all.
      
      I expect to fix some of these shortly.  foreign import also
      needs redoing, so it can accept any number of arguments of
      any type.
      
      Also:
      * Fixed setRtsFlags in Evaluator.c to make it endian-independent.
      * Fixed raisePrim in Evaluator.c so things like division by zero,
        array index errors, etc, throw an exception instead of
        terminating StgHugs.  raisePrim is renamed makeErrorCall.
      dfb12323
  25. 14 Oct, 1999 1 commit
  26. 13 Oct, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-10-13 16:39:10 by simonmar] · 5c67176d
      simonmar authored
      Crude allocation-counting extension to ticky-ticky profiling.
      
      Allocations are counted against the closest lexically enclosing
      function closure, so you need to map the output back to the STG code.
      5c67176d
  27. 15 Sep, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-09-15 13:45:14 by simonmar] · 17315bf6
      simonmar authored
      Heap Profiling
      --------------
      
      This commit adds simple hp2ps-style heap profiling.  Just the '-h'
      option is supported so far.
      
      Heap profiles will show the top two cost centres on each cost centre
      stack.
      
      Time/Alloc profiles have been extended to aggregate the costs on a
      per-cost-centre basis and show the table of highest consuming cost
      centres before the full table of cost centre stacks.
      
      Profiles work best if '-caf-all' is used, especially when using
      one of the '-auto' flags.
      17315bf6
  28. 14 Sep, 1999 1 commit
    • simonmar's avatar
      [project @ 1999-09-14 12:16:36 by simonmar] · 8e346b86
      simonmar authored
      A couple of fixes and cleanups to ticky-ticky profiling:
      
      	- remove UPD_EXISTING (doesn't make sense)
      	- add UPD_CON_IN_PLACE, now that we have in-place updates
      	- clean up the output a little.
      8e346b86
  29. 25 Aug, 1999 2 commits
    • simonmar's avatar
      [project @ 1999-08-25 16:11:43 by simonmar] · c6ab4bfa
      simonmar authored
      Support for thread{WaitRead,WaitWrite,Delay}.  These should behave
      identically to the 3.02 implementations.
      
      We now have the virtual timer on during all program runs, which ticks
      at 50Hz by default.  This is used to implement threadDelay, so you
      won't get any better granularity than the tick frequency
      unfortunately.  It remains to be seen whether using the virtual timer
      will have a measurable impact on performance for non-threadDelaying
      programs.
      
      All operations in the I/O subsystem should now be non-blocking with
      respect to other running Haskell threads.  It remains to be seen
      whether this will have a measurable performance impact on
      non-concurrent programs (probably not).
      c6ab4bfa
    • simonmar's avatar
      [project @ 1999-08-25 10:23:51 by simonmar] · 68146c5b
      simonmar authored
      Eq and Ord instances for ThreadId.
      68146c5b
  30. 24 Aug, 1999 2 commits
  31. 03 Aug, 1999 1 commit