parrot/parrot — pull request #194 by mlschroe (2011-11-07 14:19:42+00:00)
Title: Mls/kill events in ehqueue

This branch cleans up exception handling in parrot. It contains the following changes:
- remove the "event" distinction for local handlers. Nobody used them, they made the code ugly, slow and buggy. For example, pop_eh would just null out the handler and not shrink the handler array.
- remove iterator PMCs when iterating through handlers. The iterator was also stored in the exception so that rethrow continues at the last handler. We now store the number of handlers left to check instead, which is also more reliable.
- a couple of optimizations so that direct attribute access is used when the base_type matches
- support init_pmc for ExceptionHandlers, a Key can be used to define the set of exception types. This saves the creation of one RPA PMC in most cases. PCT now uses this mechanism.
- move all control exceptions into their own block, support EXCEPTION_ALL and CONTROL_ALL to catch any exception/control exception. To make this useful, parrot no longer uses CONTROL_ERROR in the die op, instead EXCEPTION_DIE is used.
- add a new op "pop_upto_eh " that pops all handlers until the specified handler is reached. Without this op, it is impossible to remove correct amount of handlers when an exception is caught, as the code may have added new handlers. PCT now uses this op for "try" and the block handlers.
- changed PCT to automatically finalize exceptions at the end of a try/block handler.