[code-reflection] RFR: Exception regions fix [v9]

Paul Sandoz psandoz at openjdk.org
Fri Feb 2 16:16:15 UTC 2024


On Fri, 2 Feb 2024 09:41:30 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> BytecodeGenerator::computeExceptionRegionMembership now collects all necessary info into BitSets and directly declares the regions with CodeBuilder.
>> All tests are now passing.
>> 
>> Please review.
>> 
>> Thanks,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   BranchCompactor cleanup

Marked as reviewed by psandoz (Lead).

src/java.base/share/classes/java/lang/reflect/code/bytecode/BranchCompactor.java line 60:

> 58:             switch (coe) {
> 59:                 case LabelTarget lt -> {
> 60:                     if (branch.target() == lt.label()) {

Since `LabelTarget` is also a `PsuedoInstruction` you could make this case be:

case LabelTarget when branch.target() == lt.label() -> { ... }

Thereby collapsing the if/else. Up to you.

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

PR Review: https://git.openjdk.org/babylon/pull/12#pullrequestreview-1859619204
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1476259755


More information about the babylon-dev mailing list