1. 25 Sep, 2003 2 commits
  2. 24 Sep, 2003 4 commits
    • simonmar's avatar
      [project @ 2003-09-24 13:20:03 by simonmar] · f0631554
      simonmar authored
      remove docs for -fwith option
      f0631554
    • simonmar's avatar
      [project @ 2003-09-24 13:04:45 by simonmar] · 38ef36af
      simonmar authored
      The concensus seems to be that 'with' should go away now, after its
      customary period of deprecation.  Hugs has already removed it, so
      we're following suit.
      38ef36af
    • simonmar's avatar
      [project @ 2003-09-24 11:06:51 by simonmar] · 8f57c3c1
      simonmar authored
      Move forkOS_createThread into the RTS so its implementation can be
      dependent on RTS_SUPPORTS_THREADS, which means we can provide a stub
      implementation in the !RTS_SUPPORTS_THREADS case, and hence not depend
      on pthread_create, which requires -lpthread.  The upshot is that GHCi
      now works again when !RTS_SUPPORTS_THREADS.
      8f57c3c1
    • simonmar's avatar
      [project @ 2003-09-24 10:32:11 by simonmar] · 8fb92f95
      simonmar authored
      If we change the terminal settings as a result of hSetBuffering or
      hSetEcho, then restore them again in hs_exit().  This is just good
      citizenship on Unixy platforms.
      
      We *don't* just automatically save the terminal settings and restore
      them at the end, because that would prevent implementing stty-like
      programs in Haskell.  This scheme is a compromise that hopefully DTRT
      in most cases.
      8fb92f95
  3. 23 Sep, 2003 16 commits
    • sof's avatar
      [project @ 2003-09-23 17:07:39 by sof] · cf684542
      sof authored
      wibble
      cf684542
    • sof's avatar
      [project @ 2003-09-23 16:52:44 by sof] · b23e6e00
      sof authored
      If the user explicitly did an instances-only import, i.e.,
      "import Foo ()", don't emit an unused-import warning.
      b23e6e00
    • wolfgang's avatar
      [project @ 2003-09-23 16:43:00 by wolfgang] · 9c9c4ea9
      wolfgang authored
      Mac OS X uses .dylib instead of .so, recognize that properly.
      9c9c4ea9
    • simonmar's avatar
      [project @ 2003-09-23 16:02:34 by simonmar] · 2e160a48
      simonmar authored
      Change some statics to dynamics, and remove a couple of obsolete options.
      2e160a48
    • simonmar's avatar
      [project @ 2003-09-23 16:01:22 by simonmar] · a11a320d
      simonmar authored
      Some wibbles to the optimisation section.
      a11a320d
    • simonmar's avatar
      [project @ 2003-09-23 15:38:35 by simonmar] · 76ebf3dc
      simonmar authored
      Add a BF_PINNED block flag, and attach it to blocks containing pinned
      objects (in addition to the usual BF_LARGE).
      
      In heapCensus, we now ignore blocks containing pinned objects, because
      they might contain gaps, and in any case it isn't clear that we want
      to include the whole block in a heap census, because much of it might
      well be dead.  Ignoring it isn't right either, though, so this patch
      just fixes the crash and leaves a ToDo.
      76ebf3dc
    • simonmar's avatar
      [project @ 2003-09-23 15:31:02 by simonmar] · 69373e1e
      simonmar authored
      Fix for clearing the evacuated flag on a block: don't throw away other
      flag settings in the process.
      69373e1e
    • simonpj's avatar
      [project @ 2003-09-23 15:29:02 by simonpj] · 6d493299
      simonpj authored
      --------------------------
               Much grunting about let-floating
      	   --------------------------
      
      We want to avoid putting bindings between the '=' of a defn and a '\':
      	let { f = let ... in \y-> ... } in ...
      
      Reason: float-in often follows float-out, and it may then add yte
      more bindings there, some of which may be strict.  But f may by
      not be marked as not-demanded (for other reasons: see the call to
      zapDemandInfo in Simplify.completeLazyBind); and now the strict binding
      may not be able to float out again.  (Well, it triggers the ASSERT in
      simplLazyBind.)
      
      So this commit adds FloatOut.floatNonRecRhs (to complement floatRhs) which
      is a big more vigorous about floating out.
      
      But that in turn showed up a pile of gore to do with unlifted bindings.
      We can't have them showing up at top level.  After thrashing in the swamp
      for a while, I eventually arranged that
      	let x# = e in b
      (where x# has an unlifted type) is treated exactly like
      	case e of x# -> b
      That is, it is never floated.  Yes, we lose opportunities to float some
      (very cheap!  unlifted let-bindings are always cheap) out of a lambda,
      but we're missing much bigger opportunities already.  For example:
      	\x -> f (h y)
      
      where h :: Int -> Int# is expensive. We'd like to float the (h y) outside
      the \x, but we don't because it's unboxed.  Possible solution: box it.
      Anyway, that's for the future.
      6d493299
    • simonpj's avatar
      [project @ 2003-09-23 15:15:02 by simonpj] · 6c4a98d3
      simonpj authored
      --------------------------
           Move demand-zapping code to where it belongs
      	   --------------------------
      
      A rather subtle point in the simplifier concerns the zapping of demand-info
      when the RHS of a binding is a value.  This used to be tucked away inside
      IdInfo where it was hard to find.  This commit moves the code to Simplify,
      so it occurs where you'd look for it.  Along with copious comments.
      
      See the zapDemandInfo in Simplify.completeLazyBind
      6c4a98d3
    • simonpj's avatar
      [project @ 2003-09-23 15:10:43 by simonpj] · 1aeeeaf8
      simonpj authored
      Add more informative assertion
      1aeeeaf8
    • simonpj's avatar
      [project @ 2003-09-23 15:10:23 by simonpj] · 27a85895
      simonpj authored
      Comment only
      27a85895
    • simonpj's avatar
      [project @ 2003-09-23 15:09:56 by simonpj] · 726bcf72
      simonpj authored
      Remove redundant where
      726bcf72
    • simonpj's avatar
      [project @ 2003-09-23 15:09:09 by simonpj] · add773aa
      simonpj authored
      --------------------------
           Make MachString literals a bit bigger
      	   --------------------------
      
      Up to now, unboxed string literals of up to 3 characters had
      size 1, which means they are inlined in place of a variable.
      That seems over-eager (duplication), so I've upped their size a bit.
      add773aa
    • simonmar's avatar
      [project @ 2003-09-23 15:05:18 by simonmar] · 7d83458f
      simonmar authored
      Fixes for the DEBUG case.
      7d83458f
    • 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 '!!'.
      abbc5a0b
    • 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.
      7256d590
  4. 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:
      ghc/rts/Schedule.c
      
      - Library support for bound threads:
          Control.Concurrent.
            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)
      85aa72b9
    • 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.
      6f0dcafb
    • igloo's avatar
      [project @ 2003-09-21 13:22:01 by igloo] · 6a9485d7
      igloo authored
      Alpha fixes.
      6a9485d7
    • 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.
      963cece5
    • igloo's avatar
      [project @ 2003-09-21 13:07:07 by igloo] · a608f147
      igloo authored
      Add cases for:
      
      arm-unknown-linux
      hppa-unknown-linux
      m68k-unknown-linux
      mips-unknown-linux
      s390-ibm-linux
      a608f147
  5. 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.
      dbaa3bb3
    • 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
      71d25e0a
  6. 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).
      79ff5ead
    • 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.
      14b10077
    • 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.
      feaf3891
    • simonmar's avatar
      [project @ 2003-09-19 09:04:09 by simonmar] · 04793e4a
      simonmar authored
      Add irix_TARGET_OS support.
      04793e4a
  7. 17 Sep, 2003 3 commits
  8. 16 Sep, 2003 4 commits