exceptions and integrating intrp/jit

Alexandre Oliva oliva at dcc.unicamp.br
Sat Sep 26 02:09:28 PDT 1998


Senthil Kumar <skumars at earthlink.net> writes:

> The exception handling in intrp mode is simple.
> Implemented using setjmp/longjmp.

Yep, but this is too inefficient to use in JIT.

> However this does not seem to happen in the case of JIT?? What is
> the mechanism by which we walk up the exception frame?

> nextframe = current->retbp (So retbp hold the previous frame)
> But where is it set??

The frames are set by the native code itself, in the prologue.

> In fact, I am not even clear about how we get to the frame
> in the first place.

> frame = *((exceptionFrame*)(((uintp) &eobj) - 8));

> where eobj is the object passed to the throwException function.

Look for `buildStackTrace' in stacktrace.c.  It's (indirectly) called
by the constructor of Throwable.

> I merged the two structs into one, and I thought that
> the simplest way would be to make the JIT also register
> its exceptionFrame with the current thread and have similar
> semantics as we have with the intrp, i.e. have a prev pointer
> which points to the previous frame.

This would be too inefficient; the current implementation does not
introduce any overhead when no exception is thrown; it would be a pity
to lose this.  How about the following strategy?  You go unwinding the
stack, collecting exception information with the JIT mechanism if the
method is JIT compiled, or from the jmpbuf linked list if the PC
corresponds to code from the interpreter's virtualMachine.  I believe
this would work.

-- 
Alexandre Oliva
mailto:oliva at dcc.unicamp.br mailto:aoliva at acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



More information about the kaffe mailing list