#71 Jump sizes

brian Sat 27 May 2006

So far I've been making jump's 2 byte absolute offsets into fcode. Do you think we should stick this approach? Should we switch to 4 byte offsets? Relative offsets? The absolute offsets are a bit easier to remap to native bytecode offsets. Although now that I'm doing the switch statement I'm wondering if I should stick with 2 byte limits on it. Both Java and .NET use 4 bytes but this probably has more to do with using the bytecode in memory as the direct jump table with 32-bit processors (Java even goes as far to force the compiler to align the jump table on a 4-byte boundary). Of course you can work all the way back to the fact I size method fcode with just 2 bytes - so a method is limited to an unsigned short in size.

Login or Signup to reply.