exceptions and integrating intrp/jit

Alexandre Oliva oliva at dcc.unicamp.br
Sat Sep 26 03:30:20 PDT 1998


Senthil Kumar <skumars at earthlink.net> writes:

> Alexandre Oliva wrote:

>> 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.

> I am sorry, but I just do not understand what you are trying to say.

Ok, let me try again.  Kaffe already has the logic to compute whether
a given PC belongs to a native method or not.  I'm just suggesting
that you extend this test so that, if the PC corresponds to code
within function virtualMachine, from intrp/machine.c, you get
exception information from the jmp_buf.

> Also thanks for mentioning the exception prolouge.

Actually, I was not talking about the exception prologue, just the
function prologue.  It starts with `pushl ebp', which saves the
pointer to the previous stack frame onto the stack.

> debug(("movl ebp,esp\n"));
> debug(("subl #?,esp\n"));  /* Reserve size for exceptionFrame ?? */
> debug(("subl #3*SLOTSIZE,esp\n"));

> What exactly is going on?? :-)

I don't have the faintest idea :-)

> Both do jumps, the intrp, of course
> uses longjmp which is ineffecient, and the JIT does an ASM jmp
> to the handler.

The main problem is not the inefficiency of longjmp: setjmp introduces
a needless but unavoidable overhead.

-- 
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