| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What's the story, Rory?
My name's not Rory. Owing to circumstances not fully understood, the RTS
used to work DLLized, even though it was largely broken. Unfortunately,
this was recently fixed.
What used to happen?
The EF_ macro from StgMacros.h was used to refer to primops &c.
Why was this a Bad Thing?
Because you need to use EDF_ when building with DLLs.
What was the result?
primops such as divExactInteger were compiled as _divExactInteger, rather
than __imp__div_Exact_Integer, so they didn't refer to the DLL routines.
How on earth did it work?
I'm not sure, but somehow the code for the relevant routines got linked
into the import libraries (e.g. libHSrts_imp.a), and were thus linked
statically into the final binary.
So that explains why the import libraries (supposedly just containing stubs)
were larger than the DLLs they were stubbing, or the static libraries, for
that matter?
Perhaps.
Golly!
Indeed.
What caused this code leakage?
That's what I don't know. Perhaps a bug in the Cygwin DLL-building tools?
I've upgraded from B20.1 to 1.1 recently.
So, what's the hack, Mac?
My name's not Mac. I added a new macro, ERTSF_, which uses DLL_IMPORT_RTS
to make sure that the Right Thing is always done (because you mustn't
make DLL references to RTS routines when compiling the RTS).
Thanks for the chat, Matt!
<punch>
|
|
|
|
| |
Fixed braino.
|
|
|
|
|
|
|
| |
The GCD saga continues: Fixed gcdInt/gcdInteger to work correctly for
non-positive values, i.e. call mpn_gcd_1 only with positive inputs,
and issue an error if both operands are zero. This should fix the bug
reported by Marc.
|
|
|
|
|
|
| |
Fixed gcdIntegerInt# primop, the previous macros was completely
wrong. gcd for Integers worked only as long the corresponding RULE
in PrelReal didn't fire.
|
|
|
|
|
|
|
|
|
| |
Fixed bug in integerTo{Word,Int}64zh primops: They used the number of
allocated *words* to determine size of an integer, but this is wrong
due to normalization. When e.g. two large numbers with different sign,
but approximately same absolute value are added, MPN_NORMALIZE cuts
down the *size*, but the allocation stays the same. Simple fix: Use
size parameter of macros directly. Easier and more correct! :-)
|
|
|
|
| |
rename takeMaybeMVar to tryTakeMVar
|
|
|
|
| |
StgStablePtr is now void*, as required by The Happy Bit Fiddlers
|
|
|
|
| |
add takeMaybeMVarzh_fast decl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleaning up the foreign object naming mess:
* Renamed the primop from makeForeignObj# to mkForeignObj#, this
is more consistent with the old Foreign.mkForeignObj.
* PrelForeign now exports makeForeignObj with the new signature.
* freeFile.c now uses StgAddr instead of StgForeignObj, this
removes the need for some fixIOs.
* Lots of import tweaking to prepare The Big Foreign Renamer,
which will move most of Foreign to ForeignObj, and FFI to Foreign.
Note: I've tried to track the changes in the interpreter sources, but
didn't test them.
|
|
|
|
|
|
| |
Changed a bunch of `#endif FOO' to `#endif /* FOO */', the former is
not strictly ANSI (don't know if the latter is, but `gcc -Wall -ansi
-pedantic' is silent then).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numerous changes in the RTS to get GUM-4.06 working (currently works with
parfib-ish programs). Most changes are isolated in the rts/parallel dir.
rts/parallel/:
The most important changes are a rewrite of the (un-)packing code (Pack.c)
and changes in LAGA, GALA table operations (Global.c) expecially in
rebuilding the tables during GC.
rts/:
Minor changes in Schedule.c, GC.c (interface to par specific root marking
and evacuation), and lots of additions to Sanity.c (surprise ;-)
Main.c change for startup: I use a new function rts_evalNothing to
start non-main-PEs in a PAR || SMP setup (RtsAPI.c)
includes/:
Updated GranSim macros in PrimOps.h.
lib/std:
Few changes in PrelHandle.c etc replacing ForeignObj by Addr in a PAR
setup (we still don't support ForeignObjs or WeakPtrs in GUM).
Typically use
#define FILE_OBJECT Addr
when dealing with files.
hslibs/lang/:
Same as above (in Foreign(Obj).lhs, Weak.lhs, IOExts.lhs etc).
-- HWL
|
|
|
|
|
|
|
|
|
| |
Add the readBlahOffAddr suite of primitives. The previous method of
using indexStuffOffAddr didn't enforce proper ordering in the I/O
monad.
The indexBlahOffAddr primops may go away in the future if/when we
figure out how to make unsafePerformIO into a no-op at the back end.
|
|
|
|
|
| |
Remove unsafeThawByteArray# primop (which was a no-op), and use
unsafeCoerce# instead.
|
|
|
|
|
| |
- context switch after a `par`
- remove some #if 0'd code
|
|
|
|
|
| |
Merged GUM-4-04 branch into the main trunk. In particular merged GUM and
SMP code. Most of the GranSim code in GUM-4-04 still has to be carried over.
|
|
|
|
| |
Add 'par' and sparking support to the SMP implementation.
|
|
|
|
| |
Remove _fast from macro name gcdIntegerIntzh_fast.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add Marc Van Dongen's Integer improvements. Specifically:
- new primops: gcdInt#, gcdIntegerInt#, divExact#,
quotInteger#, remInteger#.
- new definitions of quot and rem for Integer in
PrelNum (using the new quotInteger# and remInteger#
primops instead of quotRemInteger#). Should be
slightly faster than before. div & mod aren't
likewise optimised (yet).
- specialisations of gcd for Int and Integer, and
lcm for Integer in PrelNum.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support for blocking & unblocking asynchronous exceptions.
- new primops:
blockAsyncExceptions#, unblockAsyncExceptions# :: IO a -> IO a
- raiseInThread will block if the target thread is currently
blocking async exceptions.
- async exceptions are currently implicitly blocked inside
an exception handler. This decision might be reversed when
we have more experience with this stuff.
- Move exception-related stuff in the RTS into its own file,
Exception.{h,hc}.
|
|
|
|
| |
mulIntCzh (i386_TARGET_ARCH): xor --> xorl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds in the current state of our SMP support. Notably,
this allows the new way 's' to be built, providing support for running
multiple Haskell threads simultaneously on top of any pthreads
implementation, the idea being to take advantage of commodity SMP
boxes.
Don't expect to get much of a speedup yet; due to the excessive
locking required to synchronise access to mutable heap objects, you'll
see a slowdown in most cases, even on a UP machine. The best I've
seen is a 1.6-1.7 speedup on an example that did no locking (two
optimised nfibs in parallel).
- new RTS -N flag specifies how many pthreads to start.
- new driver -smp flag, tells the driver to use way 's'.
- new compiler -fsmp option (not for user comsumption)
tells the compiler not to generate direct jumps to
thunk entry code.
- largely rewritten scheduler
- _ccall_GC is now done by handing back a "token" to the
RTS before executing the ccall; it should now be possible
to execute blocking ccalls in the current thread while
allowing the RTS to continue running Haskell threads as
normal.
- you can only call thread-safe C libraries from a way 's'
build, of course.
Pthread support is still incomplete, and weird things (including
deadlocks) are likely to happen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support for thread{WaitRead,WaitWrite,Delay}. These should behave
identically to the 3.02 implementations.
We now have the virtual timer on during all program runs, which ticks
at 50Hz by default. This is used to implement threadDelay, so you
won't get any better granularity than the tick frequency
unfortunately. It remains to be seen whether using the virtual timer
will have a measurable impact on performance for non-threadDelaying
programs.
All operations in the I/O subsystem should now be non-blocking with
respect to other running Haskell threads. It remains to be seen
whether this will have a measurable performance impact on
non-concurrent programs (probably not).
|
|
|
|
| |
Eq and Ord instances for ThreadId.
|
|
|
|
| |
oops, back out some other changes that made it in by mistake.
|
|
|
|
|
|
| |
An inaccurate constraint on the inline assembly code for mulIntC#
caused gcc 2.95 to overoptimise around it, leading to bogus multiply
code for Integers.
|
|
|
|
|
|
| |
Shift operations where the shift count is greater than the width of
the type being shifted are now defined as returning zero (or -1 in the
case of a negative integer being shifted right with iShiftRA).
|
|
|
|
| |
Make -optc-DDEBUG work again
|
|
|
|
| |
extend cleanup to integer2Word#
|
|
|
|
| |
integer2Int# take 4: cleaned up a little.
|
|
|
|
| |
integer2Int#, take 3
|
|
|
|
| |
integer2Int# again: don't flip sign unless outside [minInt,maxInt]
|
|
|
|
| |
integer2Int# isn't sign preserving any longer, but modulo maxBound
|
|
|
|
| |
Remove declaration of PrelBase_Bool_closure_tbl.
|
|
|
|
| |
dataToTag# support.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improvements to the threading model.
- asynchronous exceptions supported.
- killThread# can now raise an exception in the specified
thread. It's new type is
killThread# :: ThreadId# -> Exception -> IO ()
High-level versions:
killThread :: ThreadId -> IO ()
raiseInThread :: ThreadId -> Exception -> IO ()
(killThread raises a 'ThreadKilled' exception in the
specified thread).
If the thread has no exception handler, it is killed
as before. Otherwise, the exception is passed to
the innermost CATCH_FRAME and the thread is woken up
if it was blocked. The current computation is
suspended, instead of being replaced by the exception
(as is the case with throw).
Sending an exception to the current thread works too.
- new primitive: myThreadId# :: IO ThreadId# and corresponding
high-level version myThreadId :: IO ThreadId.
- new primitive: yield# :: IO (), and yield :: IO ().
- the TSO now contains a pointer to the resource currently blocked
on (MVAR or BLACKHOLE_BQ).
- Add a giant comment to TSO.h about what the various link fields
are supposed to do, and invariants etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support for unsafely thawing your (Byte)Arrays, i.e., added the
following ops:
MutableArray.unsafeThawArray :: Ix ix => Array ix elt -> ST s (MutableArray s ix elt)
MutableArray.unsafeThawByteArray :: Ix ix => ByteArray ix -> ST s (MutableByteArray s ix)
MutableArray.thawByteArray :: Ix ix => ByteArray ix -> ST s (MutableByteArray s ix)
ST.unsafeThawSTArray :: Ix ix => Array ix elt -> ST s (STArray s ix elt)
LazyST.unsafeThawSTArray :: Ix ix => Array ix elt -> ST s (STArray s ix elt)
IOExts.unsafeFreezeIOArray :: Ix ix => IOArray ix elt -> IO (Array ix elt)
IOExts.unsafeThawIOArray :: Ix ix => Array ix elt -> IO (IOArray ix elt)
+ removed the re-exportation of Monad that ST and LazyST did.
|
|
|
|
|
| |
- misc changes to support DLLs
- StgNat* --> StgWord*
|
|
|
|
| |
Missing { in mulIntCzh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add two new operations to StgPrimFloat.c:
__int_encodeFloat
__int_encodeDouble
for encoding floats/doubles from small integers. This avoids having
to convert small integers to large ones before an encodeFloat
operation, and fixes the two cases of slowdown in nofib after the
small integer changes.
Also:
- remove encodeFloat and decodeFloat as primops
- use foreign import for encode{Float,Double} and
the various isNaN etc. ccalls in PrelNumExtra.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fast Integers. The rep. of Integers is now
data Integer = S# Int#
| J# Int# ByteArray#
- several new primops added for overflow-detecting arithmetic
- negateInteger# removed; it can be done directly
- integer_0, integer_1 etc. removed.
- the compiler now uses S# where it previously used int2Integer.
- the compiler generates small integers for -2^32 .. 2^32-1, instead
of -2^29 .. -2^29-1.
- PrelST.State datatype moved to LazyST (its only use).
- some library code (in Time.lhs) still needs cleaning up, it depends
on the Integer rep.
|
|
|
|
| |
More finalise/finalize updates.
|
|
|
|
|
|
|
| |
- s/finalise/finalize/g
- make finalize run the finalizer immediately, and wait for its completion
- make mkWeak take a (Maybe (IO ())) for the finalizer argument
- remove mkWeakNoFinalizer
|
|
|
|
| |
Copyright police.
|
|
|
|
| |
Remove MUT_ARR_WORDS. I'm not sure why we had it in the first place.
|
|
|
|
| |
Remove warnings in deRefWeakzh.
|
|
|
|
|
|
| |
- Add finalise#
- Add mkWeakNoFinaliser
- Move deRefWeak# from an out-of-line primop to an inline one.
|
|
|
|
| |
zh --> Zh (for genSymZh and resetGenSymZh)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Finally! This commits the ongoing saga of Simon's hygiene sweep
FUNCTIONALITY
~~~~~~~~~~~~~
a) The 'unused variable' warnings from the renamer work.
b) Better error messages here and there, esp type checker
c) Fixities for Haskell 98 (maybe I'd done that before)
d) Lazy reporting of name clashes for Haskell 98 (ditto)
HYGIENE
~~~~~~~
a) type OccName has its own module. OccNames are represented
by a single FastString, not three as in the last round. This
string is held in Z-encoded form; a decoding function decodes
for printing in user error messages. There's a nice tight
encoding for (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)
b) type Module is a proper ADT, in module OccName
c) type RdrName is a proper ADT, in its own module
d) type Name has a new, somwhat tidier, representation
e) much grunting in the renamer to get Provenances right.
This makes error messages look better (no spurious qualifiers)
|
|
|
|
|
|
|
|
| |
- Add Stable Names
- Stable pointers and stable names are now both provided by the
"Stable" module in ghc/lib/exts. Documentation is updated, and Foriegn
still exports the stable pointer operations for backwards compatibility.
|
|
|
|
| |
integerToInt64Zh: didn't handle negative integers particularly well
|