Jason Gloudon wrote:

On Thu, Nov 14, 2002 at 04:28:00PM +0100, Leopold Toetsch wrote:


But I have a proposal:

- Normal runloops don't have a problem with longjmp

- JIT could have it's own low level exception handler:

What happens when C code called from the JIT generated code generates an
exception ?

I was thinking of something like this:

internal_exception(reason) {
if (JIT_run_loop) /* or better setup a call vector to the handler */
jit_exception(reason); /* pointing either here */
else
longjmp(..); /* or directly here */
}

jit_exception(reason) {
save_processor_regs_to_parrot();
longjmp(..);
}

jit_exception would need to know the current interpreter for jit_info, but this is not that problem, the exception handler needs this too, to find the resume code. And the interpreter* is on the stack, which is in the jmp_buf ...

But above is only needed, if there are callee saved registers around which hold parrot register values not already saved. So currently not, because there are no unsaved registers, when calling external code and jitted OPs currently don't throw exceptions.

leo

Reply via email to