AOT code usage restrictions
Vladimir Kozlov
vladimir.kozlov at oracle.com
Fri Jan 23 02:04:52 UTC 2026
Hi,
I would like to get opinion from community regarding AOT code usage
restrictions for JEP https://openjdk.org/jeps/8335368.
For current AOT features in JDK 25 and 26 it is not the issue - CPU
features do not affect them.
CPU features affect generated AOT code - the instructions set is defined
by machine on which AOT training is done. But CPU instructions on
machine where AOT cache is used could be different.
Our current proposal is next:
1. The best startup and peak performance with AOT code could be achieved
when training and production runs use the same type of machines (same
CPU and OS).
2. AOT code will not be used if CPU features on machine for production
run does not match one used for training. Other AOT features (cached
classes and profiling info) will still be used.
3. In a future, when user requested during training run (with VM's
flag[s]), we will allow to use AOT code generated for old CPU
instructions (for example, AVX2) on machines with new instructions (for
example, AVX512) by restricting online (normal JIT) code generation to
old CPU instructions. This will allow to use the same cached AOT code on
variety of machines. But you may not get the best peak performance on
newer machines.
What do you think about this proposal?
Thanks,
Vladimir K
More information about the leyden-dev
mailing list