Does JVM has its runtime branch prediction? If so, is there a way in Java code to hint branch results?

Unless there's some new annotation that's escaped me, no.

On the other hand, it's not clear how terribly useful such a feature would be. Remember that, unlike a language such as C/C++, "prediction" at the level of the source code isn't necessarily the best strategy because What The Code Is Actually Doing In Practice as it is running isn't a mystery: the JVM can potentially monitor critical behaviour and if necessary re-compile sections of code in accordance with its measurements.

Tags:

Java

Jvm