TrustFinalNonStaticFields clarification

John Rose john.r.rose at
Fri Apr 24 03:03:19 UTC 2015

On Apr 23, 2015, at 6:51 PM, Vitaly Davidovich <vitalyd at> wrote:
> if this field is final and set inside constructor only, why still have the null check if I'm asking to trust instance final fields?

The answer to all of your questions is that we don't profile fields.

We also don't do class-wide analysis, since reflection can break the results of such analysis.

The JIT only trusts field values that it can observe directly, either by compiling the sets in the same compilation unit, or by folding a constant object reference.

— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the hotspot-compiler-dev mailing list