Our software is still supporting clients with JVM 8 deployments, and so we are still compiling with Java 8. I am trying to find out if the Segmented Code Cache JEP197 introduced in Java 9 works on older compilations - or requires the source code to also be compiled on Java 9+.
A lot of online sources describe how great it is, but I could not find a clear defalcation whether Java 8 code can capitalize on this capability.
Does Segmented Code Cache work on Java 8 compiled code?
Disclaimer: I have neither real life experience for my answer nor have I tested it. It is just my assumption after reading further into the matter of Segmented Code Cache.
My conclusion: Segmented Code Caches should be used if you run a jdk8 compiled application in jre9 and jre10. But i don't know if it delivers the promised performance improvements, since I don't know if jdk9 adds hints for the jit compiler in the bytecode.
What leads me to my conclusion is the fact that the Code Cache itself is used as storage of the compiled native code. Therefore it is an integral part of the jre as is stated here:
Source: https://docs.oracle.com/en/java/javase/11/vm/java-hotspot-virtual-machine-performance-enhancements.html
Since the nature of the answer is rather vague I strongly advise anyone from taking it as truth. Instead i see two options: