[8u20] [9] RFR (S): 8043546: C1 optimizes @Stable instance fields with default values

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Jul 10 01:15:57 UTC 2014


Seems fine.

Vladimir K

On 7/9/14 11:47 AM, Vladimir Ivanov wrote:
> http://cr.openjdk.java.net/~vlivanov/8043546/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8043546
> (not public because contains internal links)
>
> C1 doesn't respect @Stable contract and constant folds loads from stable instance fields w/ default values. The fix is
> to add missing check.
>
> C1 already optimizes stable static fields and after this change it also optimizes stable instance fields. C1 doesn't
> support stable array, so tests are changed to distiguish 3 outcomes: no @Stable support, C1 & C2. I'll try to extend C1
> support to arrays in the future.
>
> The fix is very focused, since it's targeted for 8u20. I want to refactor the code for 9 & 8u40 and separate
> is_constant() and is_stable() properties for instance fields. Current implementation is error-prone, since it requires
> every place where is_constant() for instance field is used to have a check for stable. It's safer to miss optimization
> opportunity rather than doing wrong optimization.
>
> Improved unit tests to test C1 as well. Also, removed dependency on JMX.
>
> Testing: regression tests
>
> Thanks!
>
> Best regards,
> Vladimir Ivanov


More information about the hotspot-compiler-dev mailing list