RFR (XS): 8011972: Field can be erroneously marked as contended when @Contended annotation isn't present
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Apr 11 08:29:15 PDT 2013
VladimirI,
May be you should remove set_contended() method since I don't see other
usage after you removed those lines.
Thanks,
VladimirK
On 4/11/13 2:52 AM, Vladimir Ivanov wrote:
> http://cr.openjdk.java.net/~vlivanov/8011972/webrev.00
> 4 lines changed: 0 ins; 3 del; 1 mod
>
> If a field is marked with some annotation recognized by VM (but not
> @Contended), the field will be marked as contended anyway. It's because
> AnnotationCollector::set_contended(bool contended) ignores the parameter
> and always marks a field as contended.
>
> Moreover, calls to AnnotationCollector::set_contended in
> ClassFileParser::parse_annotations are redundant, because there's
> already a call right before:
> src/share/vm/classfile/classFileParser.cpp:
> 1714 coll->set_annotation(id);
>
> The problem hasn't manifested itself before, because @Contended is the
> only annotation on fields [1] VM recognizes. I hit it when working on a
> new annotation on fields for VM.
>
> Testing: manual (w/ additional annotation on fields),
> runtime/8003985/Test8003985.java
>
> Best regards,
> Vladimir Ivanov
>
> [1]
> http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/file/tip/src/share/vm/classfile/classFileParser.cpp
>
> ClassFileParser::AnnotationCollector::annotation_index
More information about the hotspot-runtime-dev
mailing list