[code-reflection] RFR: Lower SwitchExpressionOp

Paul Sandoz psandoz at openjdk.org
Fri Apr 5 21:47:41 UTC 2024


On Fri, 5 Apr 2024 08:00:08 GMT, Adam Sotona <asotona at openjdk.org> wrote:

> How do we distinguish (lowering of) complex switch expressions from basic tableswitch and lookupswitch? I think it is not intended to always explode every tableswitch and lookupswitch into conditional blocks.

Do you mean generating bytecode similar to what javac would? If so in this case the lowering should always produce ops in the core dialect, from which we can generate bytecode (program behavior preserved), but not of the same quality as javac. To do the latter we will need a more nuanced approach to generating bytecode, where some ops are lowered to core ops and some are not and are directly operated on by the bytecode generator. I don't know if the current modeling of switch is sufficient for generating equivalent bytecode. I suspect it will take a few rounds of modeling to get it right.

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

PR Comment: https://git.openjdk.org/babylon/pull/45#issuecomment-2040669401


More information about the babylon-dev mailing list