tableswitch does not use an array of offsets

Yann Le Tallec ylt at letallec.org
Wed Mar 27 09:51:57 PDT 2013


I should have mentioned that my question is due to this other discussion:
http://stackoverflow.com/questions/15621083/why-does-java-switch-on-ordinal-ints-appear-to-run-faster-with-added-cases

On 27 March 2013 08:56, Yann Le Tallec <ylt at letallec.org> wrote:

> The code below is compiled as a tableswitch bytecode instruction as one
> would expect because the case values are contiguous. However, the JIT
> (Hotspot using JDK/JRE 1.7u17 64 bit on x86/Windows in either -server or
> -client mode) compiles it into a succession of cmp/je/jg.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20130327/0de49273/attachment-0001.html 


More information about the hotspot-compiler-dev mailing list