James Mastros wrote:
On 01/12/2003 4:41 AM, Leopold Toetsch wrote:There might be additional problems with glibc, but the deviations in JIT code timings are only caused by moving the loop by on byte (crossing a 8 byte boundary).Do we have enough metadata at JIT-time to pad locations that get jmp'd to to an 8-byte boundry in memory?
Yep, there is already the code there to do alignment of jump targets. For some reason I thought it didn't help.
I did turn it on again and made another per $arch config JUMP_ALIGN which, in combination with jit_emit_noop() aligns a jump target to a 1<<JUMP_ALIGN aligned location.
- and yes, it seems to work ;-)
BTW, I legitimatly don't know. I have a sinking suspicition that the only way to know if somthing is a jump target is to scan through the entire bytecode and check if it gets used as one.
Similar, branch instructions are flagged in the ops file the offset is in the byte code. So we calculate the branch target, which is also needed for emitting register load code.
... (For that matter, you can jump to the value of an Ix reg, which makes even that infesable, no?)
That's right, but these are rare - do we have such a test?
Thanks for the hint. I can't imagine, why it didn't work, when I first introduced this.-=- James Mastros
leo