RFR: 8267321: Use switch expression for VarHandle$AccessMode lookup

Jorn Vernee jvernee at openjdk.java.net
Wed May 19 14:35:04 UTC 2021


On Tue, 18 May 2021 20:59:49 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Using a switch expression instead of a (read-only) static `HashMap` reduces initialization overhead of `VarHandle$AccessMode`. This gets loaded earlier after JDK-8265079, so it started showing up in a few lambda startup tests.
> 
> This also obsoletes a jtreg test that only verified that this map was optimally sized.

LGTM. I assume existing tests verify that all values of the enum are covered by the switch?

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

Marked as reviewed by jvernee (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4102


More information about the core-libs-dev mailing list