ghc-hetmet.git
22 years ago[project @ 2002-02-21 14:42:17 by sewardj] Approximately_9120_patches
sewardj [Thu, 21 Feb 2002 14:42:17 +0000 (14:42 +0000)]
[project @ 2002-02-21 14:42:17 by sewardj]
In DsForeign.fexportEntry, track recent changes to f-x-dynamic
implementation.  At the same time completely rewrite this fn, since I
couldn't figure out how the previous incarnation worked.

22 years ago[project @ 2002-02-19 11:04:37 by keithw]
keithw [Tue, 19 Feb 2002 11:04:37 +0000 (11:04 +0000)]
[project @ 2002-02-19 11:04:37 by keithw]
Some thoughts on `what happens when'.

22 years ago[project @ 2002-02-18 17:27:24 by sof]
sof [Mon, 18 Feb 2002 17:27:24 +0000 (17:27 +0000)]
[project @ 2002-02-18 17:27:24 by sof]
unused arg wibble

22 years ago[project @ 2002-02-18 17:26:48 by sof]
sof [Mon, 18 Feb 2002 17:26:48 +0000 (17:26 +0000)]
[project @ 2002-02-18 17:26:48 by sof]
If necessary, define THREADED_RTS and DEBUG when gen'ing rts.conf

22 years ago[project @ 2002-02-18 16:28:39 by sof]
sof [Mon, 18 Feb 2002 16:28:39 +0000 (16:28 +0000)]
[project @ 2002-02-18 16:28:39 by sof]
Filter out _stub.c gubbins from C_SRCS

22 years ago[project @ 2002-02-18 16:27:24 by sof]
sof [Mon, 18 Feb 2002 16:27:24 +0000 (16:27 +0000)]
[project @ 2002-02-18 16:27:24 by sof]
remove STUBOBJS as an (explicit) dependency to LIBRARY (+comment as to why)

22 years ago[project @ 2002-02-18 15:51:28 by sewardj]
sewardj [Mon, 18 Feb 2002 15:51:28 +0000 (15:51 +0000)]
[project @ 2002-02-18 15:51:28 by sewardj]
Fix import wibble

22 years ago[project @ 2002-02-18 13:26:12 by sof]
sof [Mon, 18 Feb 2002 13:26:13 +0000 (13:26 +0000)]
[project @ 2002-02-18 13:26:12 by sof]
Be clear about the lock assumptions of GarbageCollect(); it
is now required to hold sched_mutex.

The real reason for adding this requirement is so that when
prior to scheduling finalizers and doing thread resurrection,
GarbageCollect() may set the lock status of sched_mutex to
the state expected by scheduleFinalizers() and resurrectThreads()
(i.e., unlocked).

Note: this is only an issue with pthreads. In the Win32 threading
model, it's a NOP for a thread to grab a mutex it already holds.

22 years ago[project @ 2002-02-18 12:41:01 by sewardj]
sewardj [Mon, 18 Feb 2002 12:41:03 +0000 (12:41 +0000)]
[project @ 2002-02-18 12:41:01 by sewardj]
Make foreign export dynamic work in GHCi.  Main changes:

* Allow literal labels to propagate through the bytecode generator
  and eventually be linked by the runtime linker.

* Minor mods to driver plumbing so that GHCi produces the relevant
  *_stub.[ch] files, compiles them with gcc, and loads the resulting .o's

* Dereference the stable pointer in the generated C stub, rather
  than passing it to a Haskell-world helper.  This seems simpler and
  removes the need to have a H-world helper, which in turn means the
  stub .o doesn't refer to any H-world entities.  This is important
  because our linker can't deal with mutual recursion between
  BCOs and loaded objects.

Still ToDo:

* Make it thread/GC safe.  (Sigbjorn?)

* Get rid of the bits of code in DsForeign which generate the
  Haskell helper.  I had a go but it wasn't obvious how to do it,
  so have deferred.

22 years ago[project @ 2002-02-17 20:22:38 by panne]
panne [Sun, 17 Feb 2002 20:22:38 +0000 (20:22 +0000)]
[project @ 2002-02-17 20:22:38 by panne]
Yet another config syntax error...

22 years ago[project @ 2002-02-17 18:38:07 by panne]
panne [Sun, 17 Feb 2002 18:38:07 +0000 (18:38 +0000)]
[project @ 2002-02-17 18:38:07 by panne]
One #define to rule them all: Use INSTALLING, not INSTALLED for the
generation of the "real" package.conf

22 years ago[project @ 2002-02-17 17:41:44 by panne]
panne [Sun, 17 Feb 2002 17:41:44 +0000 (17:41 +0000)]
[project @ 2002-02-17 17:41:44 by panne]
Installing HS*_cbits.o and libHS*_cbits.a might not be such a bad idea
after all... :-}

22 years ago[project @ 2002-02-17 14:03:10 by panne]
panne [Sun, 17 Feb 2002 14:03:10 +0000 (14:03 +0000)]
[project @ 2002-02-17 14:03:10 by panne]
Automagically determine the flags for compiling/linking OpenGL
programs at configuration time, and stuff the relevant info into
OpenGL's package configuration file. This still mixes up compilation
time vs. installation time, but it's much better than hardcoded flags.

22 years ago[project @ 2002-02-17 13:56:35 by panne]
panne [Sun, 17 Feb 2002 13:56:35 +0000 (13:56 +0000)]
[project @ 2002-02-17 13:56:35 by panne]
Conforming to the OpenGL ABI, try a plain (non-Mesa) OpenGL first as
the default

22 years ago[project @ 2002-02-17 13:46:39 by panne]
panne [Sun, 17 Feb 2002 13:46:39 +0000 (13:46 +0000)]
[project @ 2002-02-17 13:46:39 by panne]
Guard against empty ALL_DIRS

22 years ago[project @ 2002-02-17 13:02:44 by panne]
panne [Sun, 17 Feb 2002 13:02:44 +0000 (13:02 +0000)]
[project @ 2002-02-17 13:02:44 by panne]
Fixed TeX quoting

22 years ago[project @ 2002-02-17 08:48:23 by panne]
panne [Sun, 17 Feb 2002 08:48:25 +0000 (08:48 +0000)]
[project @ 2002-02-17 08:48:23 by panne]
Ooops, forgot to commit yesterday's quoting fix for db2dvi to the
other db2FOO stuff...

22 years ago[project @ 2002-02-17 06:52:10 by chak]
chak [Sun, 17 Feb 2002 06:52:10 +0000 (06:52 +0000)]
[project @ 2002-02-17 06:52:10 by chak]
wibble

22 years ago[project @ 2002-02-16 19:39:51 by sof]
sof [Sat, 16 Feb 2002 19:39:51 +0000 (19:39 +0000)]
[project @ 2002-02-16 19:39:51 by sof]
Use Foreign.free instead of destructArray (which seem to have disappeared)

22 years ago[project @ 2002-02-16 18:15:14 by sof]
sof [Sat, 16 Feb 2002 18:15:14 +0000 (18:15 +0000)]
[project @ 2002-02-16 18:15:14 by sof]
getPackageLibraries: replace some rather fragile string prefix matching
code that broke when "HSstd" got renamed to "HSbase".

22 years ago[project @ 2002-02-16 17:07:07 by panne]
panne [Sat, 16 Feb 2002 17:07:07 +0000 (17:07 +0000)]
[project @ 2002-02-16 17:07:07 by panne]
Welcome to the amazing world of shell syntax! :-) The line

  CATALOG_OPTION=-c $DOCBOOK_CATALOG

sets the environment variable CATALOG_OPTION to "-c" and executes
$DOCBOOK_CATALOG, which is probably not what was intended. Double
quotes to the rescue!

22 years ago[project @ 2002-02-16 00:30:05 by sof]
sof [Sat, 16 Feb 2002 00:30:05 +0000 (00:30 +0000)]
[project @ 2002-02-16 00:30:05 by sof]
release sched_mutex lock while GCing

22 years ago[project @ 2002-02-15 22:14:27 by sof]
sof [Fri, 15 Feb 2002 22:15:09 +0000 (22:15 +0000)]
[project @ 2002-02-15 22:14:27 by sof]
Extra arg to suspendThread() and resumeThread(); controls whether an external call is concurrent or not

22 years ago[project @ 2002-02-15 22:13:32 by sof]
sof [Fri, 15 Feb 2002 22:13:33 +0000 (22:13 +0000)]
[project @ 2002-02-15 22:13:32 by sof]
New call attribute on foreign imports, threadsafe.

It indicates that a foreign import can(*) safely be called
concurrently with the continued evaluation of other Haskell
threads, i.e., when the foreign call is made by a Haskell
thread, it won't hinder the progress of other threads.

(*) - if the platform and RTS supports it, it _will be_
invoked concurrently.

22 years ago[project @ 2002-02-15 21:07:19 by sof]
sof [Fri, 15 Feb 2002 21:07:20 +0000 (21:07 +0000)]
[project @ 2002-02-15 21:07:19 by sof]
comments only

22 years ago[project @ 2002-02-15 21:06:29 by sof]
sof [Fri, 15 Feb 2002 21:06:29 +0000 (21:06 +0000)]
[project @ 2002-02-15 21:06:29 by sof]
fix bug which caused 'safe' to be identical to 'unsafe' in an FFI decl.

22 years ago[project @ 2002-02-15 20:58:14 by sof]
sof [Fri, 15 Feb 2002 20:58:14 +0000 (20:58 +0000)]
[project @ 2002-02-15 20:58:14 by sof]
suspendThread() comment

22 years ago[project @ 2002-02-15 17:49:23 by sof]
sof [Fri, 15 Feb 2002 17:49:23 +0000 (17:49 +0000)]
[project @ 2002-02-15 17:49:23 by sof]
unbreak prev. commit

22 years ago[project @ 2002-02-15 14:53:32 by simonmar]
simonmar [Fri, 15 Feb 2002 14:53:32 +0000 (14:53 +0000)]
[project @ 2002-02-15 14:53:32 by simonmar]
Ensure that async exceptions are blocked during the raising of an
async exception - we're about to block them anyway on entry to the
handler, but we don't want any further exceptions being raised in the
meantime.

22 years ago[project @ 2002-02-15 14:49:08 by simonmar]
simonmar [Fri, 15 Feb 2002 14:49:08 +0000 (14:49 +0000)]
[project @ 2002-02-15 14:49:08 by simonmar]
Fix bugs in async exception raising: instead of trying to build an
application of the exception handler to the exception directly, just
leave a THUNK(raise,exception) on top of the CATCH_FRAME ready to
trigger the next time this thread is run.

This avoids two problems: the PAP we were using before wasn't really a
PAP, which broke some assumptions elsewhere (c.f. PAP_ENTRY:
CATCH_FRAME failure), and there was also some duplication between
raiseAsync and raisezh_fast due to the fact that we were attempting to
do the raising directly.

22 years ago[project @ 2002-02-15 12:29:46 by sewardj]
sewardj [Fri, 15 Feb 2002 12:29:46 +0000 (12:29 +0000)]
[project @ 2002-02-15 12:29:46 by sewardj]
For f-x-dynamic, x86, ccall: rename "a_" to "original_return_addr" so
that the next luzer to look at this stuff doesn't have to spend hours
figuring out what the hell "a_" is for.

22 years ago[project @ 2002-02-15 09:46:15 by simonmar]
simonmar [Fri, 15 Feb 2002 09:46:15 +0000 (09:46 +0000)]
[project @ 2002-02-15 09:46:15 by simonmar]
Fix typo

22 years ago[project @ 2002-02-15 09:32:47 by simonpj]
simonpj [Fri, 15 Feb 2002 09:32:47 +0000 (09:32 +0000)]
[project @ 2002-02-15 09:32:47 by simonpj]
Comments only

22 years ago[project @ 2002-02-15 09:32:18 by simonpj]
simonpj [Fri, 15 Feb 2002 09:32:18 +0000 (09:32 +0000)]
[project @ 2002-02-15 09:32:18 by simonpj]
-------------------------------------------------
Fix an interesting case-alternatives filtering bug
-------------------------------------------------

This bug, shown up by Krasimir's ObjectIO suite, caused the
simplifier to encounter a case expression like
case x of { x:xs -> True; [] -> False }
in a context where x could not possibly be either a (:) or []!
Case expressions in the enclosing scope dealt with it...
So the alternative-filtering removed all the alternatives, leaving
a case expression with no branches, which GHC didn't like one little
bit.

The actual bug was elsewhere; it was because we should sometimes
filter out the DEFAULT alternative, and we weren't doing that.
To fix it, I pulled the alternative-filtering code out of Simplify
and put it in SimplUtils.prepareAlts.  It's nice now.

22 years ago[project @ 2002-02-15 08:11:42 by sof]
sof [Fri, 15 Feb 2002 08:11:42 +0000 (08:11 +0000)]
[project @ 2002-02-15 08:11:42 by sof]
drop -mwin32 filtering

22 years ago[project @ 2002-02-15 08:10:44 by sof]
sof [Fri, 15 Feb 2002 08:10:44 +0000 (08:10 +0000)]
[project @ 2002-02-15 08:10:44 by sof]
mingw: drop the use of -mwin32 in CC_OPTS; no longer needed

22 years ago[project @ 2002-02-15 07:50:36 by sof]
sof [Fri, 15 Feb 2002 07:50:37 +0000 (07:50 +0000)]
[project @ 2002-02-15 07:50:36 by sof]
Tighten up the Scheduler synchronisation story some more:

- moved thread_ready_cond + the counter rts_n_waiting_tasks
  to Capability.c, leaving only sched_mutex as a synchro
  variable in Scheduler (the less stuff that inhabit
  Schedule.c, the better, methinks.)
- upon entry to the Scheduler, a worker thread will now call
  Capability.yieldToReturningWorker() to check whether it
  needs to give up its capability.
- Worker threads that are either idle or lack a capability,
  will now call Capability.waitForWorkCapability() and block.

22 years ago[project @ 2002-02-15 07:40:10 by sof]
sof [Fri, 15 Feb 2002 07:40:10 +0000 (07:40 +0000)]
[project @ 2002-02-15 07:40:10 by sof]
Use scheduleExtThread() (see 20020214 commit msg for SchedAPI.h for details)

22 years ago[project @ 2002-02-15 07:38:45 by sof]
sof [Fri, 15 Feb 2002 07:38:45 +0000 (07:38 +0000)]
[project @ 2002-02-15 07:38:45 by sof]
wibble

22 years ago[project @ 2002-02-15 07:37:55 by sof]
sof [Fri, 15 Feb 2002 07:37:55 +0000 (07:37 +0000)]
[project @ 2002-02-15 07:37:55 by sof]
Distinguish between the scheduling of a new thread from within
the RTS (e.g., via forkIO, running finalizers etc) and scheduling
of a thread that's created via the RtsAPI -- the latter
now uses scheduleExtThread(), the rest scheduleThread().

Why the distinction? Because the former will in threaded builds create
a worker OS thread, while the latter won't. (There's an added
wrinkle -- main() will also use scheduleThread()).

22 years ago[project @ 2002-02-15 07:23:02 by sof]
sof [Fri, 15 Feb 2002 07:23:02 +0000 (07:23 +0000)]
[project @ 2002-02-15 07:23:02 by sof]
Add rts_mainEvalIO proto

22 years ago[project @ 2002-02-14 18:20:37 by sof]
sof [Thu, 14 Feb 2002 18:20:37 +0000 (18:20 +0000)]
[project @ 2002-02-14 18:20:37 by sof]
more comments

22 years ago[project @ 2002-02-14 17:21:50 by sof]
sof [Thu, 14 Feb 2002 17:21:50 +0000 (17:21 +0000)]
[project @ 2002-02-14 17:21:50 by sof]
widen the scope of is_heap_alloced() proto; for all mingw builds

22 years ago[project @ 2002-02-14 17:17:08 by sof]
sof [Thu, 14 Feb 2002 17:17:08 +0000 (17:17 +0000)]
[project @ 2002-02-14 17:17:08 by sof]
COMPILING_RTS wasn't being fed to the C compiler. It is arguably a
bug/feature deficiency of GHC not to do the Right Thing for invocations
such as these:

   ghc -c -DFOO foo.c

i.e., pass -DFOO to the C compiler -- currently, you have to be explicit
about this, -optc-DFOO

22 years ago[project @ 2002-02-14 16:58:13 by sof]
sof [Thu, 14 Feb 2002 16:58:13 +0000 (16:58 +0000)]
[project @ 2002-02-14 16:58:13 by sof]
as per simonpj request, add mingw protos to avoid -Wmissing-declarations warnings

22 years ago[project @ 2002-02-14 16:55:07 by sof]
sof [Thu, 14 Feb 2002 16:55:07 +0000 (16:55 +0000)]
[project @ 2002-02-14 16:55:07 by sof]
resetNonBlockingFd, setNonBlockingFd: mingw tidyup

22 years ago[project @ 2002-02-14 16:24:59 by sof]
sof [Thu, 14 Feb 2002 16:24:59 +0000 (16:24 +0000)]
[project @ 2002-02-14 16:24:59 by sof]
extsBitmap handling: avoid using Int instance for Bits (may not be there; cf. 4.08), use Int32 instead

22 years ago[project @ 2002-02-14 15:51:30 by simonmar]
simonmar [Thu, 14 Feb 2002 15:51:30 +0000 (15:51 +0000)]
[project @ 2002-02-14 15:51:30 by simonmar]
oops, got the sense of an ifdef round the wrong way.

22 years ago[project @ 2002-02-14 15:14:00 by simonmar]
simonmar [Thu, 14 Feb 2002 15:14:02 +0000 (15:14 +0000)]
[project @ 2002-02-14 15:14:00 by simonmar]
Fixes to 'make install' in fptools/libraries.  We have to maintain the
directory structure when installing the .hi files, rather than just
dumping them in a single directory as we do for packages in
fptools/hslibs.

22 years ago[project @ 2002-02-14 15:11:28 by simonmar]
simonmar [Thu, 14 Feb 2002 15:11:28 +0000 (15:11 +0000)]
[project @ 2002-02-14 15:11:28 by simonmar]
fix typo: PKG_CPP_OPTS ==> PACKAGE_CPP_OPTS (fixes linking libgmp)

22 years ago[project @ 2002-02-14 15:08:08 by simonpj]
simonpj [Thu, 14 Feb 2002 15:08:08 +0000 (15:08 +0000)]
[project @ 2002-02-14 15:08:08 by simonpj]
-------------------------------------------------
Undo an earlier hack in postInlineUnconditionally
-------------------------------------------------

In an earlier era I made postInlineUnconditionally rather less
aggressive; it didn't inline even trivial things unless they
occurred just once.  THis was a hack designed to avoid rules
unexpectedly not firing.  But now we have much more control
over rules, through the phase numbering stuff, so I can undo the
hack.

Well, so I believe.  Manuel, yell if your rules stop working!

22 years ago[project @ 2002-02-14 15:03:38 by simonpj]
simonpj [Thu, 14 Feb 2002 15:03:38 +0000 (15:03 +0000)]
[project @ 2002-02-14 15:03:38 by simonpj]
------------------------------------
Desugar existential matches correctly
------------------------------------

Consider
data T = forall a. Ord a => T a (a->Int)

f (T x f) True  = ...expr1...
f (T y g) False = ...expr2..

When we put in the tyvars etc we get

f (T a (d::Ord a) (x::a) (f::a->Int)) True =  ...expr1...
f (T b (e::Ord a) (y::a) (g::a->Int)) True =  ...expr2...

After desugaring etc we'll get a single case:

f = \t::T b::Bool ->
    case t of
       T a (d::Ord a) (x::a) (f::a->Int)) ->
    case b of
True  -> ...expr1...
False -> ...expr2...

*** We have to substitute [a/b, d/e] in expr2! **

Originally I tried to use
(\b -> let e = d in expr2) a
to do this substitution.  While this is "correct" in a way, it fails
Lint, because e::Ord b but d::Ord a.

So now I simply do the substitution properly using substExpr.

22 years ago[project @ 2002-02-14 14:56:04 by simonpj]
simonpj [Thu, 14 Feb 2002 14:56:04 +0000 (14:56 +0000)]
[project @ 2002-02-14 14:56:04 by simonpj]
---------------------------------------
Record updates are ok for types involving
existential data constructors, so long as the
existential ones aren't the ones updated.
---------------------------------------

This check was already in the type checker, but
the desugarer had an over-zealous assert.

22 years ago[project @ 2002-02-14 14:02:55 by simonpj]
simonpj [Thu, 14 Feb 2002 14:02:55 +0000 (14:02 +0000)]
[project @ 2002-02-14 14:02:55 by simonpj]
---------------------------------------
Stop CSE messing up workers annotations
---------------------------------------

See the comments with CSE.do_one

22 years ago[project @ 2002-02-14 14:01:40 by simonpj]
simonpj [Thu, 14 Feb 2002 14:01:40 +0000 (14:01 +0000)]
[project @ 2002-02-14 14:01:40 by simonpj]
Do tcSub the right way round for pattern type signatures

22 years ago[project @ 2002-02-14 14:01:09 by simonpj]
simonpj [Thu, 14 Feb 2002 14:01:10 +0000 (14:01 +0000)]
[project @ 2002-02-14 14:01:09 by simonpj]
Do tcMonoExpr instead of tcExpr, here and there

22 years ago[project @ 2002-02-14 13:59:22 by simonpj]
simonpj [Thu, 14 Feb 2002 13:59:24 +0000 (13:59 +0000)]
[project @ 2002-02-14 13:59:22 by simonpj]
Import wibbles

22 years ago[project @ 2002-02-14 11:56:03 by njn]
njn [Thu, 14 Feb 2002 11:56:05 +0000 (11:56 +0000)]
[project @ 2002-02-14 11:56:03 by njn]
This commit affects ticky-ticky profiling.  Entry counts for thunks,
constructors, functions (standard and direct) and indirections are split into
two counters, one for entries to static closures and one for entries to dynamic
closures.

This required changing ticky-ticky details in the RTS (introducing new counters
and corresponding TICK_* events), and also changing the code generator to
generate the new event names (eg. TICK_ENT_THK is replaced by
TICK_ENT_STATIC_THK and TICK_ENT_DYN_THK).

22 years ago[project @ 2002-02-14 09:00:41 by sof]
sof [Thu, 14 Feb 2002 09:00:41 +0000 (09:00 +0000)]
[project @ 2002-02-14 09:00:41 by sof]
make multi-threading story work under win32 also

22 years ago[project @ 2002-02-14 08:59:29 by sof]
sof [Thu, 14 Feb 2002 08:59:29 +0000 (08:59 +0000)]
[project @ 2002-02-14 08:59:29 by sof]
debugged

22 years ago[project @ 2002-02-14 08:23:25 by sof]
sof [Thu, 14 Feb 2002 08:23:26 +0000 (08:23 +0000)]
[project @ 2002-02-14 08:23:25 by sof]
Right, that's it! Nuke rawSystem nonsense, as it turns
out the SysTools replacement for it wasn't 4.08 compatible,
hence nightly build break.

Should you bootstrap with 4.08 under mingw, and subseq.
do a stage2 build, you'll run into command-line length
probs during the final big linker invocation. Nothing
to lose sleep over, there are plenty of newer versions
to base a stage1 build on.

22 years ago[project @ 2002-02-14 07:55:47 by sof]
sof [Thu, 14 Feb 2002 07:55:47 +0000 (07:55 +0000)]
[project @ 2002-02-14 07:55:47 by sof]
import SystemExts.rawSystem in mingw builds only

22 years ago[project @ 2002-02-14 07:52:05 by sof]
sof [Thu, 14 Feb 2002 07:52:05 +0000 (07:52 +0000)]
[project @ 2002-02-14 07:52:05 by sof]
Restructured / tidied a bit:

* Capability.grabReturnCapability() is now called by resumeThread().
  It takes care of waiting on the (Capability.c-local) condition
  variable, 'returning_worker_cond' (moved here from Schedule.c)

* If a worker notices upon entry to the Scheduler that there are
  worker threads waiting to deposit results of external calls,
  it gives up its capability by calling Capability.yieldCapability().

* Added Scheduler.waitForWork(), which takes care of blocking
  on 'thread_ready_cond' (+ 'rts_n_waiting_tasks' book-keeping).

Note: changes haven't been fully tested, due to HEAD instability.

22 years ago[project @ 2002-02-14 07:40:17 by sof]
sof [Thu, 14 Feb 2002 07:40:17 +0000 (07:40 +0000)]
[project @ 2002-02-14 07:40:17 by sof]
win32: make it compile

22 years ago[project @ 2002-02-14 07:39:16 by sof]
sof [Thu, 14 Feb 2002 07:39:16 +0000 (07:39 +0000)]
[project @ 2002-02-14 07:39:16 by sof]
wibble

22 years ago[project @ 2002-02-13 20:14:41 by sof]
sof [Wed, 13 Feb 2002 20:14:42 +0000 (20:14 +0000)]
[project @ 2002-02-13 20:14:41 by sof]
The days of main/rawSystem.c and (its use in) main/SysTools.lhs are
almost up..for now, don't bother copying it in if we're booting
with 5.02 or later (which we are under mingw, which is the only
plat. where this hack matters).

22 years ago[project @ 2002-02-13 19:43:46 by sof]
sof [Wed, 13 Feb 2002 19:43:47 +0000 (19:43 +0000)]
[project @ 2002-02-13 19:43:46 by sof]
Use SGML_CATALOG_FILES, if defined

22 years ago[project @ 2002-02-13 19:42:38 by sof]
sof [Wed, 13 Feb 2002 19:42:38 +0000 (19:42 +0000)]
[project @ 2002-02-13 19:42:38 by sof]
FPTOOLS_DOCBOOK_CATALOG: check whether the SGML_CATALOG_FILES env var is
defined. If it is, treat it as gospel.

22 years ago[project @ 2002-02-13 15:57:19 by simonmar]
simonmar [Wed, 13 Feb 2002 15:57:19 +0000 (15:57 +0000)]
[project @ 2002-02-13 15:57:19 by simonmar]
print comes from System.IO these days

22 years ago[project @ 2002-02-13 15:56:18 by simonmar]
simonmar [Wed, 13 Feb 2002 15:56:18 +0000 (15:56 +0000)]
[project @ 2002-02-13 15:56:18 by simonmar]
Refer to stdout as IO.stdout, not PrelHandle.stdout, and similarly for stderr.

22 years ago[project @ 2002-02-13 15:48:03 by simonmar]
simonmar [Wed, 13 Feb 2002 15:48:03 +0000 (15:48 +0000)]
[project @ 2002-02-13 15:48:03 by simonmar]
Build $(GHCI_LIBRARY) whenever we build $(LIBRARY), not just when
$(PACAGE) is set.

22 years ago[project @ 2002-02-13 15:45:25 by simonmar]
simonmar [Wed, 13 Feb 2002 15:45:25 +0000 (15:45 +0000)]
[project @ 2002-02-13 15:45:25 by simonmar]
Packages that come in by way of -package-conf files override default
packages (requested by Manuel Chakravarty).

22 years ago[project @ 2002-02-13 15:29:27 by sof]
sof [Wed, 13 Feb 2002 15:29:27 +0000 (15:29 +0000)]
[project @ 2002-02-13 15:29:27 by sof]
Tweaks to the Windows section, in part. commented out
the InstallShield section as it is no longer used.

22 years ago[project @ 2002-02-13 15:19:17 by simonpj]
simonpj [Wed, 13 Feb 2002 15:19:21 +0000 (15:19 +0000)]
[project @ 2002-02-13 15:19:17 by simonpj]
----------------------------------
Do the Right Thing for TyCons where we
can't see all their constructors.
----------------------------------

Inside a TyCon, three things can happen

1. GHC knows all the constructors, and has them to hand.
   (Nowadays, there may be zero constructors.)

2. GHC knows all the constructors, but has declined to slurp
   them all in, to avoid sucking in more declarations than
   necessary.  All we remember is the number of constructors,
   so we can get the return convention right.

3. GHC doesn't know anything. This happens *only* for decls
   coming from .hi-boot files, where the programmer declines to
   supply a representation.

Until now, these three cases have been conflated together.  Matters
are worse now that a TyCon really can have zero constructors.  In
fact, by confusing (3) with (1) we can actually generate bogus code.

With this commit, the dataCons field of a TyCon is of type:

data DataConDetails datacon
  = DataCons [datacon] -- Its data constructors, with fully polymorphic types
-- A type can have zero constructors

  | Unknown -- We're importing this data type from an hi-boot file
-- and we don't know what its constructors are

  | HasCons Int -- In a quest for compilation speed we have imported
-- only the number of constructors (to get return
-- conventions right) but not the constructors themselves

This says exactly what is going on.  There are lots of consequential small
changes.

22 years ago[project @ 2002-02-13 15:14:06 by simonpj]
simonpj [Wed, 13 Feb 2002 15:14:07 +0000 (15:14 +0000)]
[project @ 2002-02-13 15:14:06 by simonpj]
--------------------------------------------
Fix a bugs in type inference for rank-N types
--------------------------------------------

We discovered this bug when looking at type rules!

1. When type checking (e :: sigma-ty), we must specialise sigma-ty,
   else we lose the invariant that tcMonoType has.

2. In tcExpr_id, we should pass in a Hole tyvar not an ordinary tyvar.

As usual, I moved some functions around in consequence.

22 years ago[project @ 2002-02-13 15:07:59 by simonmar]
simonmar [Wed, 13 Feb 2002 15:08:00 +0000 (15:08 +0000)]
[project @ 2002-02-13 15:07:59 by simonmar]
Don't translate out negative (boxed) literals too early.

22 years ago[project @ 2002-02-13 14:52:43 by simonmar]
simonmar [Wed, 13 Feb 2002 14:52:43 +0000 (14:52 +0000)]
[project @ 2002-02-13 14:52:43 by simonmar]
Catch up with Haskell 98 revisions: allow sections like (++ x ++ y)
and (3 + 4 +).

22 years ago[project @ 2002-02-13 14:14:09 by simonpj]
simonpj [Wed, 13 Feb 2002 14:14:09 +0000 (14:14 +0000)]
[project @ 2002-02-13 14:14:09 by simonpj]
------------------------------
Fix the "occurs check" so that
it handles unifying a type variable
with a type scheme
------------------------------

It's illegal to unify a type variable with a type scheme:

a  :=:  (forall b. b->b) -> Int

But I wasn't detecting that properly.  Now, the same code
that does the occurs check also looks for foralls.

22 years ago[project @ 2002-02-13 14:05:50 by simonpj]
simonpj [Wed, 13 Feb 2002 14:06:00 +0000 (14:06 +0000)]
[project @ 2002-02-13 14:05:50 by simonpj]
Import wibbles

22 years ago[project @ 2002-02-13 12:17:48 by simonmar]
simonmar [Wed, 13 Feb 2002 12:17:48 +0000 (12:17 +0000)]
[project @ 2002-02-13 12:17:48 by simonmar]
Add {-# OPTIONS -fno-implicit-prelude #-} to the top of GHC/PrimopWrappers.hs

22 years ago[project @ 2002-02-13 11:51:40 by simonmar]
simonmar [Wed, 13 Feb 2002 11:51:40 +0000 (11:51 +0000)]
[project @ 2002-02-13 11:51:40 by simonmar]
- Detect presence of a POSIX-compatible regex interface in configure,
  and omit Text.Regex.Posix (and hence Text.Regex) if it is missing.
  ToDo: pull in a suitably-licensed implementation of POSIX regex
  to be used in the event that the system doesn't supply one.

- Rename old HaveRegex to HaveGNURegex.

22 years ago[project @ 2002-02-13 10:45:28 by simonmar]
simonmar [Wed, 13 Feb 2002 10:45:28 +0000 (10:45 +0000)]
[project @ 2002-02-13 10:45:28 by simonmar]
Use --update-package rather than --remove-package followed by --add-package

22 years ago[project @ 2002-02-13 10:40:24 by simonmar]
simonmar [Wed, 13 Feb 2002 10:40:24 +0000 (10:40 +0000)]
[project @ 2002-02-13 10:40:24 by simonmar]
Fixes to SplitObjs: we now put the split object files in a
subdirectory M_split/ rather than just M/, because the latter
interacts badly with our hierarchical module structure.

22 years ago[project @ 2002-02-13 10:39:36 by simonpj]
simonpj [Wed, 13 Feb 2002 10:39:36 +0000 (10:39 +0000)]
[project @ 2002-02-13 10:39:36 by simonpj]
-------------------------------
dosifyPath before opening files
-------------------------------

If you call
hsc2hs foo/baz

you get the amazing response:

'foo' is not recognized as an internal or external command,
operable program or batch file.

On the other hand
hsc2hs foo\baz

works fine.  Solution: call dosifyPath before opening or writing the file.

Somehow we should make it less easy to trip up when doing file I/O on
Windows.  And provide a library of path-manipulation primitives.

22 years ago[project @ 2002-02-13 08:48:06 by sof]
sof [Wed, 13 Feb 2002 08:48:07 +0000 (08:48 +0000)]
[project @ 2002-02-13 08:48:06 by sof]
Revised implementation of multi-threaded callouts (and callins):

- unified synchronisation story for threaded and SMP builds,
  following up on SimonM's suggestion. The following synchro
  variables are now used inside the Scheduler:

    + thread_ready_cond - condition variable that is signalled
      when a H. thread has become runnable (via the THREAD_RUNNABLE()
      macro) and there are available capabilities. Waited on:
         + upon schedule() entry (iff no caps. available).
 + when a thread inside of the Scheduler spots that there
   are no runnable threads to service, but one or more
   external call is in progress.
 + in resumeThread(), waiting for a capability to become
   available.

      Prior to waiting on thread_ready_cond, a counter rts_n_waiting_tasks
      is incremented, so that we can keep track of the number of
      readily available worker threads (need this in order to make
      an informed decision on whether or not to create a new thread
      when an external call is made).

    + returning_worker_cond - condition variable that is waited
      on by an OS thread that has finished executing and external
      call & now want to feed its result back to the H thread
      that made the call. Before doing so, the counter
      rts_n_returning_workers is incremented.

      Upon entry to the Scheduler, this counter is checked for &
      if it is non-zero, the thread gives up its capability and
      signals returning_worker_cond before trying to re-grab a
      capability. (releaseCapability() takes care of this).

    + sched_mutex - protect Scheduler data structures.
    + gc_pending_cond - SMP-only condition variable for signalling
      completion of GCs.

- initial implementation of call-ins, i.e., multiple OS threads
  may concurrently call into the RTS without interfering with
  each other. Implementation uses cheesy locking protocol to
  ensure that only one OS thread at a time can construct a
  function application -- stop-gap measure until the RtsAPI
  is revised (as discussed last month) *and* a designated
  block is used for allocating these applications.

- In the implementation of call-ins, the OS thread blocks
  waiting for an RTS worker thread to complete the evaluation
  of the function application. Since main() also uses the
  RtsAPI, provide a separate entry point for it (rts_mainEvalIO()),
  which avoids creating a separate thread to evaluate Main.main,
  that can be done by the thread exec'ing main() directly.
  [Maybe there's a tidier way of doing this, a bit ugly the
  way it is now..]

There are a couple of dark corners that needs to be looked at,
such as conditions for shutting down (and how) + consider what
ought to happen when async I/O is thrown into the mix (I know
what will happen, but that's maybe not what we want).

Other than that, things are in a generally happy state & I hope
to declare myself done before the week is up.

22 years ago[project @ 2002-02-13 07:51:01 by sof]
sof [Wed, 13 Feb 2002 07:51:01 +0000 (07:51 +0000)]
[project @ 2002-02-13 07:51:01 by sof]
removed taskNotAvailable(), taskAvailable() and getTaskCount() - simplified away

22 years ago[project @ 2002-02-13 07:48:18 by sof]
sof [Wed, 13 Feb 2002 07:48:19 +0000 (07:48 +0000)]
[project @ 2002-02-13 07:48:18 by sof]
moved defn of RTS_SUPPORTS_THREADS from Rts.h to Stg.h

22 years ago[project @ 2002-02-13 07:47:41 by sof]
sof [Wed, 13 Feb 2002 07:47:41 +0000 (07:47 +0000)]
[project @ 2002-02-13 07:47:41 by sof]
uh, make that the StgTSOBlockReason enum

22 years ago[project @ 2002-02-13 07:46:42 by sof]
sof [Wed, 13 Feb 2002 07:46:42 +0000 (07:46 +0000)]
[project @ 2002-02-13 07:46:42 by sof]
Add BlockedOnCCall to StgTSOBlockInfo enum

22 years ago[project @ 2002-02-12 17:20:36 by njn]
njn [Tue, 12 Feb 2002 17:20:36 +0000 (17:20 +0000)]
[project @ 2002-02-12 17:20:36 by njn]
Added note about the mangler removing unneeded SRTs.

22 years ago[project @ 2002-02-12 16:55:22 by simonmar]
simonmar [Tue, 12 Feb 2002 16:55:22 +0000 (16:55 +0000)]
[project @ 2002-02-12 16:55:22 by simonmar]
Must add 'depend' before 'all' in the boot target so that we get
dependencies in time.

22 years ago[project @ 2002-02-12 16:52:37 by simonmar]
simonmar [Tue, 12 Feb 2002 16:52:37 +0000 (16:52 +0000)]
[project @ 2002-02-12 16:52:37 by simonmar]
This isn't needed any more

22 years ago[project @ 2002-02-12 15:45:46 by simonmar]
simonmar [Tue, 12 Feb 2002 15:45:46 +0000 (15:45 +0000)]
[project @ 2002-02-12 15:45:46 by simonmar]
Use LIBOBJS rather than OBJS when building the GHCi library.

22 years ago[project @ 2002-02-12 15:39:49 by sof]
sof [Tue, 12 Feb 2002 15:39:49 +0000 (15:39 +0000)]
[project @ 2002-02-12 15:39:49 by sof]
THREAD_RUNNABLE(): make available in threaded mode

22 years ago[project @ 2002-02-12 15:38:08 by sof]
sof [Tue, 12 Feb 2002 15:38:08 +0000 (15:38 +0000)]
[project @ 2002-02-12 15:38:08 by sof]
Snapshot (before heading into work):
- thread_ready_aux_mutex is no more; use sched_mutex instead.
- gc_pending_cond only used in SMP mode.
- document the condition that thread_ready_cond captures.

22 years ago[project @ 2002-02-12 15:34:25 by sof]
sof [Tue, 12 Feb 2002 15:34:25 +0000 (15:34 +0000)]
[project @ 2002-02-12 15:34:25 by sof]
- give rts_n_free_capabilities an interpretation
  in threaded mode (possible values: 0,1)
- noFreeCapabilities() -? noCapabilities()

22 years ago[project @ 2002-02-12 15:17:13 by simonmar]
simonmar [Tue, 12 Feb 2002 15:17:36 +0000 (15:17 +0000)]
[project @ 2002-02-12 15:17:13 by simonmar]
Switch over to the new hierarchical libraries
---------------------------------------------

This commit reorganises our libraries to use the new hierarchical
module namespace extension.

The basic story is this:

   - fptools/libraries contains the new hierarchical libraries.
     Everything in here is "clean", i.e. most deprecated stuff has
     been removed.

- fptools/libraries/base is the new base package
  (replacing "std") and contains roughly what was previously
  in std, lang, and concurrent, minus deprecated stuff.
  Things that are *not allowed* in libraries/base include:
Addr, ForeignObj, ByteArray, MutableByteArray,
_casm_, _ccall_, ``'', PrimIO

  For ByteArrays and MutableByteArrays we use UArray and
  STUArray/IOUArray respectively now.

  Modules previously called PrelFoo are now under
  fptools/libraries/GHC.  eg. PrelBase is now GHC.Base.

- fptools/libraries/haskell98 provides the Haskell 98 std.
  libraries (Char, IO, Numeric etc.) as a package.  This
  package is enabled by default.

- fptools/libraries/network is a rearranged version of
  the existing net package (the old package net is still
  available; see below).

- Other packages will migrate to fptools/libraries in
  due course.

     NB. you need to checkout fptools/libraries as well as
     fptools/hslibs now.  The nightly build scripts will need to be
     tweaked.

   - fptools/hslibs still contains (almost) the same stuff as before.
     Where libraries have moved into the new hierarchy, the hslibs
     version contains a "stub" that just re-exports the new version.
     The idea is that code will gradually migrate from fptools/hslibs
     into fptools/libraries as it gets cleaned up, and in a version or
     two we can remove the old packages altogether.

   - I've taken the opportunity to make some changes to the build
     system, ripping out the old hslibs Makefile stuff from
     mk/target.mk; the new package building Makefile code is in
     mk/package.mk (auto-included from mk/target.mk).

     The main improvement is that packages now register themselves at
     make boot time using ghc-pkg, and the monolithic package.conf
     in ghc/driver is gone.

     I've updated the standard packages but haven't tested win32,
     graphics, xlib, object-io, or OpenGL yet.  The Makefiles in
     these packages may need some further tweaks, and they'll need
     pkg.conf.in files added.

   - Unfortunately all this rearrangement meant I had to bump the
     interface-file version and create a bunch of .hi-boot-6 files :-(

22 years ago[project @ 2002-02-12 11:44:54 by simonmar]
simonmar [Tue, 12 Feb 2002 11:44:54 +0000 (11:44 +0000)]
[project @ 2002-02-12 11:44:54 by simonmar]
Fix bug in previous commit

22 years ago[project @ 2002-02-12 09:43:08 by simonmar]
simonmar [Tue, 12 Feb 2002 09:43:08 +0000 (09:43 +0000)]
[project @ 2002-02-12 09:43:08 by simonmar]
fromInt ==> fromIntegral

22 years ago[project @ 2002-02-12 05:01:26 by sof]
sof [Tue, 12 Feb 2002 05:01:26 +0000 (05:01 +0000)]
[project @ 2002-02-12 05:01:26 by sof]
bring stuff in parallel/ into scope when running 'mkdependC'