How about encoding a return like this:
push static_dangerous_jump_stub jmp F_RETURN
static_dangerous_jump_stub: jmp *%eax
That way you will only need one stub for all of the return opcodes.
Although, if you still use the PROG_COUNTER() macro for relative jumping, that wouldn't work very well...
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-08-08 00:36: Subject: Machine code efficiency
Simple in principle, but it's not fun to have stubs for the whole plethora of return opcodes. :P
I'm thinking of adding an argument to destruct_objects_to_destruct so that the current object can be excluded. Maybe we can live with that it's freed a bit later instead. It's afterall not often that it's freed directly on function return anyway.
/ Martin Stjernholm, Roxen IS