Ticket #1635 (closed experimental: fixed)

Opened 10 years ago

Last modified 10 years ago

Runloop unrolling for exception handling

Reported by: NotFound Owned by: whiteknight
Priority: normal Milestone:
Component: core Version: 2.3.0
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform:

Description

The attached patch is a proof of concept implementation of a runloop unrolling for exception handling. The idea is that when a exception handler takes care and finishes the handling, it signals that decision and the control return to the runloop that established the handler, unrolling the C stack if needed.

The second attach is an example of use.

For simplicity, this implementation uses a method in the ExceptionHandler PMC. A specific opcode will simplify the usage.

It uses the ExceptionHandler object to identify the runloop, but the 'push_eh label' doesn't provide one. A variant '$P0 = push_eh label' is a possible solution.

Attachments

loopunroll.patch Download (2.0 KB) - added by NotFound 10 years ago.
loopunroll2.patch Download (6.5 KB) - added by NotFound 10 years ago.
handler.pir Download (0.6 KB) - added by NotFound 10 years ago.
loopunroll3.patch Download (6.9 KB) - added by NotFound 10 years ago.
unroll.pir Download (0.6 KB) - added by NotFound 10 years ago.

Change History

Changed 10 years ago by NotFound

Changed 10 years ago by NotFound

Changed 10 years ago by NotFound

Changed 10 years ago by NotFound

loopunroll2.patch is an improved version, with better handling of the runloops, and allowing to use the exception or the exception handler to control the rewind. As a side effect, it also clarifies the creation and destruction of runloops.

Updated the example handler.pir showing the new feature and with more comments.

Changed 10 years ago by NotFound

Changed 10 years ago by NotFound

Changed 10 years ago by NotFound

Third version: now uses a new opcode instead of methods. The opcode takes a PMC with the Exception or the ExceptionHandler and jumps to the next op after the urolling, no need to a label.

unroll.pir is the example for this version.

Changed 10 years ago by NotFound

  • status changed from new to assigned
  • owner set to NotFound
  • type changed from RFC to experimental
  • patch set to applied

Last version of the patch applied as r46696, unroll opcode marked as experimental in DEPRECATED.pod

Changed 10 years ago by NotFound

This is a post with he rationale and an example of use:  http://notfound.posterous.com/the-unroll-opcode

Changed 10 years ago by NotFound

After some discussion, renamed to 'finalize' in r47023

Changed 10 years ago by whiteknight

I brought this ticket up yesterday at #parrotsketch, and it was received with weak support. I'm going to try to put in a few more tests and raise the issue again in a few weeks.

Changed 10 years ago by coke

  • status changed from assigned to new
  • owner changed from NotFound to whiteknight

No longer experimental? 2 upvotes, no objections at:  http://irclog.perlgeek.de/parrotsketch/2010-11-23#i_3024695.

Note that #833 was just closed with a note that finalize is no longer experimental. If so, we can remove the note from DEPRECATED.pod and close this ticket.

Changed 10 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

As of 02de970 the finalize op is no longer experimental.

Note: See TracTickets for help on using tickets.