Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mls/kill events in ehqueue #194

Merged
merged 17 commits into from Nov 16, 2011
Merged

Mls/kill events in ehqueue #194

merged 17 commits into from Nov 16, 2011

Conversation

mlschroe
Copy link
Contributor

@mlschroe mlschroe commented Nov 7, 2011

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.

Mixing event and exception handlers seems to be a bad idea, it
makes the code very complicated. Also, pop_eh did just zero
out the queue element instead of removing it.
Also, some code was added to make exception rethrow more robust
in case handlers were added/removed.
…dlers.

Instead of the iterator we store the number of handlers left in the Exception.
Also, a new experimental op was added, "pop_upto_eh". It pops all handlers
until it reaches the current handler of ther specified exception.
…the handled types.

Currently not optimized, we still build the RPA. Also change PCT to create the
exception handlers the new way if possible.
…stead of CONTROL_ERROR.

This also reverts commit 74ba753.
… pop_upto_eh op. Also finialize the exceptions at the end of the handlers.
@mlschroe
Copy link
Contributor Author

mlschroe commented Nov 9, 2011

(Rakudo needs a one-liner patch after this has been merged, cause they need to patch the exception iterator in "perl6_rethrow_skipnextctx".

@mlschroe mlschroe merged commit 3c927ac into master Nov 16, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants