Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v5]

2024-07-12 Thread Chen Liang
On Mon, 8 Jul 2024 10:16:09 GMT, Jan Lahoda wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits a re

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v5]

2024-07-08 Thread Jan Lahoda
> For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relatively easy faster handling, > and that is when all the

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v4]

2024-07-02 Thread Chen Liang
On Thu, 27 Jun 2024 19:30:39 GMT, Jan Lahoda wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits a r

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v4]

2024-07-02 Thread Jan Lahoda
On Thu, 27 Jun 2024 19:30:39 GMT, Jan Lahoda wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits a r

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v3]

2024-06-27 Thread Jan Lahoda
On Thu, 27 Jun 2024 19:07:07 GMT, ExE Boss wrote: > Since `labels` is no longer eagerly cloned, it’s important to store the > converted labels into a local array to avoid leaking them to user code. True. But it is easier and cleaner, IMO, to simply put back cloning of the labels.

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v4]

2024-06-27 Thread Jan Lahoda
> For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relatively easy faster handling, > and that is when all the

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v3]

2024-06-27 Thread ExE Boss
On Thu, 27 Jun 2024 15:32:38 GMT, Jan Lahoda wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits a r

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v2]

2024-06-27 Thread ExE Boss
On Thu, 27 Jun 2024 15:25:36 GMT, Chen Liang wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reflecting review feedback. > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 286: > >> 284:

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v3]

2024-06-27 Thread Jan Lahoda
> For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relatively easy faster handling, > and that is when all the

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v2]

2024-06-27 Thread Chen Liang
On Thu, 27 Jun 2024 14:06:42 GMT, Jan Lahoda wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits a r

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v2]

2024-06-27 Thread Jan Lahoda
> For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relatively easy faster handling, > and that is when all the

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array

2024-06-26 Thread Claes Redestad
On Wed, 26 Jun 2024 13:02:51 GMT, Jan Lahoda wrote: >> test/micro/org/openjdk/bench/java/lang/runtime/SwitchEnum.java line 57: >> >>> 55: for (E e : inputs) { >>> 56: sum += switch (e) { >>> 57: case null -> -1; >> >> As this `null` case adds a case relative

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array

2024-06-26 Thread Chen Liang
On Wed, 26 Jun 2024 12:32:20 GMT, Jan Lahoda wrote: > For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relati

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array

2024-06-26 Thread Jan Lahoda
On Wed, 26 Jun 2024 12:46:18 GMT, Claes Redestad wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array

2024-06-26 Thread Claes Redestad
On Wed, 26 Jun 2024 12:32:20 GMT, Jan Lahoda wrote: > For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relati

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array

2024-06-26 Thread Claes Redestad
On Wed, 26 Jun 2024 12:32:20 GMT, Jan Lahoda wrote: > For general pattern matching switches, the `SwitchBootstraps` class currently > generates a cascade of `if`-like statements, computing the correct target > case index for the given input. > > There is one special case which permits a relati

RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array

2024-06-26 Thread Jan Lahoda
For general pattern matching switches, the `SwitchBootstraps` class currently generates a cascade of `if`-like statements, computing the correct target case index for the given input. There is one special case which permits a relatively easy faster handling, and that is when all the case labels