Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles [v2]

2021-05-21 Thread Jorn Vernee
On Mon, 17 May 2021 17:19:16 GMT, Jorn Vernee wrote: >> This patch adds a `tableSwitch` combinator that can be used to switch over a >> set of method handles given an index, with a fallback in case the index is >> out of bounds, much like the `tableswitch` bytecode. Here is a description >> of

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles [v3]

2021-05-21 Thread Jorn Vernee
> This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how it works (copied from the javadoc): > > Creates

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles [v2]

2021-05-17 Thread Claes Redestad
On Mon, 17 May 2021 17:19:16 GMT, Jorn Vernee wrote: >> This patch adds a `tableSwitch` combinator that can be used to switch over a >> set of method handles given an index, with a fallback in case the index is >> out of bounds, much like the `tableswitch` bytecode. Here is a description >> of

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles [v2]

2021-05-17 Thread Jorn Vernee
On Fri, 14 May 2021 07:27:08 GMT, Claes Redestad wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains two additional >> commits

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles [v2]

2021-05-17 Thread Jorn Vernee
> This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how it works (copied from the javadoc): > > Creates

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-05-14 Thread Claes Redestad
On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-05-12 Thread Rémi Forax
On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-05-12 Thread Jorn Vernee
On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Jorn Vernee
On Tue, 13 Apr 2021 22:00:57 GMT, Remi Forax wrote: > About your benchmark, did you test with some strings going into "default", > because it is usually in that case that you need a proper lookup switch, another way to say it is that, your results are too good when you use a cascade of guardWit

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Jorn Vernee
On Tue, 13 Apr 2021 22:00:57 GMT, Remi Forax wrote: > About your benchmark, did you test with some strings going into "default", > because it is usually in that case that you need a proper lookup switch, another way to say it is that, your results are too good when you use a cascade of guardWit

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Remi Forax
- Mail original - > De: "Jorn Vernee" > À: "core-libs-dev" > Envoyé: Mardi 13 Avril 2021 16:59:58 > Objet: Re: RFR: 8263087: Add a MethodHandle combinator that switches over a > set of MethodHandles > On Thu, 8 Apr 2021 18:51:21 GMT, Jorn

Re: [External] : Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Remi Forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Jorn Vernee" , "core-libs-dev" > > Envoyé: Samedi 10 Avril 2021 01:43:49 > Objet: Re: [External] : Re: RFR: 8263087: Add a MethodHandle combinator that > switches over a set of MethodHandles

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-13 Thread Jorn Vernee
On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how

Re: [External] : Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread John Rose
On Apr 9, 2021, at 4:00 PM, John Rose mailto:john.r.r...@oracle.com>> wrote: The MH combinator for lookupswitch can use a data-driven reverse lookup in a (frozen/stable) int[] array, using binary search. The bytecode emitter can render such a thing as an internal lookupswitch, if that seems desi

Re: [External] : Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread John Rose
On Apr 9, 2021, at 11:15 AM, fo...@univ-mlv.fr wrote: > > - Mail original - >> De: "John Rose" >> À: "Remi Forax" >> Cc: "Jorn Vernee" , "core-libs-dev" >> >> Envoyé: Vendredi 9 Avril 2021 20:01:18 >> O

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Jorn Vernee
On Fri, 9 Apr 2021 18:27:07 GMT, Jorn Vernee wrote: >> This patch adds a `tableSwitch` combinator that can be used to switch over a >> set of method handles given an index, with a fallback in case the index is >> out of bounds, much like the `tableswitch` bytecode. Here is a description >> of

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Rémi Forax
On Fri, 9 Apr 2021 19:57:10 GMT, Jorn Vernee wrote: >>> yes, for all the switches, pattern-switch, enum-switch but not for the >>> string switch which requires a lookup switch. >> Can you outline how to use the tableswitch combinator in the case of a >> switch on strings ? >> >> Jan Lahoda has

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Jorn Vernee
On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread forax
- Mail original - > De: "John Rose" > À: "Remi Forax" > Cc: "Jorn Vernee" , "core-libs-dev" > > Envoyé: Vendredi 9 Avril 2021 20:01:18 > Objet: Re: RFR: 8263087: Add a MethodHandle combinator that switches over a > set o

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread John Rose
On Apr 9, 2021, at 9:55 AM, Remi Forax wrote: > > I think the combinator should be lookupswitch which is more general than > tableswitch with a special case when generating the bytecode to generate a > tableswitch instead of a lookupswitch if the indexes are subsequent. We can get there in the

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Jorn Vernee
On 09/04/2021 18:54, Remi Forax wrote: - Mail original - De: "Jorn Vernee" À: "core-libs-dev" Envoyé: Vendredi 9 Avril 2021 12:51:53 Objet: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles This patch adds a `tableSwitch` co

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Remi Forax
- Mail original - > De: "Jorn Vernee" > À: "core-libs-dev" > Envoyé: Vendredi 9 Avril 2021 12:51:53 > Objet: RFR: 8263087: Add a MethodHandle combinator that switches over a set > of MethodHandles > This patch adds a `tableSwitch` combinator th

RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Jorn Vernee
This patch adds a `tableSwitch` combinator that can be used to switch over a set of method handles given an index, with a fallback in case the index is out of bounds, much like the `tableswitch` bytecode. The combinator does not support specifying the starting index, so the switch cases always