RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

Jorn Vernee jvernee at openjdk.org
Tue Mar 4 14:14:54 UTC 2025


On Tue, 25 Feb 2025 02:45:46 GMT, Chen Liang <liach at openjdk.org> wrote:

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

You're gonna have to explain this. Looking at the code, I think the optimization here is that, the LambdaForm will just have a single call site for all the cases, whereas the intrinsic does emit a call per case? i.e. the point is that these do not necessarily have to do exactly the same thing?

I remember that having a call site per case was important from implementing this, since even if the selector is not a constant, we can then still inline each individual call site. Whereas with a single shared call site, the method handle would become not constant.

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

PR Comment: https://git.openjdk.org/jdk/pull/23763#issuecomment-2697769525


More information about the core-libs-dev mailing list