On Thu, 27 Feb 2025 10:26:29 GMT, Jorn Vernee <jver...@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