To be able to switch function tables, this then should become:
PC = ((op_func_t*) (func_table + *PC)) (PC, INTERP);
Or is there a better way to do it?
Replacing the next instruction with a branch to the signal handler
(like adding a breakpoint) out of the question?
I don't know, how to get the address of the next instruction i.e. the "PC" above. Going this way would either mean:
- fill the bytecode segment with the handler opcode function or
- locate the PC on the stack or in registers (like %esi in CGP)
The former seems rather expensive (at least if we heavily use events), the latter seems to be possible only per platform/compiler(-revision).
...Of course, if we're sharing bytecode this is expensive, since you'd have to do something like this:
The prederefed code can't be shared betwean threads: Registers are already absolute locations in the interpreter.
/s
leo