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

Paul Sandoz psandoz at openjdk.org
Thu Feb 1 18:55:20 UTC 2024


On Thu, 1 Feb 2024 17:03:52 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:
> 
>   added TestBranchCompactor

Marked as reviewed by psandoz (Lead).

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

> 46:     private BranchInstruction firstBranch, secondBranch;
> 47:     private final List<PseudoInstruction> pseudoBuffer1 = new ArrayList<>(),
> 48:                                           pseudoBuffer2 = new ArrayList<>();

Can these move respectively to fields on the anonymous classes for instances of `INIT_STATE` and `LOOKING_FOR_SHORT_JUMP`? (Style-wise the names should ideally be in camel case because they are not static)

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

> 56:                 activeState = LOOKING_FOR_SHORT_JUMP;
> 57:             } else {
> 58:                 //all other instructions and pseudo instrutions are passed

Suggestion:

                //all other instructions and pseudo instructions are passed

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

> 156:                     //third branch has been detected, so we flush the firstBranch and its pseudo instructions
> 157:                     //move to LOOKING_FOR_SHORT_JUMP state, shift secondBranch to the firstBranch
> 158:                     //replay the seconBranch pseudo instructions and this actual branch

Suggestion:

                    //replay the secondBranch pseudo instructions and this actual branch

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

PR Review: https://git.openjdk.org/babylon/pull/12#pullrequestreview-1857315010
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1474969801
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1474967375
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1474971063


More information about the babylon-dev mailing list