RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

Chen Liang liach at openjdk.org
Tue Feb 25 21:53:10 UTC 2025


Remove the intrinsicData field. We can obtain this from the customized MH when we spin ultra-customized lambda forms. In the long run, we aim to remove this intrinsic if there is no regression for call site sharing.

The existing tableSwitch combinator's LF is unnecessarily complex. This patch also simplifies the tableSwitch combinator.

Note that I was forced to add `@ForceInline` on immutable lists due to regressions in `MethodHandlesTableSwitchRandom` with `sorted == true`, which eliminates the regression. Otherwise, all benchmark results are the same. Tested java/lang/invoke.

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

Commit messages:
 - Fix and upgrade the test
 - Improve error messages
 - Clean up MH switch combinator

Changes: https://git.openjdk.org/jdk/pull/23763/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23763&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350617
  Stats: 695 lines in 9 files changed: 244 ins; 356 del; 95 mod
  Patch: https://git.openjdk.org/jdk/pull/23763.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23763/head:pull/23763

PR: https://git.openjdk.org/jdk/pull/23763


More information about the core-libs-dev mailing list