Soliciting opinions on JDK-8219412
Archie Cobbs
archie.cobbs at gmail.com
Fri Jan 13 16:13:05 UTC 2023
On Thu, Jan 12, 2023 at 7:17 AM Maxim Degtyarev <mdegtyarev at gmail.com>
wrote:
> > The static argument list identifies the enum constants (by string)
> corresponding to the case numbers.
>
> This will decrease theoretical maximum of switch blocks in enum switch
> statement due to constant pool size limitations. So it may affect some code
> with huge switches over enum.
>
Just trying to make sure I understand this...
The list of identifiers that gets passed to SwitchBootstraps.enumSwitch()
is stored in an array, and the array is built from individual strings
pulled from the constant pool.
So is this what you're saying: the number of switch cases is limited by how
many entries the constant pool can hold? (I think that's 2^16 - 1)
If that's the case, then doesn't that bug already exist in the compiler in
TransPatterns.handleSwitch()?
-Archie
--
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20230113/1e736d5f/attachment.htm>
More information about the compiler-dev
mailing list