1. 23 Sep, 2003 2 commits
    • simonmar's avatar
      [project @ 2003-09-23 14:32:57 by simonmar] · abbc5a0b
      simonmar authored
      - Convert many of the optimisation options into dynamic options (that is,
        they can be mentioned in {-# OPTIONS #-} pragmas).
      - Add a new way to specify constructor-field unboxing on a selective
        basis.  To tell the compiler to unbox a constructor field, do this:
            data T = T !!Int
        and GHC will store that field unboxed if possible.  If it isn't possible
        (say, because the field has a sum type) then the annotation is ignored.
        The -funbox-strict-fields flag is now a dynamic flag, and has the same
        effect as replacing all the '!' annotations with '!!'.
    • simonmar's avatar
      [project @ 2003-09-23 14:25:48 by simonmar] · 7256d590
      simonmar authored
      Allow .so or .dll libraries to be named explicitly on the command line.
  2. 21 Sep, 2003 5 commits
    • wolfgang's avatar
      [project @ 2003-09-21 22:20:51 by wolfgang] · 85aa72b9
      wolfgang authored
      Bound Threads
      Introduce a way to use foreign libraries that rely on thread local state
      from multiple threads (mainly affects the threaded RTS).
      See the file threads.tex in CVS at haskell-report/ffi/threads.tex
      (not entirely finished yet) for a definition of this extension. A less formal
      description is also found in the documentation of Control.Concurrent.
      The changes mostly affect the THREADED_RTS (./configure --enable-threaded-rts),
      except for saving & restoring errno on a per-TSO basis, which is also necessary
      for the non-threaded RTS (a bugfix).
      Detailed list of changes
      - errno is saved in the TSO object and restored when necessary:
      ghc/includes/TSO.h, ghc/rts/Interpreter.c, ghc/rts/Schedule.c
      - rts_mainLazyIO is no longer needed, main is no special case anymore
      ghc/includes/RtsAPI.h, ghc/rts/RtsAPI.c, ghc/rts/Main.c, ghc/rts/Weak.c
      - passCapability: a new function that releases the capability and "passes"
        it to a specific OS thread:
      ghc/rts/Capability.h ghc/rts/Capability.c
      - waitThread(), scheduleWaitThread() and schedule() get an optional
        Capability *initialCapability passed as an argument:
      ghc/includes/SchedAPI.h, ghc/rts/Schedule.c, ghc/rts/RtsAPI.c
      - Bound Thread scheduling (that's what this is all about):
      ghc/rts/Schedule.h, ghc/rts/Schedule.c
      - new Primop isCurrentThreadBound#:
      ghc/compiler/prelude/primops.txt.pp, ghc/includes/PrimOps.h, ghc/rts/PrimOps.hc,
      ghc/rts/Schedule.h, ghc/rts/Schedule.c
      - a simple function, rtsSupportsBoundThreads, that returns true if THREADED_RTS
        is defined:
      ghc/rts/Schedule.h, ghc/rts/Schedule.c
      - a new implementation of forkProcess (the old implementation stays in place
        for the non-threaded case). Partially broken; works for the standard
        fork-and-exec case, but not for much else. A proper forkProcess is
        really next to impossible to implement:
      - Library support for bound threads:
            rtsSupportsBoundThreads, isCurrentThreadBound, forkOS,
            runInBoundThread, runInUnboundThread
      libraries/base/Control/Concurrent.hs, libraries/base/Makefile,
      libraries/base/include/HsBase.h, libraries/base/cbits/forkOS.c (new file)
    • igloo's avatar
      [project @ 2003-09-21 13:26:05 by igloo] · 6f0dcafb
      igloo authored
      Generalise the x86-64 hack to all 64-bit arches.
    • igloo's avatar
      [project @ 2003-09-21 13:22:01 by igloo] · 6a9485d7
      igloo authored
      Alpha fixes.
    • igloo's avatar
      [project @ 2003-09-21 13:09:12 by igloo] · 963cece5
      igloo authored
      Change IF_OS_darwin to IF_ARCH_powerpc so addImportNat is imported in
      exactly the case in which it is used.
    • igloo's avatar
      [project @ 2003-09-21 13:07:07 by igloo] · a608f147
      igloo authored
      Add cases for:
  3. 20 Sep, 2003 2 commits
    • ross's avatar
      [project @ 2003-09-20 17:26:46 by ross] · dbaa3bb3
      ross authored
      Re-arrange the interface to TcMatches to allow typechecking of case
      commands (part of arrow notation):
      * replace the export of the internal tcGRHSs with a more specific
        tcGRHSsPat for checking PatMonoBinds.
      * generalize match contexts in the same way as stmt contexts, to include
        a typechecker for the bodies of alts.
      This should probably be reviewed, but I hope it can make it into STABLE
      after a while.
    • ross's avatar
      [project @ 2003-09-20 17:24:47 by ross] · 71d25e0a
      ross authored
      fixes to desugaring of arrow notation:
      * fix free variable calculation for if's
      * various fixes for case
      please merge to STABLE
  4. 19 Sep, 2003 4 commits
    • wolfgang's avatar
      [project @ 2003-09-19 18:56:00 by wolfgang] · 79ff5ead
      wolfgang authored
      POSIX threads should be pthread_detach-ed after they are created.
      Otherwise they'll stick around waiting for a pthread_join.
      (This wasn't really a problem because our worker threads never exit anyway).
    • simonmar's avatar
      [project @ 2003-09-19 15:58:00 by simonmar] · 14b10077
      simonmar authored
      The whole family of index<blah>OffForeignPtr# primops has been broken
      for some time now.  This commit fixes them.
      I'm tempted to get rid of them altogether, since arguably the
      withForeignPtr interface subsumes all this.  But if you want to index
      off a ForeignPtr in pure code, you have to use unsafePerformIO, which
      is hard to optimise away (GHC doesn't do it), so these primops still
      have their uses.
    • simonmar's avatar
      [project @ 2003-09-19 09:12:22 by simonmar] · feaf3891
      simonmar authored
      Be a bit more honest about how easy it is to port the linker.
    • simonmar's avatar
      [project @ 2003-09-19 09:04:09 by simonmar] · 04793e4a
      simonmar authored
      Add irix_TARGET_OS support.
  5. 17 Sep, 2003 3 commits
  6. 16 Sep, 2003 4 commits
  7. 15 Sep, 2003 2 commits
    • sof's avatar
      [project @ 2003-09-15 20:39:38 by sof] · ce42f19f
      sof authored
      factor out code that handles depositing of work items on the
        thread pool's request queue.
      - when it looks as if a new worker thread needs to be created, give
        up our quantum first in the hope that this might at the last minute
        turn up more idle worker threads.
      - add comment re: trimming pool size.
      Merged to STABLE eventually; I may continue tinkering with this code
      some more over the next day or two.
    • simonmar's avatar
      [project @ 2003-09-15 14:20:45 by simonmar] · 02670da5
      simonmar authored
      Update comment for GhcUnregisterised.
  8. 14 Sep, 2003 3 commits
  9. 13 Sep, 2003 1 commit
  10. 12 Sep, 2003 5 commits
  11. 11 Sep, 2003 9 commits
    • simonpj's avatar
      [project @ 2003-09-11 16:46:15 by simonpj] · 424d45ae
      simonpj authored
      Make sure that exprIsTrivial responds "False" to
      	(scc "foo" x)
      We do not treat (_scc_ "foo" x) as trivial, because
        a) it really generates code, (and a heap object when it's
           a function arg) to capture the cost centre
        b) see the note [SCC-and-exprIsTrivial] in Simplify.simplLazyBind
    • wolfgang's avatar
      [project @ 2003-09-11 15:36:37 by wolfgang] · e4ef00a8
      wolfgang authored
      The FP_CHECK_CONSTS test for the errno constants requires stdio.h to be
      included, at least on Mac OS X.
    • wolfgang's avatar
      [project @ 2003-09-11 15:12:25 by wolfgang] · d8144db0
      wolfgang authored
      Mac OS X:
      Bypass the dlfcn compatibility layer in lookupSymbol, use Apple's
      NSModule functions directly instead. This protects us from differences
      between different implementations of the dlcompat library (regarding
      treatment of prefixed underscores).
      Note that the compatibility layer is still used in addDLL (it's needed by
      the POSIX library anyway).
      Also, add a little more sanity checking (checkProddableBlock) to the Mach-O
      linker itself.
    • simonmar's avatar
      [project @ 2003-09-11 14:34:24 by simonmar] · a7e3ac4e
      simonmar authored
      Document -fth and -fimplicit-params
    • simonpj's avatar
      [project @ 2003-09-11 14:20:40 by simonpj] · 25aeb246
      simonpj authored
      	    Allow recursive dictionaries
      In response to various bleatings, here's a lovely fix that involved simply
      inverting two lines of code, to allow recursive dictionaries.  Here's
      the comment.  (typecheck/should_run/tc030 tests it)
          data D r = ZeroD | SuccD (r (D r));
          instance (Eq (r (D r))) => Eq (D r) where
              ZeroD     == ZeroD     = True
              (SuccD a) == (SuccD b) = a == b
              _         == _         = False;
          equalDC :: D [] -> D [] -> Bool;
          equalDC = (==);
      We need to prove (Eq (D [])).  Here's how we go:
      	d1 : Eq (D [])
      by instance decl, holds if
      	d2 : Eq [D []]
      	where 	d1 = dfEqD d2
      by instance decl of Eq, holds if
      	d3 : D []
      	where	d2 = dfEqList d2
      		d1 = dfEqD d2
      But now we can "tie the knot" to give
      	d3 = d1
      	d2 = dfEqList d2
      	d1 = dfEqD d2
      and it'll even run!  The trick is to put the thing we are trying to prove
      (in this case Eq (D []) into the database before trying to prove its
      contributing clauses.
    • simonpj's avatar
      [project @ 2003-09-11 14:18:38 by simonpj] · b434cbc6
      simonpj authored
      Add comments, change a WARN to an ASSERT
    • simonpj's avatar
      [project @ 2003-09-11 13:41:38 by simonpj] · 380ec6be
      simonpj authored
      Undo bogus claim that
      	_scc_ "foo" x  ==  x
      This just isn't right in general, for example when x is a
      top-level function.
    • simonmar's avatar
      [project @ 2003-09-11 10:36:56 by simonmar] · 52d7dd31
      simonmar authored
      HEAD is now 6.3
    • simonmar's avatar
      [project @ 2003-09-11 10:35:28 by simonmar] · 29558566
      simonmar authored
      When setting TARGETPLATFORM, we should also set foo_TARGET_ARCH,
      bar_TARGET_OS, etc.