RFR (XS): 8087218: Constant fold loads from final instance fields in VM anonymous classes
vladimir.kozlov at oracle.com
Mon Jun 15 16:03:07 UTC 2015
On 6/15/15 6:15 AM, Vladimir Ivanov wrote:
> Right now, VM doesn't constant fold loads final instance fields unless an experimental flag
> -XX:+TrustFinalNonStaticFields is turned on.
> The only exception is classes in java.lang.invoke/sun.invoke packages.
> It can be extended to VM anonymous classes because there is no hacking of finals going on with them:
> (1) they are part of private API (sun.misc.Unsafe);
> (2) they can't be serialized.
> Testing: manual (verified in generated code that constant folding happens)
> Best regards,
> Vladimir Ivanov
More information about the hotspot-compiler-dev