On Fri, 31 May 2024 16:26:50 GMT, Per Minborg wrote:
> Would it make sense to add some tests that assert, `VarHandle` objects get
> cached?
We can't - at least not easily. As explained in the new comment, the var
handles cached by this method are "raw" and always adapted by some other API.
So
> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`. The
> cache was moved to `ValueLayouts::varHandle` as part of
> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
> want to optimize the common case like:
>
>
> ValueLayout layout = ...
> layou
On Fri, 31 May 2024 16:18:33 GMT, Maurizio Cimadamore
wrote:
>> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`.
>> The cache was moved to `ValueLayouts::varHandle` as part of
>> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
>> want to opt
On Fri, 31 May 2024 16:18:33 GMT, Maurizio Cimadamore
wrote:
>> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`.
>> The cache was moved to `ValueLayouts::varHandle` as part of
>> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
>> want to opt
> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`. The
> cache was moved to `ValueLayouts::varHandle` as part of
> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
> want to optimize the common case like:
>
>
> ValueLayout layout = ...
> layou
On Fri, 31 May 2024 16:15:12 GMT, Maurizio Cimadamore
wrote:
>> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`.
>> The cache was moved to `ValueLayouts::varHandle` as part of
>> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
>> want to opt
On Thu, 30 May 2024 17:04:44 GMT, Jorn Vernee wrote:
> I suggest leaving a comment to document which cases this cache is trying to
> address. I think that's mainly cases where the same ValueLayout is created
> many times in different places (instead of the same layout being reused, for
> which
On Thu, 30 May 2024 16:15:22 GMT, Maurizio Cimadamore
wrote:
> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`. The
> cache was moved to `ValueLayouts::varHandle` as part of
> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
> want to optimiz
On Thu, 30 May 2024 16:15:22 GMT, Maurizio Cimadamore
wrote:
> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`. The
> cache was moved to `ValueLayouts::varHandle` as part of
> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we
> want to optimiz