No, compiler cannot rewrite your bytecode into a threaded code.
> Otherwise you're just making your code harder to maintain and less portable for zero gain.
No. Threaded code is almost always faster, even if run only once.
> a proper jump table
I'm not talking about jump tables. I'm talking about replacing the bytecode indices with jump addresses once (yes, with a precalculated table) and then doing an indirect jump for each translated opcode from the input stream.
An example: https://github.com/ocaml/ocaml/blob/trunk/byterun/interp.c
(see the Next macro definition)