Daniel Grunblatt wrote:
On Thursday 14 November 2002 05:14, Leopold Toetsch wrote:
What JIT needs to know is the location of the resume opcode, to mark it as a jump target properly, so that processor registers can be setup correctly.
Well, any opcode could be a target, so I suggest to build something like a section entrance code that given the PC could load the apropiate registers and jump to the middle of a jitted section. Yes, it will be slow but we are talking about exceptions here.
There must be some code, that installs the exception handler. This code has the address of the exception handler, which JIT has to know too.
Being prepared to enter at arbitrary places in JIT would inhibit processor register usage totally, or wouldn't be any win.
So we IMHO need to mark each OP with a flag, if it might throw an exception and restore all processor registers to parrot registers before doing this OP.
Since there isn't any jitted opcode throwing an exception ...
div by zero, modulo (div currently only PPC but...)
(and all registers are saved back to parrot register before calling C code),
.... which I want to avoid for callee saved registers ...
and if there were any opcode jitted throwing an exception it must save the registers back before doing so.
So, it would be useful to know, which op code might throw an exception.
Daniel Grunblatt.
leo