RFR (M) #3 CR 8003985: Support @Contended annotation
Aleksey Shipilev
aleksey.shipilev at oracle.com
Wed Dec 12 07:08:25 PST 2012
Thanks John,
The updated version is here:
http://shipilev.net/pub/jdk/hotspot/contended/webrev-8/
Testing:
- built and tested on Linux x86_64
- Test8003985 passes on Linux x86_64
- JPRT is acting corky today, will try to submit a job later
Meanwhile, please take a look at the code.
Comments follow:
On 12/12/2012 03:21 AM, John Rose wrote:
> -XX:-EnableContended (true by default) turns off @Contended detection everywhere
> -XX:-RestrictContended (true by default) allows @Contended everywhere, assuming -XX:+EnableContended
> + if (!EnableContended || (RestrictContended && !privileged)) break;
Good, changed to EnableContended and RestrictContended.
> The field layout logic gives me heartburn; it always has.
I hear you. Done: JDK-8004930.
>> (sigh) Any pointers what should be done, and where the tests should be
>> placed?
>
> You'll need to adjust getFieldOffset in agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java, and adjust the constant names, and add at least some of your new constants for decoding. Start with this:
Aha. I had pushed some of the predefined constants down to SA. Since
only the field offset should be accessible to SA, I've gone no further
than checking the proper tag for offset in getFieldOffset() and decoding
the proper offset.
> Your unit test should be runnable with jtreg. I think you need something like this:
> * @run main/othervm -XX:-RestrictContended Test8003985
Aha, thanks! Turns out the test needed to throw exception on failure to
actually test anything, fixed now.
-Aleksey.
More information about the hotspot-dev
mailing list