Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Jorn Vernee
On Tue, 4 Mar 2025 14:17:59 GMT, Chen Liang wrote: > The LambdaForm will be only used for non-customized bytecode (which cannot > fully inline anyways) True, without customization the cases holder in the current implementation will not be a constant, so we can never inline the cases for shared

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Chen Liang
On Tue, 4 Mar 2025 14:25:45 GMT, Jorn Vernee wrote: > as we skipped generating the intrinsic Huh, why? As I understand, intrinsics are bound on NamedFunction; the NamedFunction to select a MH should be still there in a MH chain. - PR Comment: https://git.openjdk.org/jdk/pull/23763

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Jorn Vernee
On Tue, 4 Mar 2025 14:26:19 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java >> line 628: >> >>> 626: continue; >>> 627: } >>> 628:

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Jorn Vernee
On Tue, 4 Mar 2025 14:10:36 GMT, Jorn Vernee wrote: >> 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 existin

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Jorn Vernee
On Tue, 4 Mar 2025 14:33:27 GMT, Jorn Vernee wrote: >> In that case, won't the root form be customized and the table switch names >> be inlined into the root form? > > The root would e.g. have a constant BMH pointing at a _shared_ tableSwitch > LF. So, the BMH fields would be seen as constant a

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Chen Liang
On Tue, 4 Mar 2025 14:11:28 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 7664: >> >>> 7662: if (mh.type() != expectedType) >>> 7663: throw new IllegalArgumentException( >>> 7664: "Some targets do n

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Chen Liang
On Tue, 4 Mar 2025 13:42:16 GMT, Jorn Vernee wrote: >> 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 existin

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Jorn Vernee
On Tue, 25 Feb 2025 02:45:46 GMT, Chen Liang wrote: > 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 tab

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Chen Liang
On Tue, 4 Mar 2025 14:12:05 GMT, Jorn Vernee 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.

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-03-04 Thread Jorn Vernee
On Tue, 25 Feb 2025 02:45:46 GMT, Chen Liang 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 j

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-02-25 Thread Chen Liang
On Tue, 25 Feb 2025 02:45:46 GMT, Chen Liang wrote: > 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 tab

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-02-25 Thread Chen Liang
On Tue, 25 Feb 2025 06:37:08 GMT, Hannes Greule wrote: >> 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 exis

RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-02-25 Thread Chen Liang
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 a

Re: RFR: 8350617: Improve MethodHandles.tableSwitch and remove intrinsicData

2025-02-25 Thread Hannes Greule
On Tue, 25 Feb 2025 02:45:46 GMT, Chen Liang wrote: > 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 tab