simonpj [Wed, 16 Nov 2005 12:55:59 +0000 (12:55 +0000)]
[project @ 2005-11-16 12:55:58 by simonpj]
Two significant changes to the representation of types
1. Change the representation of type synonyms
Up to now, type synonym applications have been held in
*both* expanded *and* un-expanded form. Unfortunately, this
has exponential (!) behaviour when type synonyms are deeply
nested. E.g.
type P a b = (a,b)
f :: P a (P b (P c (P d e)))
This showed up in a program of Joel Reymont, now immortalised
as typecheck/should_compile/syn-perf.hs
So now synonyms are held as ordinary TyConApps, and expanded
only on demand.
SynNote has disappeared altogether, so the only remaining TyNote
is a FTVNote. I'm not sure if it's even useful.
2. Eta-reduce newtypes
See the Note [Newtype eta] in TyCon.lhs
If we have
newtype T a b = MkT (S a b)
then, in Core land, we would like S = T, even though the application
of T is then not saturated. This commit eta-reduces T's RHS, and
keeps that inside the TyCon (in nt_etad_rhs). Result is that
coreEqType can be simpler, and has less need of expanding newtypes.
simonpj [Tue, 15 Nov 2005 17:37:54 +0000 (17:37 +0000)]
[project @ 2005-11-15 17:37:54 by simonpj]
Yet more detail in types with -dppr-debug
panne [Sun, 13 Nov 2005 19:07:18 +0000 (19:07 +0000)]
[project @ 2005-11-13 19:07:17 by panne]
Move the building guide to GHC where it belongs. This is more consistent and
currently even necessary, otherwise *every* fptools project would need the ghc
subtree.
simonpj [Sat, 12 Nov 2005 21:41:12 +0000 (21:41 +0000)]
[project @ 2005-11-12 21:41:12 by simonpj]
Better TH -> HsSyn conversion
Merge to stable (attempt)
This commit monad-ises the TH syntax -> HS syntax conversion.
This means that error messages can be reported in a more civilised
way. It also ensures that the entire structure is converted eagerly.
That means that any exceptions buried inside it are triggered
during conversion, and caught by the exception handler in TcSplice.
Before, they could be triggered later, and looked like comiler
crashes.
simonmar [Thu, 10 Nov 2005 16:14:01 +0000 (16:14 +0000)]
[project @ 2005-11-10 16:14:01 by simonmar]
Fix a crash in STM; we were releasing ownership of the transaction too
early in stmWait(), so a TSO could be woken up before we had finished
putting it to sleep properly.
simonmar [Thu, 10 Nov 2005 10:52:40 +0000 (10:52 +0000)]
[project @ 2005-11-10 10:52:40 by simonmar]
- point to the bug tracker from the "known bugs" section
- move the item about instances from GHCi to GHC, and tweak it a bit
simonmar [Thu, 10 Nov 2005 10:50:39 +0000 (10:50 +0000)]
[project @ 2005-11-10 10:50:39 by simonmar]
make validate happy
simonmar [Wed, 9 Nov 2005 11:36:43 +0000 (11:36 +0000)]
[project @ 2005-11-09 11:36:43 by simonmar]
oops, it's i386_TARGET_ARCH, not x86_TARGET_ARCH
simonmar [Tue, 8 Nov 2005 15:07:08 +0000 (15:07 +0000)]
[project @ 2005-11-08 15:07:08 by simonmar]
SMP bugfix: if the thread we were just running blocked, then we are in
a delicate state - we don't necessarily have access to the TSO we were
just running, because we relinquished it when we put it on whatever
blocking queue it is on. It might even be running already.
Previously I made the scheduler quickly loop again in this case.
However, I made it loop too quickly: we should be sure to set the
blackholes_need_checking flag if necessary, otherwise we can miss some
wakeups.
simonmar [Tue, 8 Nov 2005 14:20:28 +0000 (14:20 +0000)]
[project @ 2005-11-08 14:20:28 by simonmar]
more docs for GHC_PACKAGE_PATH
simonmar [Tue, 8 Nov 2005 14:18:35 +0000 (14:18 +0000)]
[project @ 2005-11-08 14:18:35 by simonmar]
when GHC_PACKAGE_PATH is set, treat the database at the bottom of the
stack as the "global" one, ie. the one we modify by default. This
means that GHC_PACKAGE_PATH can be used to set up a virtual GHC
package environment into which packages can be installed using Cabal,
without setting anything other than GHC_PACKAGE_PATH.
simonmar [Tue, 8 Nov 2005 12:56:04 +0000 (12:56 +0000)]
[project @ 2005-11-08 12:56:04 by simonmar]
gcc's -fstrict-aliasing is biting us when we use the stack to store
different types of objects. For example:
*((StgDouble*)((W_)Sp-8)) = *((StgDouble*)((W_)Sp+8));
Sp[1] = (W_)&s1Cx_info;
gcc feels free to reorder these two lines, because they refer to
differently typed objects, even though the assignment to Sp[1] clearly
aliases the read from the same location.
Trying to fix this by accessing locations using union types might be
possible, but I took the sledgehammer approach of
-fno-strict-aliasing. This is justified to a certain extent because
our generated C code is derived from a very weakly-typed internal
language (C--).
simonmar [Tue, 8 Nov 2005 12:31:36 +0000 (12:31 +0000)]
[project @ 2005-11-08 12:31:36 by simonmar]
unless I'm mistaken, only x86 needs -ffloat-store. x86_64 certainly
doesn't need it, because it uses SSE2 with the correct-sized floating
point registers and doesn't store temporary results with more
precision than results in memory.
simonmar [Tue, 8 Nov 2005 11:02:56 +0000 (11:02 +0000)]
[project @ 2005-11-08 11:02:56 by simonmar]
Fix bug in an assertion
simonmar [Tue, 8 Nov 2005 10:44:22 +0000 (10:44 +0000)]
[project @ 2005-11-08 10:44:22 by simonmar]
raiseAsync: fix bug that can cause a scavenge_stack panic for a thread
that has just been killed.
simonmar [Mon, 7 Nov 2005 14:43:34 +0000 (14:43 +0000)]
[project @ 2005-11-07 14:43:34 by simonmar]
Fix some problems with array thawing/freezing and the GC.
simonmar [Mon, 7 Nov 2005 10:20:43 +0000 (10:20 +0000)]
[project @ 2005-11-07 10:20:43 by simonmar]
Fix non-threaded build.
ross [Sat, 5 Nov 2005 00:23:36 +0000 (00:23 +0000)]
[project @ 2005-11-05 00:23:36 by ross]
fix for pre-6.0 ghc's
simonmar [Fri, 4 Nov 2005 16:23:20 +0000 (16:23 +0000)]
[project @ 2005-11-04 16:23:20 by simonmar]
Document GHC_PACKAGE_PATH, and changes to the ghc-pkg command line interface.
simonmar [Fri, 4 Nov 2005 15:48:26 +0000 (15:48 +0000)]
[project @ 2005-11-04 15:48:25 by simonmar]
- Add support for the GHC_PACKAGE_PATH environment variable, which
specifies a :-separated (;-separated on Windows) list of package
database files. If the list ends in : (; on Windows), then the
normal user and global databases are added.
GHC_PACKAGE_PATH is searched left-to-right for packages, like
$PATH, but unlike -package-conf flags, which are searched
right-to-left. This isn't ideal, but it seemed the least worst to me
(command line flags always override right-to-left (except -i),
whereas the PATH environment variable overrides left-to-right, I chose
to follow the environment variable convention). I can always change
it if there's an outcry.
- Rationalise the interpretation of --user, --global, and -f on the
ghc-pkg command line. The story is now this: --user and --global
say which package database to *act upon*, they do not change the
shape of the database stack. -f pushes a database on the stack, and
also requests that the specified database be the one to act upon, for
commands that modify the database. If a database is already on the stack,
then -f just selects it as the one to act upon.
This means you can have a bunch of databases in GHC_PACKAGE_PATH, and
use -f to select the one to modify.
simonmar [Fri, 4 Nov 2005 15:33:36 +0000 (15:33 +0000)]
[project @ 2005-11-04 15:33:36 by simonmar]
patch up forkProcess(): don't discard our own Task, and set
cap->spare_workers to be empty in the child process.
simonmar [Fri, 4 Nov 2005 15:31:30 +0000 (15:31 +0000)]
[project @ 2005-11-04 15:31:30 by simonmar]
We shouldn't call closeCondition() on the condition in discardTask(),
we're just freeing the Task for later use.
simonmar [Fri, 4 Nov 2005 12:02:05 +0000 (12:02 +0000)]
[project @ 2005-11-04 12:02:04 by simonmar]
Win32: Use CriticalSections instead of Mutexes, they are *much* faster.
simonmar [Thu, 3 Nov 2005 16:47:45 +0000 (16:47 +0000)]
[project @ 2005-11-03 16:47:45 by simonmar]
adjust type of startSignalHandlers() to make changes to Win32 version
simonmar [Thu, 3 Nov 2005 16:34:45 +0000 (16:34 +0000)]
[project @ 2005-11-03 16:34:45 by simonmar]
schedulePushWork(): don't attempt to move the thread bound to the
current Task to a different Capability.
simonmar [Thu, 3 Nov 2005 16:23:24 +0000 (16:23 +0000)]
[project @ 2005-11-03 16:23:24 by simonmar]
wibble
simonmar [Thu, 3 Nov 2005 16:22:15 +0000 (16:22 +0000)]
[project @ 2005-11-03 16:22:15 by simonmar]
Improve the Win32 implementation of the time-measurement stuff. Now
supports per-thread CPU time, and the elapsed time should be correct
(previously it was the sum of user time & kernel time, which isn't
what we want).
simonmar [Thu, 3 Nov 2005 16:20:38 +0000 (16:20 +0000)]
[project @ 2005-11-03 16:20:38 by simonmar]
use getThreadCPUTime, not getProcessTimes
simonmar [Thu, 3 Nov 2005 15:15:14 +0000 (15:15 +0000)]
[project @ 2005-11-03 15:15:14 by simonmar]
Fixes for console event handling on Win32 in the threaded/SMP runtime.
(it now builds, but is untested).
simonpj [Thu, 3 Nov 2005 15:00:23 +0000 (15:00 +0000)]
[project @ 2005-11-03 15:00:23 by simonpj]
Missing import for new assert
simonmar [Thu, 3 Nov 2005 14:35:20 +0000 (14:35 +0000)]
[project @ 2005-11-03 14:35:20 by simonmar]
Modify ACQUIRE_LOCK/RELEASE_LOCK for use in .cmm files
simonmar [Thu, 3 Nov 2005 14:28:43 +0000 (14:28 +0000)]
[project @ 2005-11-03 14:28:43 by simonmar]
avoid a warning
simonmar [Thu, 3 Nov 2005 13:39:22 +0000 (13:39 +0000)]
[project @ 2005-11-03 13:39:22 by simonmar]
Fix build on win32.
simonmar [Thu, 3 Nov 2005 11:05:38 +0000 (11:05 +0000)]
[project @ 2005-11-03 11:05:38 by simonmar]
Improvments to time-measurement and stats:
- move all the platform-dependent timing related stuff into
posix/GetTime.c and win32/GetTime.c, with the machine-indepent
interface specified in GetTime.h. This is now used by
Stats.c.
- On Unix, use gettimeofday() and getrusage() by default, falling
back to time() if one of these isn't available.
- try to implement thread-specfic CPU-time measurement using
clock_gettime() on Unix. Doesn't work reliably on Linux, because
the implemenation tries to use the processor TSC, which on an
SMP machine goes wrong when the thread moves between CPUs. However,
it's slightly less bogus that before, and hopefully will improve
in the future.
simonmar [Thu, 3 Nov 2005 11:02:00 +0000 (11:02 +0000)]
[project @ 2005-11-03 11:02:00 by simonmar]
indentation only
simonmar [Thu, 3 Nov 2005 11:00:40 +0000 (11:00 +0000)]
[project @ 2005-11-03 11:00:40 by simonmar]
Check for librt and clock_gettime()
simonpj [Wed, 2 Nov 2005 17:41:00 +0000 (17:41 +0000)]
[project @ 2005-11-02 17:41:00 by simonpj]
Second correction to the TH fix of Oct 26, involving thFAKE
Original message
1) A bug in the renaming of [d| brackets |]. The problem was
that when we renamed the bracket we messed up the name cache, because
the module was still that of the parent module. Now we set a fake
module before renaming it.
This commit fixes the typecheker problem in a different way,
in tcLookupGlobal.
simonpj [Wed, 2 Nov 2005 17:39:57 +0000 (17:39 +0000)]
[project @ 2005-11-02 17:39:57 by simonpj]
Trace output only
simonmar [Wed, 2 Nov 2005 13:05:30 +0000 (13:05 +0000)]
[project @ 2005-11-02 13:05:30 by simonmar]
release/acquire the SM lock around scheduleFinalizers(), because we
need to call allocateLocal() in there, which acquires the SM lock.
simonmar [Wed, 2 Nov 2005 13:04:55 +0000 (13:04 +0000)]
[project @ 2005-11-02 13:04:55 by simonmar]
when shutting down, don't allow a worker to exit until the run queue
is empty, because the thread in exitScheduler() is waiting for this.
simonmar [Wed, 2 Nov 2005 12:26:21 +0000 (12:26 +0000)]
[project @ 2005-11-02 12:26:21 by simonmar]
scheduleHandleStackOverflow: fix bug in non-threaded RTS - if
(task->tso != NULL), then (task->tso) is not necessarily the TSO we
are running (in the threaded RTS it is).
Also fix a few non-threaded warnings while I'm here.
simonmar [Wed, 2 Nov 2005 12:23:58 +0000 (12:23 +0000)]
[project @ 2005-11-02 12:23:58 by simonmar]
add an ASSERT
simonmar [Wed, 2 Nov 2005 11:56:56 +0000 (11:56 +0000)]
[project @ 2005-11-02 11:56:56 by simonmar]
Fix warnings when assigning the result of a foreign call to BaseReg
(as now happens in SMP mode with resumeThread()).
simonpj [Wed, 2 Nov 2005 09:57:45 +0000 (09:57 +0000)]
[project @ 2005-11-02 09:57:45 by simonpj]
Correct the TH fix of Oct 26, involving thFAKE
MERGE TO STABLE
Original message
1) A bug in the renaming of [d| brackets |]. The problem was
that when we renamed the bracket we messed up the name cache, because
the module was still that of the parent module. Now we set a fake
module before renaming it.
But we have to tell the *typechecker* too, not just the renamer.
See comments with TcSplice.tc_bracket (DecBr case).
Should fix TH failures in the STABLE branch
simonpj [Wed, 2 Nov 2005 09:53:18 +0000 (09:53 +0000)]
[project @ 2005-11-02 09:53:18 by simonpj]
Export lists
simonmar [Mon, 31 Oct 2005 11:53:42 +0000 (11:53 +0000)]
[project @ 2005-10-31 11:53:42 by simonmar]
x86_64: pass -fno-unit-at-a-time to gcc. See comment for details.
simonpj [Mon, 31 Oct 2005 11:49:30 +0000 (11:49 +0000)]
[project @ 2005-10-31 11:49:29 by simonpj]
Wibble to: "Add a new pragma: SPECIALISE INLINE"
I messed up the way that NOINLINE is parsed; this commit fixes it.
simonmar [Mon, 31 Oct 2005 11:31:10 +0000 (11:31 +0000)]
[project @ 2005-10-31 11:31:10 by simonmar]
clean up more junk generated by gcc
simonmar [Mon, 31 Oct 2005 11:17:53 +0000 (11:17 +0000)]
[project @ 2005-10-31 11:17:53 by simonmar]
x86_64: catch and fix one kind of crappy code generated by gcc
# movq -4(%rbp), %rax
# jmp *%rax
==>
# jmp *-4(%rbp)
simonmar [Mon, 31 Oct 2005 10:52:06 +0000 (10:52 +0000)]
[project @ 2005-10-31 10:52:06 by simonmar]
Reverse the sense of the is-young-generation test in the update code.
This generates much better code from gcc.
krasimir [Sun, 30 Oct 2005 19:12:31 +0000 (19:12 +0000)]
[project @ 2005-10-30 19:12:31 by krasimir]
Change the way in which the .exe suffix to the output file is added. The reason
is that "-o main" will generate main.exe on Windows while the doesFileExists "main"
in DriverPipeline.link will return False.
krasimir [Sat, 29 Oct 2005 18:13:52 +0000 (18:13 +0000)]
[project @ 2005-10-29 18:13:52 by krasimir]
The guessed output file should have ".exe" extension on Windows. ld tends to
add .exe automatically if the output file doesn't have extension but if
we don't add the extension explicitly then the doesFileExists check in
DriverPipeline.link will fail.
panne [Sat, 29 Oct 2005 14:19:59 +0000 (14:19 +0000)]
[project @ 2005-10-29 14:19:59 by panne]
Fixed the last commit, which broke the nightly builds. I'm not sure if
this is really a fix or a workaround only, though...
krasimir [Sat, 29 Oct 2005 05:17:57 +0000 (05:17 +0000)]
[project @ 2005-10-29 05:17:57 by krasimir]
The mut_lists array was allocated but never initialized. This was causing SegFault.
simonmar [Fri, 28 Oct 2005 15:51:15 +0000 (15:51 +0000)]
[project @ 2005-10-28 15:51:15 by simonmar]
document -stubdir
simonmar [Fri, 28 Oct 2005 15:22:39 +0000 (15:22 +0000)]
[project @ 2005-10-28 15:22:39 by simonmar]
Add -stubdir option to control location of generated stub files. Also
do some clean up while I'm here - remove hscStubCOut/hscStubHOut from
DynFlags, and add
mkStubPaths :: DynFlags -> Module -> ModLocation -> (FilePath,FilePath)
to Finder. (this seemed better than caching the stub paths in every
ModLocation, because they are rarely needed and only present in home
modules, and are easily calculated from other available information).
-stubdir behaves in exactly the same way as -odir and -hidir.
simonmar [Fri, 28 Oct 2005 11:35:35 +0000 (11:35 +0000)]
[project @ 2005-10-28 11:35:35 by simonmar]
Change the default executable name to match the basename of the source
file containing the Main module (or the module specified by -main-is),
if there is one. On Windows, the .exe extension is added.
As requested on the ghc-users list, and as implemented by Tomasz
Zielonka <tomasz.zielonka at gmail.com>, with modifications by me.
I changed the type of the mainModIs field of DynFlags from Maybe
String to Module, which removed some duplicate code.
simonmar [Fri, 28 Oct 2005 11:29:19 +0000 (11:29 +0000)]
[project @ 2005-10-28 11:29:19 by simonmar]
Fix double "Linking ..." message, and mention the name of the
executable in the message.
simonmar [Fri, 28 Oct 2005 08:16:54 +0000 (08:16 +0000)]
[project @ 2005-10-28 08:16:54 by simonmar]
Fix links to library doc for Haddock 0.7.
simonmar [Fri, 28 Oct 2005 08:10:09 +0000 (08:10 +0000)]
[project @ 2005-10-28 08:10:09 by simonmar]
Fix recent breakage on non-Windows systems
simonmar [Thu, 27 Oct 2005 15:26:06 +0000 (15:26 +0000)]
[project @ 2005-10-27 15:26:06 by simonmar]
- Very simple work-sharing amongst Capabilities: whenever a Capability
detects that it has more than 1 thread in its run queue, it runs
around looking for empty Capabilities, and shares the threads on its
run queue equally with the free Capabilities it finds.
- unlock the garbage collector's mutable lists, by having private
mutable lists per capability (and per generation). The private
mutable lists are moved onto the main mutable lists at each GC.
This pulls the old-generation update code out of the storage manager
mutex, which is one of the last remaining causes of (alleged) contention.
- Fix some problems with synchronising when a GC is required. We should
synchronise quicker now.
simonpj [Thu, 27 Oct 2005 15:21:05 +0000 (15:21 +0000)]
[project @ 2005-10-27 15:21:05 by simonpj]
Improve warning a little (suggested by Benjamin Pierce)
simonmar [Thu, 27 Oct 2005 15:18:50 +0000 (15:18 +0000)]
[project @ 2005-10-27 15:18:50 by simonmar]
rtsFatalInternalError(): better to abort() rather than just
stg_exit(), at least then we get a core dump.
simonmar [Thu, 27 Oct 2005 15:17:11 +0000 (15:17 +0000)]
[project @ 2005-10-27 15:17:11 by simonmar]
unpark_tso: call unblockOne() instead of doing the job inline. This
properly migrates the thread, setting its task to point back to the
right capability, if necessary.
simonpj [Thu, 27 Oct 2005 14:35:21 +0000 (14:35 +0000)]
[project @ 2005-10-27 14:35:20 by simonpj]
Add a new pragma: SPECIALISE INLINE
This amounts to adding an INLINE pragma to the specialised version
of the function. You can add phase stuff too (SPECIALISE INLINE [2]),
and NOINLINE instead of INLINE.
The reason for doing this is to support inlining of type-directed
recursive functions. The main example is this:
-- non-uniform array type
data Arr e where
ArrInt :: !Int -> ByteArray# -> Arr Int
ArrPair :: !Int -> Arr e1 -> Arr e2 -> Arr (e1, e2)
(!:) :: Arr e -> Int -> e
{-# SPECIALISE INLINE (!:) :: Arr Int -> Int -> Int #-}
{-# SPECIALISE INLINE (!:) :: Arr (a, b) -> Int -> (a, b) #-}
ArrInt _ ba !: (I# i) = I# (indexIntArray# ba i)
ArrPair _ a1 a2 !: i = (a1 !: i, a2 !: i)
If we use (!:) at a particular array type, we want to inline (:!),
which is recursive, until all the type specialisation is done.
On the way I did a bit of renaming and tidying of the way that
pragmas are carried, so quite a lot of files are touched in a
fairly trivial way.
simonpj [Thu, 27 Oct 2005 14:34:32 +0000 (14:34 +0000)]
[project @ 2005-10-27 14:34:32 by simonpj]
Filter out inaccessible GADT alternatives
simonpj [Thu, 27 Oct 2005 13:51:27 +0000 (13:51 +0000)]
[project @ 2005-10-27 13:51:27 by simonpj]
Allow GADTs in record update, provided all the relevant datacons are
vanilla. Turns out that ObjectIO.StdMenuElement uses this facility!
This a slight enhancement to the new stuff allowing record
fields in GADTs.
simonmar [Thu, 27 Oct 2005 08:00:03 +0000 (08:00 +0000)]
[project @ 2005-10-27 08:00:03 by simonmar]
Fix getThreadLocalVar() on Win32 - thanks for Krasimir for finding the bug.
sof [Thu, 27 Oct 2005 01:39:40 +0000 (01:39 +0000)]
[project @ 2005-10-27 01:39:40 by sof]
[mingw/msys only]
Undo long-standing workaround for buggy GNU ld's on mingw/msys; i.e.,
the linker wasn't correctly generating relocatable object files when
the number of relocs exceeded 2^16. Worked around the issue by
hackily splitting up the GHCi object file for the larger packages
('base', 'ObjectIO' and 'win32') into a handful of object files,
each with a manageable number of relocs. Tiresome and error-prone
(but the hack has served us well!)
This commit imposes a restriction on the 'ld' you use to compile
up GHC with; it now has to be ld-2.15.x or later (something GHC
binary dists have shipped with since 6.2.2)
sof [Thu, 27 Oct 2005 01:27:37 +0000 (01:27 +0000)]
[project @ 2005-10-27 01:27:37 by sof]
ocGetNames_PEi386(): fix bug in previous commit to this function;
the correct .bss size for object files wasn't being passed to
addProddableBlock().
Not directly harmful, but triggers ASSERT() failure w/ DEBUG.
Merge to STABLE.
sof [Thu, 27 Oct 2005 00:21:24 +0000 (00:21 +0000)]
[project @ 2005-10-27 00:21:24 by sof]
emitForeignCall: avoid CC warnings by hinting that resume/suspendThread id arg is a ptr
sof [Wed, 26 Oct 2005 22:33:20 +0000 (22:33 +0000)]
[project @ 2005-10-26 22:33:20 by sof]
ASSERT_TASK_ID(): THREADED_RTS-only assert
simonmar [Wed, 26 Oct 2005 15:36:06 +0000 (15:36 +0000)]
[project @ 2005-10-26 15:36:06 by simonmar]
Package up the various properties of Capabilities/Tasks that we were
asserting all over the place, and put them in a single macro
ASSERT_CAPABILITY_INVARIANTS().
simonmar [Wed, 26 Oct 2005 15:22:08 +0000 (15:22 +0000)]
[project @ 2005-10-26 15:22:08 by simonmar]
The prev/next link fields in struct Capability_ aren't used
simonmar [Wed, 26 Oct 2005 15:20:59 +0000 (15:20 +0000)]
[project @ 2005-10-26 15:20:59 by simonmar]
- forkProcess fix: add a forgotten rts_unlock()
- add a couple more ASSERTs
simonpj [Wed, 26 Oct 2005 14:53:30 +0000 (14:53 +0000)]
[project @ 2005-10-26 14:53:30 by simonpj]
awaitRequests: blocked_queue_tl was being set to NULL rather than
END_TSO_QUEUE if the thread being removed was at the end of the queue.
This bug has been in the code since 2003 - I have absolutely no idea
why it hasn't manifested until today.
simonmar [Wed, 26 Oct 2005 13:58:40 +0000 (13:58 +0000)]
[project @ 2005-10-26 13:58:40 by simonmar]
forkOS_createThreadWrapper: oops, better use the result from rts_evalStableIO()
simonpj [Wed, 26 Oct 2005 13:03:39 +0000 (13:03 +0000)]
[project @ 2005-10-26 13:03:39 by simonpj]
Improve documentation of typeclass extensions; merge to stable if it goes easily
simonpj [Wed, 26 Oct 2005 12:35:12 +0000 (12:35 +0000)]
[project @ 2005-10-26 12:35:12 by simonpj]
Simplify Provenance (the LocalDef constructor) a little
simonpj [Wed, 26 Oct 2005 12:05:03 +0000 (12:05 +0000)]
[project @ 2005-10-26 12:05:03 by simonpj]
MERGE TO STABLE
Fix two small Template Haskell bugs.
(1) A bug in the renaming of [d| brackets |]. The problem was
that when we renamed the bracket we messed up the name cache, because
the module was still that of the parent module. Now we set a fake
module before renaming it.
TH_spliceDecl4 is the test.
(2) An expression splice can in principle mention *any* variable,
so the renamer really has to assume that it does when doing depdendency
analysis. For example
f = ...
h = ...$(thing "f")...
The renamer had better not put 'h' before 'f', else the type checker
won't find a defn for 'f' in the type envt.
TH_spliceE5 is the test
simonmar [Wed, 26 Oct 2005 11:58:57 +0000 (11:58 +0000)]
[project @ 2005-10-26 11:58:57 by simonmar]
x86_64 fix: I was a bit sloppy before and assumed that the malloc()'d
memory would be in the low 2Gb, so I could use 32-bit offset
addressing. It appears that this sometimes isn't the case, so do it
properly and use 64-bit absolute addressing.
simonmar [Wed, 26 Oct 2005 11:41:51 +0000 (11:41 +0000)]
[project @ 2005-10-26 11:41:51 by simonmar]
fix to previous change: allow workers to exit
simonmar [Wed, 26 Oct 2005 10:42:54 +0000 (10:42 +0000)]
[project @ 2005-10-26 10:42:54 by simonmar]
- change the type of StgRun(): now we return the Capability that the
thread currently holds. The return status of the thread is now
stored in cap->r.rRet (a new slot in the reg table).
This was necessary because on return from StgRun(), the current
TSO may be blocked, so it no longer belongs to us. If it is a bound
thread, then the Task may have been already woken up on another
Capability, so the scheduler can't use task->cap to find the
capability it currently owns.
- when shutting down, allow a bound thread to remove its TSO from
the run queue when exiting (eliminates an error condition in
releaseCapability()).
simonpj [Wed, 26 Oct 2005 10:24:10 +0000 (10:24 +0000)]
[project @ 2005-10-26 10:23:47 by simonpj]
Cosmetics
simonpj [Wed, 26 Oct 2005 08:41:32 +0000 (08:41 +0000)]
[project @ 2005-10-26 08:41:32 by simonpj]
Fix PUSH_ON_RUN_QUEUE bug on Win32
sof [Tue, 25 Oct 2005 17:31:38 +0000 (17:31 +0000)]
[project @ 2005-10-25 17:31:38 by sof]
FPTOOLS_CHECK_HTYPE: correctly scope the resetting of CPPFLAGS; as was,
it got blown away if the value was cached.
Merge to STABLE.
simonmar [Tue, 25 Oct 2005 15:27:22 +0000 (15:27 +0000)]
[project @ 2005-10-25 15:27:22 by simonmar]
Fix bug in allocateLocal, we weren't assigning bd->step properly
simonmar [Tue, 25 Oct 2005 15:04:58 +0000 (15:04 +0000)]
[project @ 2005-10-25 15:04:58 by simonmar]
add missing boot files
simonmar [Tue, 25 Oct 2005 12:56:50 +0000 (12:56 +0000)]
[project @ 2005-10-25 12:56:50 by simonmar]
doc LANGUAGE pragma
simonmar [Tue, 25 Oct 2005 12:48:35 +0000 (12:48 +0000)]
[project @ 2005-10-25 12:48:35 by simonmar]
Two changes from Krasimir Angelov, which were required for Visual
Haskell:
- messaging cleanup throughout the compiler. DynFlags has a new
field:
log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO ()
this action is invoked for every message generated by the
compiler. This means a client of the GHC API can direct messages to
any destination, or collect them up in an IORef for later
perusal.
This replaces previous hacks to redirect messages in the GHC API
(hence some changes to function types in GHC.hs).
- The JustTypecheck mode of GHC now does what it says. It doesn't
run any of the compiler passes beyond the typechecker for each module,
but does generate the ModIface in order that further modules can be
typechecked.
And one change from me:
- implement the LANGUAGE pragma, finally
simonmar [Tue, 25 Oct 2005 10:48:44 +0000 (10:48 +0000)]
[project @ 2005-10-25 10:48:44 by simonmar]
companion to Lexer.x rev. 1.29; columns now always count tabs as 1 in SrcLoc.
simonmar [Tue, 25 Oct 2005 10:28:59 +0000 (10:28 +0000)]
[project @ 2005-10-25 10:28:59 by simonmar]
- include the contents of ghc/HACKING verbatim, as a "quick start"
guide
- change the title to "Building and devleloping GHC", and make it a
bit more GHC-centric.
simonmar [Tue, 25 Oct 2005 10:22:48 +0000 (10:22 +0000)]
[project @ 2005-10-25 10:22:48 by simonmar]
add info about actually doing the build
simonmar [Tue, 25 Oct 2005 09:35:57 +0000 (09:35 +0000)]
[project @ 2005-10-25 09:35:57 by simonmar]
Add a "getting started" guide to hacking on GHC.
wolfgang [Tue, 25 Oct 2005 02:57:47 +0000 (02:57 +0000)]
[project @ 2005-10-25 02:57:47 by wolfgang]
Mac OS X/Darwin PowerPC: Fix a problem introduced by the recent Darwin/x86
commit.
Remember how we deliberately misaligned the .o file in memory to compensate
for Mach-O's lax alignment rules.
This should have been comitted along with Linker.c 1.203 about two weeks ago.
simonmar [Mon, 24 Oct 2005 12:23:44 +0000 (12:23 +0000)]
[project @ 2005-10-24 12:23:44 by simonmar]
define THREADED_RTS for the SMP way too
simonmar [Mon, 24 Oct 2005 09:37:08 +0000 (09:37 +0000)]
[project @ 2005-10-24 09:37:08 by simonmar]
Fix the build; none of this is actually used in THREADED_RTS or SMP,
but I haven't got around to fixing things so we can omit it from the
build completely yet.
simonmar [Mon, 24 Oct 2005 09:33:37 +0000 (09:33 +0000)]
[project @ 2005-10-24 09:33:37 by simonmar]
Fix a warning
simonmar [Mon, 24 Oct 2005 09:28:38 +0000 (09:28 +0000)]
[project @ 2005-10-24 09:28:38 by simonmar]
Fix build for way "u"
simonmar [Fri, 21 Oct 2005 15:23:59 +0000 (15:23 +0000)]
[project @ 2005-10-21 15:23:59 by simonmar]
more Win32 fixes