RFR: 8227083: ZGC: C2: Generates on_weak barrier for WeakCompareAndSwap

Stefan Karlsson stefan.karlsson at oracle.com
Wed Jul 3 08:07:17 UTC 2019


Thanks, Erik.

StefanK

On 2019-07-02 17:33, Erik Österlund wrote:
> Hi Stefan,
>
> Looks good.
>
> Thanks,
> /Erik
>
> On 2019-07-02 14:52, Stefan Karlsson wrote:
>> Hi all,
>>
>> Please review this patch to fix so that we generate an on_strong load 
>> barrier for WeakCompareAndSwap.
>>
>> http://cr.openjdk.java.net/~stefank/8227083/webrev.01/
>> https://bugs.openjdk.java.net/browse/JDK-8227083
>>
>> ErikÖ spotted this problem when we were looking into the bug for 
>> JDK-8225770, where C2 also generated the wrong kind of barrier.
>>
>> In this bug there was a mix-up of terms, the weak nature of 
>> WeakCompareAndSwap is unrelated to the on_weak property of some load 
>> barriers. The barrier in this code path should be using the normal, 
>> on_strong, load barries.
>>
>> The verification code in JDK-8227085 did catch this bug, as expected, 
>> and with the fix for this bug we don't fail in the verification code 
>> anymore.
>>
>> Tested with tier 1-7.
>>
>> Thanks,
>> StefanK
>



More information about the hotspot-compiler-dev mailing list