JDK-8267321 : Use switch expression for VarHandle$AccessMode lookup
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-05-18
  • Updated: 2021-05-27
  • Resolved: 2021-05-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b24Fixed
Related Reports
Relates :  
Description
JDK-8265079 changed jli.Invokers to pull in VarHandle$AccessMode on initialization, which then shows up as a small regression on a few startup tests due how AccessMode builds up a small HashMap on class initialization.

This map is read-only and could be converted to a switch expression. Doing so we marginally reduce the startup cost of initializing MHs/VHs and eliminate most of the regression from JDK-8265079
Comments
Changeset: 9760dba7 Author: Claes Redestad <redestad@openjdk.org> Date: 2021-05-19 15:23:44 +0000 URL: https://git.openjdk.java.net/jdk/commit/9760dba71c07cf7b0df16590b3e84e23ad587621
19-05-2021