Skip to content
Snippets Groups Projects
Commit ca2ab438 authored by Simon Marlow's avatar Simon Marlow
Browse files

[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.
parent 11a43a34
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment