RFR: 8350118: Simplify the layout access VarHandle [v2]

Chen Liang liach at openjdk.org
Thu Feb 27 13:27:00 UTC 2025


On Thu, 27 Feb 2025 10:26:29 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> This emulates how MethodHandleImpl does the cache.
>
> Ok. I think the benefit is that each element is individually lazy initialized. I'm not sure about the setup with the array though. It seems like having 3 stable fields would be simpler?
> 
> Or maybe just initialize them up front in clinit, since they are mostly used together. That would also avoid the need to create a `Lookup` every time, which might help performance since that method is CallerSenstive, so we need to do a stack walk to get the caller when running in the interpreter.

Well, the reason I removed the eager init is that their creation in clinit is super costly. Also I think one pair of getter + creator is better than 3 pairs.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23720#discussion_r1973576054


More information about the build-dev mailing list