[code-reflection] RFR: Remove bytecode dialect [v4]
Adam Sotona
asotona at openjdk.org
Wed Feb 7 08:29:04 UTC 2024
On Tue, 6 Feb 2024 18:31:13 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Code cleanup
>
> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeLift.java line 180:
>
>> 178: int ni = bcb.instructions.size();
>> 179: for (int i = 0; i < ni; i++) {
>> 180: switch (bcb.instructions.get(i)) {
>
> I think it would be beneficial to separate out the switch over an instruction into a separate method, so the loop logic (over blocks and instructions) can be easily read.
>
> In many cases instructions push an operation result onto the stack and we could factor out that code, where we return a non-null result in such cases. This would also make the code easier to read in the switch cases.
I'm actually thinking of refactoring the whole process into a single pass.
Theoretically there should be no reason to prepare blocks and feed instructions into an auxiliary data structure in one pass, add block parameters from exception handlers and from stack map frames in another pass and convert instructions into ops in another pass.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/16#discussion_r1481069474
More information about the babylon-dev
mailing list