| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Implement :main (see ticket #662)
Patch from Volker Stolz, minor mods by me
When matching commands, we now look for (a) an exact match, and (b)
the first prefix match we find in the list. This is so that :module
can still be abbreviated by :m, to avoid surprise.
Docs still to do.
|
|
|
|
| |
Fix build on 5.04.x again
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve the GC behaviour of IORefs (see Ticket #650).
This is a small change to the way IORefs interact with the GC, which
should improve GC performance for programs with plenty of IORefs.
Previously we had a single closure type for mutable variables,
MUT_VAR. Mutable variables were *always* on the mutable list in older
generations, and always traversed on every GC.
Now, we have two closure types: MUT_VAR_CLEAN and MUT_VAR_DIRTY. The
latter is on the mutable list, but the former is not. (NB. this
differs from MUT_ARR_PTRS_CLEAN and MUT_ARR_PTRS_DIRTY, both of which
are on the mutable list). writeMutVar# now implements a write
barrier, by calling dirty_MUT_VAR() in the runtime, that does the
necessary modification of MUT_VAR_CLEAN into MUT_VAR_DIRY, and adding
to the mutable list if necessary.
This results in some pretty dramatic speedups for GHC itself. I've
just measureed a 30% overall speedup compiling a 31-module program
(anna) with the default heap settings :-D
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve the GC behaviour of IOArrays/STArrays
See Ticket #650
This is a small change to the way mutable arrays interact with the GC,
that can have a dramatic effect on performance, and make tricks with
unsafeThaw/unsafeFreeze redundant. Data.HashTable should be faster
now (I haven't measured it yet).
We now have two mutable array closure types, MUT_ARR_PTRS_CLEAN and
MUT_ARR_PTRS_DIRTY. Both are on the mutable list if the array is in
an old generation. writeArray# sets the type to MUT_ARR_PTRS_DIRTY.
The garbage collector can set the type to MUT_ARR_PTRS_CLEAN if it
finds that no element of the array points into a younger generation
(discovering this required a small addition to evacuate(), but rough
tests indicate that it doesn't measurably affect performance).
NOTE: none of this affects unboxed arrays (IOUArray/STUArray), only
boxed arrays (IOArray/STArray).
We could go further and extend the DIRTY bit to be per-block rather
than for the whole array, but for now this is an easy improvement.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC.runStmt: run the statement in a new thread to insulate the
environment from bad things that the user code might do, such as fork
a thread to send an exception back at a later time. In order to do
this, we had to keep track of which thread the ^C exception should go
to in a global variable.
Also, bullet-proof the top-level exception handler in GHCi a bit;
there was a small window where an exception could get through, so if
you lean on ^C for a while then press enter you could cause GHCi to
exit.
|
|
|
|
| |
put unicode keywords under -fglasgow-exts, they aren't Hasell98
|
|
|
|
|
|
|
| |
fix string desugaring: we can only use the ASCII unpackCString# if all
the chars are <= 0x7F, not <= 0xFF.
(fixes recent breakage in nofib/real/compress2)
|
|
|
|
| |
Add -threaded when building stage2+ again
|
|
|
|
| |
understand Unicode lambda as a synonym for \
|
|
|
|
| |
Fix a comment
|
|
|
|
|
| |
Char primops: the Char# rep is wordRep, not I32 (fixed -dcmm-lint
problems on x86_64)
|
|
|
|
| |
prevChar: don't back up over decoding errors
|
|
|
|
| |
Add a TODO
|
|
|
|
|
| |
reportLexError: don't back up one character, the buffer returned by
Alex is the one *before* the erroneous lexeme started.
|
|
|
|
| |
Z-encode cost centre symbols when printing them out.
|
|
|
|
| |
Fix compilation with GHC 6.2.x, hopefully
|
|
|
|
| |
Remove duplicate imports
|
|
|
|
| |
Remove dead panic
|
|
|
|
| |
Put a dummy record initialisation in to fix a warning
|
|
|
|
| |
Avoid desugaring bug in HEAD (see test ds057).
|
|
|
|
|
|
|
|
| |
Fix up to compile with GHC 5.04.x again.
Also includes a fix for a memory error I discovered along the way:
should fix the "scavenge_one" crash in the stage2 build of recent
HEADs.
|
|
|
|
| |
ord# and chr# should be no-ops, not conversions between wordRep and I32.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for UTF-8 source files
GHC finally has support for full Unicode in source files. Source
files are now assumed to be UTF-8 encoded, and the full range of
Unicode characters can be used, with classifications recognised using
the implementation from Data.Char. This incedentally means that only
the stage2 compiler will recognise Unicode in source files, because I
was too lazy to port the unicode classifier code into libcompat.
Additionally, the following synonyms for keywords are now recognised:
forall symbol (U+2200) forall
right arrow (U+2192) ->
left arrow (U+2190) <-
horizontal ellipsis (U+22EF) ..
there are probably more things we could add here.
This will break some source files if Latin-1 characters are being used.
In most cases this should result in a UTF-8 decoding error. Later on
if we want to support more encodings (perhaps with a pragma to specify
the encoding), I plan to do it by recoding into UTF-8 before parsing.
Internally, there were some pretty big changes:
- FastStrings are now stored in UTF-8
- Z-encoding has been moved right to the back end. Previously we
used to Z-encode every identifier on the way in for simplicity,
and only decode when we needed to show something to the user.
Instead, we now keep every string in its UTF-8 encoding, and
Z-encode right before printing it out. To avoid Z-encoding the
same string multiple times, the Z-encoding is cached inside the
FastString the first time it is requested.
This speeds up the compiler - I've measured some definite
improvement in parsing at least, and I expect compilations overall
to be faster too. It also cleans up a lot of cruft from the
OccName interface. Z-encoding is nicely hidden inside the
Outputable instance for Names & OccNames now.
- StringBuffers are UTF-8 too, and are now represented as
ForeignPtrs.
- I've put together some test cases, not by any means exhaustive,
but there are some interesting UTF-8 decoding error cases that
aren't obvious. Also, take a look at unicode001.hs for a demo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MERGE TO STABLE
This commit fixes a nasty problem discovered by Volker Stolz.
The problem is described in Note [Multiple instantiation] in
TcExpr, which is reproduced below.
(Core Lint identifies the problem, incidentally.)
tc200 is a test case.
Note [Multiple instantiation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We are careful never to make a MethodInst that has, as its meth_id, another MethodInst.
For example, consider
f :: forall a. Eq a => forall b. Ord b => a -> b
At a call to f, at say [Int, Bool], it's tempting to translate the call to
f_m1
where
f_m1 :: forall b. Ord b => Int -> b
f_m1 = f Int dEqInt
f_m2 :: Int -> Bool
f_m2 = f_m1 Bool dOrdBool
But notice that f_m2 has f_m1 as its meth_id. Now the danger is that if we do
a tcSimplCheck with a Given f_mx :: f Int dEqInt, we may make a binding
f_m1 = f_mx
But it's entirely possible that f_m2 will continue to float out, because it
mentions no type variables. Result, f_m1 isn't in scope.
Here's a concrete example that does this (test tc200):
class C a where
f :: Eq b => b -> a -> Int
baz :: Eq a => Int -> a -> Int
instance C Int where
baz = f
Current solution: only do the "method sharing" thing for the first type/dict
application, not for the iterated ones. A horribly subtle point.
|
|
|
|
|
|
|
|
|
| |
'newtype' declarations are now parsed exactly like data type declarations,
so that you can declare newtypes using GADT syntax. But that means we
must check all the newtype restrictions separately, and I mised one.
This commit checks that there is no existential context on the newtype.
Test is tcfail156
|
|
|
|
| |
Resolve ticket 644; crash when data con returns wrong type
|
|
|
|
|
|
|
|
|
| |
setContextAfterLoad: try to load a target if possible, otherwise load
the topmost module in the graph. Previously we were loading the first
module in the list, which happened to be right a lot of the time, but
not always.
Fixes ticket #642
|
|
|
|
| |
export ModLocation(..)
|
|
|
|
| |
Trim imports
|
|
|
|
| |
Missing Show instance for FreeRegs on PowerPC
|
|
|
|
| |
Wibble to printing FunTyCon in GHCi that makes :b GHC.Base work
|
|
|
|
| |
Marginally improve the error message on a failure in DsMeta
|
|
|
|
| |
Tiny fix to patterns with type sigs
|
|
|
|
| |
Allow trailing parens in GADT signatures
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
** Wibble to Friday's commit (fixes HEAD build) **
-----------------------------------------
Make deriving work for infix constructors
-----------------------------------------
Merge to stable branch
Back quotes were not being done correctly in deriving Read and Show.
Now they are. I think.
Test is drvrun018
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-----------------------------------------
Make deriving work for infix constructors
-----------------------------------------
Merge to stable branch
Back quotes were not being done correctly in deriving Read and Show.
Now they are. I think.
Test is drvrun018
|
|
|
|
|
|
|
|
|
| |
-----------------------------------------
Test for repated type variables in an instance decl context;
this should require -fallow-undecidable-instances'
-----------------------------------------
Merge to stable branch
|
|
|
|
|
|
|
|
|
| |
Update the bug reporting instructions, I've now installed a redirect from
http://www.haskel.org/ghc/reportabug
to the bug reporting instructions, just in case we want to move that
page in the future.
|
|
|
|
|
|
|
| |
In the panic message, point to the bug reporting page in the User's
Guide rather than directly to the bug reporting page. That way people
will see the bug reporting instructions as well as the direct link
(which has now changed).
|
|
|
|
| |
Add -threaded for stage[23]
|
|
|
|
| |
Prevent --: from being interpreted as a comment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-----------------------------------------
Fix 'mkName' operator in Template Haskell
so that it handles built-in syntax
-----------------------------------------
Merge to stable branch
The 'mkName' function in Template Haskell wasn't dealing correctly with
built-in syntax. The parser generates Exact RdrNames for built-in syntax
operators, such as ':' and '[]'; and hence so should Convert.
At the same time I'm now generating a better error message in TH when
you use a constructor as a variable or vice versa.
|
|
|
|
|
| |
small tidyup for printing bindings with long identifiers: allow the
binder and its definition to go on separate lines
|
|
|
|
| |
Dont try to output code for "naughty" record selectors
|
|
|
|
| |
-ddump-minimal-imports shouldn't turn off recompilation checking
|
|
|
|
| |
fix comment
|
|
|
|
|
|
|
|
|
|
|
|
| |
A patch to the already-somewhat-delicate machinery that deals with
pattern-matching on unboxed tuples. This patch deals with pattern
matches that can fail, e.g.
case f x of
(# Just x, Nothing #) -> ...
The fix is in desugaring of HsCase (DsExpr.lhs).
The test is dsrun013
|
|
|
|
|
| |
report the correct version number in the "compiled by GHC version.."
message in a bootstrapped compiler.
|
|
|
|
|
|
| |
make --mk-dll work with --make
Submitted by: Esa Ilari Vuokko <eivuokko@gmail.com>, thanks!
|
|
|
|
| |
Wibble to typerep (fixes crash I hope)
|