RFR (XS) CR 8014509: @Contended: explicit default value behaves differently from the implicit value

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed May 15 09:50:53 PDT 2013


On 5/15/13 9:38 AM, Aleksey Shipilev wrote:
> Thanks!
>
> On 05/15/2013 08:34 PM, Vladimir Kozlov wrote:
>> Why you need to test 2 fields but not class annotation?
>
> The tags are only meaningful on fields, tags are inducing the
> equivalence class over the fields. The tags are plainly ignored on
> class-level @Contended.

This should be documented (in comments).

>
>> It would be nice to have a comment in parse_annotations() explaining
>> what formats of Contended are expected.
>
> I think I really, really need to push the proper Javadoc to @Contended,
> and not push the explanation about this to VM code.

Comments in VM are big help to us, Hotspot developers.
Pointing to external documents is not helpful.

Vladimir

>
>> And the code could be rearranged to simplify it a little:
>>
>>       if (id == AnnotationCollector::_sun_misc_Contended) {
>>         u2 group_index = 0; // default contended group
>>         if (count == 1
>>             && s_size == (index - index0)  // match size
>>             && s_tag_val == *(abase + tag_off)
>>             && member == vmSymbols::value_name()) {
>>           u2 group_index = Bytes::get_Java_u2(abase + s_con_off);
>>           if (_cp->symbol_at(group_index)->utf8_length() == 0) {
>>             group_index = 0; // empty tag => default contended group
>>           }
>>         }
>>         coll->set_contended_group(group_index);
>>       }
>
> Good, I'll fix this and re-spin JPRT.
>
> -Aleksey.
>


More information about the hotspot-dev mailing list