[project @ 2000-01-30 10:25:27 by simonmar]
authorsimonmar <unknown>
Sun, 30 Jan 2000 10:25:29 +0000 (10:25 +0000)
committersimonmar <unknown>
Sun, 30 Jan 2000 10:25:29 +0000 (10:25 +0000)
commitca2ab438fbdbc163db46592879146df96dd03cd9
treeec7514310619ca34ab27567b1d0efe7a23c0e4e9
parent11a43a34e5c19a18a4aab24ea343ef77d9b4a000
[project @ 2000-01-30 10:25:27 by simonmar]
Change the type of catch# to

catch# :: (W# -> (# W#, a #))
       -> (b -> W# -> (# W#, a #))
       -> W# -> (# W# , a #)

where W# == State# RealWorld.  In other words, make it explicit that
catch# is an IO operation and takes IO operations as arguments.  The
previous type was too general, and resulted in catch# having the wrong
arity which could cause mis-optimisations.

The down side is that we now have to pass the state token around
inside the primop instead of doing it in the Haskell wrapper, and
raiseAsync() also has to build a PAP(handler,exception,realworld)
instead of just a PAP(handler,exception) when it invokes a handler as
a result of an async exception.

I also added some optimisations to (un)?blockAsyncException to not
grow the stack if it can be avoided, such as when we're about to block
async exceptions and there's a blockAsyncExceptions_ret stack frame on
the top of the stack.
ghc/compiler/prelude/PrimOp.lhs
ghc/lib/std/PrelException.lhs
ghc/rts/Exception.hc
ghc/rts/Schedule.c
ghc/rts/StgMiscClosures.hc