RFR: 8300148: Consider using a StoreStore barrier instead of Release barrier on ctor exit [v9]

Joshua Cao duke at openjdk.org
Mon Apr 8 16:36:11 UTC 2024


On Fri, 5 Apr 2024 23:48:52 GMT, Chen Liang <liach at openjdk.org> wrote:

> On a side note, would it be safe to replace explicit constructor emulation release barriers (Unsafe.storeFence) elsewhere in the JDK with storeStore, like in ClassValue, MutableCallSite, ClassSpecializer.Factory, ObjectInputStream, and Properties?

I don't think its safe in general. Maybe for some of the use cases it would be desirable. `Unsafe.storeFence` is marked for removal anyway. Consumers can use `VarHandle.storeStoreFence` if it fits.

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

PR Comment: https://git.openjdk.org/jdk/pull/18505#issuecomment-2043192772


More information about the hotspot-compiler-dev mailing list