RFR: 8350118: Simplify the layout access VarHandle [v2]
Chen Liang
liach at openjdk.org
Mon Feb 24 17:57:05 UTC 2025
On Fri, 21 Feb 2025 18:37:47 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Now this will require code update to static import `offset` from `VarHandleSegmentViewBase`. Is that acceptable?
>
> Maybe let's leave it, at least in this round
Done in latest update.
>> This is a one-time cold path initializer so I did not care too much about its size. How should I break it up?
>
> I mean - using a single expression which is a conditional with two big switches seems quite unreadable.I suggest to move the `VH_FILTERS[index] = ` assignment out of the `computeFilterHandle` method. Then, rewrite `computeFilterHandle` as:
>
>
> if (addressSize != 4) {
> return switch ...
> } else {
> return switch ...
> }
Done in latest update.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23720#discussion_r1968136129
PR Review Comment: https://git.openjdk.org/jdk/pull/23720#discussion_r1968134480
More information about the build-dev
mailing list