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

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Jul 10 10:05:15 UTC 2014


VladimirK, John, thanks for review.

Fair enough. Updated version:
http://cr.openjdk.java.net/~vlivanov/8043546/webrev.01/

Also, I filed RFE [1] to refactor @Stable support for instance fields.

Best regards,
Vladimir Ivanov

[1] https://bugs.openjdk.java.net/browse/JDK-8049837

On 7/10/14 6:28 AM, John Rose wrote:
> On Jul 9, 2014, at 7:16 PM, John Rose <john.r.rose at oracle.com
> <mailto:john.r.rose at oracle.com>> wrote:
>
>>> 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 same "non default value" check is needed for getstatic as well as
>> getfield.  I don't see how the existing getstatic is already correct.
>>
>> — John
>
> Sorry; now I see it.  The required check, for statics, comes from the
> setting at the bottom of ciField::initialize_from.  The corresponding
> non-static case gets a cut-out near the top, before the default-check.
>   This is why the *.hpp file says:
>
>    // For non-static fields, the null/zero check must be
>    // arranged by the user, as constant_value().is_null_or_zero().
>
> I suppose an extra comment in c1_GB.cpp, near the processing of
> getstatic, might reassure forgetful and/or nervous readers.
>
> — John


More information about the hotspot-compiler-dev mailing list