[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.
Showing
- ghc/compiler/prelude/PrimOp.lhs 13 additions, 9 deletionsghc/compiler/prelude/PrimOp.lhs
- ghc/lib/std/PrelException.lhs 11 additions, 9 deletionsghc/lib/std/PrelException.lhs
- ghc/rts/Exception.hc 23 additions, 10 deletionsghc/rts/Exception.hc
- ghc/rts/Schedule.c 14 additions, 9 deletionsghc/rts/Schedule.c
- ghc/rts/StgMiscClosures.hc 2 additions, 2 deletionsghc/rts/StgMiscClosures.hc
Loading
Please register or sign in to comment