3 ms·
Not only it is possible, it has been available for decades on commercial AOT compilers like Aonix, Excelsior JET, PTC, Aicas. It is also done on the cousin And
by pjmlp 2y ago
Not only it is possible, it has been available for decades on commercial AOT compilers like Aonix, Excelsior JET, PTC, Aicas.
It is also done on the cousin Android, and available as free beer on GraalVM and OpenJ9.
- hedora 2y agoThose all break compatibility to achieve that.
- pjmlp 2y agoNo they don't, PTC, Aicas, GraalVM and OpenJ9 support reflection. The others no longer matter, out of business.
- saagarjha 2y agoYou can't LTO code under the presence of reflection. You can AOT but there will always be a "cold path" where you have to interpret whatever is left.
- pjmlp 2y agoYet it works, thanks to additional metadata, either in dynamic compiler which effectly does it in memory, throwing away execution paths with traps to redo when required, and with PGO like metadata for AOT compilation. And since we are always wrong unless proven otherwise, https://www.graalvm.org/jdk21/reference-manual/native-image/dynamic-features/Reflection/ https://www.graalvm.org/jdk21/reference-manual/native-image/... https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/ https://www.graalvm.org/latest/reference-manual/native-image...
- saagarjha 2y agoYou do understand that the topic at hand is not shipping around all that code needed to support a trap, right?