RFR: 8333791: Fix memory barriers for @Stable fields

Chen Liang liach at openjdk.org
Tue Jul 16 03:07:58 UTC 2024


On Mon, 15 Jul 2024 23:29:37 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> IIUC this means we can remove the explicit fence here

`ConstantCallSite` is non-sealed, and we probably wish to read `isFrozen == true` when we can read anything initialized by the subclasses, especially if a malicious subclass leaks itself into some multithreaded environment before quitting the constructor.

That said, I think we can change this to a StoreStore or Release:
https://github.com/openjdk/jdk/blob/8feabc849ba2f617c8c6dbb2ec5074297beb6437/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java#L277

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

PR Comment: https://git.openjdk.org/jdk/pull/19635#issuecomment-2229913291


More information about the hotspot-dev mailing list