[code-reflection] RFR: Exception regions fix [v2]
Adam Sotona
asotona at openjdk.org
Thu Feb 1 07:56:37 UTC 2024
On Wed, 31 Jan 2024 22:56:08 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java
>>
>> Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>
> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 125:
>
>> 123: public void accept(CodeBuilder cob, CodeElement coe) {
>> 124: cob.accept(coe);
>> 125: // switch (coe) {
>
> Is DebugTransform redundant now?
yes, removing it
> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 347:
>
>> 345:
>> 346:
>> 347: private static void computeExceptionRegionMembership(Body r, CodeBuilder cob, ConversionContext c) {
>
> Let's rename `r` to `body` (then it does not cause confusion with `r` used for the active region index.
Fixed, thanks.
> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 359:
>
>> 357: this.block = block;
>> 358: this.activeRegions = activeRegions;
>> 359: int index = blocks.indexOf(block);
>
> We should be able to use `block.index()`, however that is not fully working as intended right now and needs to be fixed (i.e., this invariant should hold `block.index() == blocks.indexOf(block)`, but currently does not)
Yes, that would avoid confusion and save some CPU.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1473944592
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1473943665
PR Review Comment: https://git.openjdk.org/babylon/pull/12#discussion_r1473944225
More information about the babylon-dev
mailing list