[code-reflection] RFR: Skip bytecode dialect

Paul Sandoz psandoz at openjdk.org
Mon Jan 29 19:16:46 UTC 2024


On Mon, 29 Jan 2024 15:52:29 GMT, Adam Sotona <asotona at openjdk.org> wrote:

> This is the first step to avoid custom bytecode dialect. Second step will be to rewrite BytecodeLift. 
> 
> BytecodeGenerator now consumes CoreOps and generates bytecode directly.
> 
> Two try-finally test cases are disabled due to invalid structure (missing exception.region.exit for some finalizers).
> All other tests are passing.
> 
> Calculation of try-catch regions is still very raw and needs some future improvements. 
> 
> Please review.
> 
> Thanks,
> Adam

This looks like a good step in the right direction, mostly mechanical, and removing complexity. The bytecode dialect was an experiment, one that did not entirely fit well with the code model structure and design.

Would you prefer to integrate this now or continue working to get the other tests passing? (We know that the higher layer is not currently generating region exits for all terminal operations.)

Although you have not enabled the use of it yet the logic in `computeExceptionRegionMembership` looks correct. You could probably simplify by doing:

ExceptionRegionNode bRegions = coveredBlocks.computeIfAbsent(b, _ > NIL);

Which would remove a bunch of subsequent `null` checks.

Instead of `Collections.catchBlocks` we can use sequenced collections:

for (Block.Reference catchBlock : er.catchBlocks().reversed()) {
    ...
}

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

PR Comment: https://git.openjdk.org/babylon/pull/9#issuecomment-1915390769


More information about the babylon-dev mailing list