RFR: keep read barrier on final field access
Aleksey Shipilev
shade at redhat.com
Mon Oct 23 15:55:36 UTC 2017
On 10/23/2017 05:46 PM, Roland Westrelin wrote:
>> I am probably confusing myself here. String.coder is treated specially along with other String
>> fields via ciField::trust_static_non_final_fields. String.value is being explicitly casted in
>> GraphKit to stable array to give the array contents stable properties?
>
> @Stable
> private final byte[] value;
>
> private final byte coder;
>
> so String.value is stable. Not sure what the history is here. Is
> UseImplicitStableValues useless now?
Ah, I remember this one. "coder" is not @Stable, because its default value "0" is meaningful, but
would be ignored by @Stable (which would think it is still default-value). Therefore, we have
String.* fields are implicitly trusted, without @Stable. String.value is explicitly @Stable to trust
its contents, and we added that for Compact Strings. Probably UseImplicitStableValues is not
important for String.value now.
I wonder if that means we cannot figure out early in GraphKit if the field access would be "stable"
or not, for fields that are marked for trustness in ciField::trust_final_non_static_fields. I do
think we need to walk through all the different trustness levels, including @Stable, +TFNSF,
ciField:tfnsf, etc, and capture what they have in Shenandoah.
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list