RFR: 8291065: Creating a VarHandle for a static field triggers class initialization [v5]

Mandy Chung mchung at openjdk.org
Fri Jun 2 19:14:04 UTC 2023


On Fri, 2 Jun 2023 16:29:13 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> I wonder if it is possible to transition from an lazy (indirect) VH to a direct VH once initialized i.e., `checkAccessModeThenIsDirect` returns the value of `initialized`. 

Sounds a good idea.  Once the class is initialized, the lazy VH becomes a direct VH that may help the performance.  In that case, the VarHandleGuards would need to ensure it links with the direct VH not the lazy VH.

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

PR Comment: https://git.openjdk.org/jdk/pull/13821#issuecomment-1574191781


More information about the core-libs-dev mailing list