RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData
Chen Liang
liach at openjdk.org
Tue Mar 4 14:21:05 UTC 2025
On Tue, 4 Mar 2025 14:12:05 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> the LambdaForm will just have a single call site for all the cases, whereas the intrinsic does emit a call per case?
Yes. The LambdaForm will be only used for non-customized bytecode (which cannot fully inline anyways) or interpretation.
> i.e. the point is that these do not necessarily have to do exactly the same thing?
I think so - that is what these MH Impl intrinsics are for, to stub out some names with replacement bytecode. Though in the long run, we might check if it's possible and worthy to add library call (intrinsic) for our combinator and improve the IR for C2 directly.
For performance, as I've mentioned before, JMH benchmarks results are the same for before and after; the only difference is that I had to add `@ForceInline` on Immutable collections to make them as performant as the old switch holder class because of the inlining shenigans when something is not constant.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23763#issuecomment-2697796793
More information about the core-libs-dev
mailing list