[code-reflection] RFR: 8337158: Modeling and lowering of switch statement [v13]

Paul Sandoz psandoz at openjdk.org
Fri Aug 16 16:46:02 UTC 2024


On Fri, 16 Aug 2024 12:02:19 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> Modeling and lowering of switch statement.
>
> Mourad Abbay has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Add a test case of switch statement model
>  - Runtime tests of switch statement

src/java.base/share/classes/java/lang/reflect/code/op/ExtendedOp.java line 126:

> 124:             } while (!(op instanceof Op.Loop || op instanceof JavaSwitchStatementOp));
> 125:             // } while (!(op instanceof Op.Loop lop));
> 126:             // error: variable lop might not have been initialized

Now we have two choices we can remove the comment. Also we can update the comment at line 114.

Suggest you also change the if/else if/else into a switch expression.

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ReflectMethods.java line 843:

> 841:                     // Arithmetic operations
> 842:                     case PLUS_ASG -> {
> 843:                         if (tree.operator.opcode == ByteCodes.string_add) {

Make an `@@@` comment about the boxing

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

PR Review Comment: https://git.openjdk.org/babylon/pull/211#discussion_r1720074066
PR Review Comment: https://git.openjdk.org/babylon/pull/211#discussion_r1720075756


More information about the babylon-dev mailing list