RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

Jorn Vernee jvernee at openjdk.java.net
Tue May 17 12:01:44 UTC 2022


On Tue, 17 May 2022 05:51:58 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   BootstrapMethodError -> ExceptionInInitializerError
>
> src/java.base/share/classes/jdk/internal/foreign/abi/SoftReferenceCache.java line 42:
> 
>> 40: 
>> 41:     private class Node {
>> 42:         private SoftReference<V> ref;
> 
> this code looks like a double check locking so ref should be volatile

Thanks. I thought the `moniterenter` & `monitorexit` were enough here for visibility. I've read up on this and it looks like `volatile` is needed to correctly order the constructor and apply call (and contents) before the write to the `ref` field.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8685


More information about the core-libs-dev mailing list