News for hackers. Stuff that matters.
Re:Implementing a Virtual Machine in C by simias on Tuesday June 23, 2015 @11:23AM (#9765230)
I don't know the specifics but from the linked thread at https://bugs.python.org/issue4753 :

Having a jump table in itself isn't special (the compiler does exactly that when compiling the switch() statement). What's special is that a dedicated indirect jump instruction at the end of each opcode helps the CPU make a separate prediction for which opcode follows the other one, which is not possible with a switch statement where the jump instruction is shared by all opcodes. I believe that's where most of the speedup comes from.

So I don't think you can conclude that the compiler "probably doesn't" generate the jump table, just that you might do a better job yourself if you know what you're doing.

There are no comments on this comment yet.