ShenandoahOptimizeFinals is an illegal optimization

Roland Westrelin rwestrel at redhat.com
Wed Oct 18 13:14:34 UTC 2017


> Tough call. Seems like the same thing as with TrustFinalNonStaticFields -- probably we want to
> condition ShenandoahOptimizeFinals on TrustFinalNonStaticFields? And, can we at trust @Stable fields
> with this optimization?

I don't think this is the same as TrustFinalNonStaticFields. AFAIU,
TrustFinalNonStaticFields exists because some fields are declared final
but not final in practice (a field that can be updated once we have
returned from the constructor by reflection or unsafe). The final fields
involved here are really final.

Roland.


More information about the shenandoah-dev mailing list