JEPs proposed to target JDK 9 (2016/10/19)

Vladimir Kozlov vladimir.kozlov at
Wed Oct 19 22:51:18 UTC 2016

On 10/19/16 3:31 PM, Vitaly Davidovich wrote:
> On Wednesday, October 19, 2016, John Rose <john.r.rose at
> <mailto:john.r.rose at>> wrote:
>     On Oct 19, 2016, at 3:11 PM, Vitaly Davidovich <vitalyd at
>     <javascript:_e(%7B%7D,'cvml','vitalyd at');>> wrote:
>>     I think David must be talking about stripping the binary to just
>>     the set of methods known to be used - think of internal linkage,
>>     like static functions in C which may just get inlined and aren't
>>     present in the binary.  So in Java AOT, closest parallel would be
>>     a private method but of course that's callable at runtime, so I
>>     don't see how AOT can just omit it entirely.
>     AOT supports deoptimization and re-JIT-ing, so it would be easy to
>     omit methods from AOT output, and just use interpreter or JIT to
>     handle the execution.
> This would have to be opt-in, I'd imagine, as otherwise it would defeat
> the purpose of AOT.  Or it would have to very limited where it does this.

re-JIT-ing (generating profiling code in AOT methods) is triggered by 
--compile-for-tiered flag. By default is off.
But AOT code is following the same deoptimization rules as normal JITed 
code. For example, class unloading or redefinition.

> Separately, what optimizations (if any) will be done in AOT? Clearly
> there's no profiling info, which is where the big gains typically come
> from, but will anything be done? For example, are loops optimized
> (unrolled, unswitched, etc)? Are statically known (at AOT time) callees
> inlined? Or is it basically C1 level of optimization (i.e. very minimal)?

Currently it is C1 level only or even less - based on CHA without 
profiling information. We may add profiling information feedback in a 
No C2 type loop optimizations - Graal-core does some but not all.
Also in tiered mode AOT code contains profiling code similar to Tiered 
level 3 in current Tiered compilation.
AOT code is immutable - have to do indirect klass loads and calls.
Also klass loading in AOT code is lazy - it has dynamic checks for class 

In short - do not expect good peak performance from current AOT code. 
That is why we added --compile-for-tiered to re-JIT to get peak performance.

We bet on compiled static initializers and skipping Interpreter for 
startup improvement.


>     AOT could do stuff like tree shaking (static call graph
>     minimization) or enforcement of strong encapsulation, but it doesn't
>     yet.  It's early days for this technology.
>     — John
> --
> Sent from my phone

More information about the jdk9-dev mailing list