RFR (S) CR 8014964: @Contended breaks has_nonstatic_fields invariant

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue May 21 08:15:29 PDT 2013


Thanks for the review!

Updated webrev is here:
  http://cr.openjdk.java.net/~shade/8014964/webrev.02/

On 05/21/2013 06:56 PM, Vladimir Kozlov wrote:
> In assert you don't need to test nonstatic_field_size > 0 because you
> tested it for 0 already so other tests will be executed only when it is
> != 0.

Short-circuiting... fair enough. Fixed.

> I don't understand why you don't check has_nonstatic_fields when
> parsed_annotations->is_contended(). With the fix has_nonstatic_fields
> also includes contended fields so it does not matter if you have
> annotation or not.

It does matter: for @Contended class without fields, we actually have
nonstatic_field_size > 0 (because it includes padding), but still no
fields. R3 class in regression test will fail the assert otherwise. I
added the comment about this before the assert. I'll keep in mind during
the cleanup whether something can be done to make @Contended class case
assertable as well.

(In grand scheme of things, we might allow @Contended to skip generating
the padding if no fields are present, but this is messy to do with
current one-pass code).

-Aleksey.


More information about the hotspot-dev mailing list