[code-reflection] RFR: Bytecode round 12 [v3]
Adam Sotona
asotona at openjdk.org
Mon Sep 2 06:10:40 UTC 2024
On Fri, 30 Aug 2024 20:43:58 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>>
>> minor corrections
>
> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 399:
>
>> 397: }
>> 398:
>> 399: Set<Block> stopBlocks = new HashSet<>();
>
> If i got this right, we are dealing with an equivalent of an uninitialized variable, of a primitive type, in source that will be assigned in divergent code paths, and the compiler will check it's DA. In the model we currently require the modelling var op be initialized with a default constant value for the primitive type. We don't currently have a concept of an uninitialized value (which might help?), so we have to detect that all loads are dominated by stores, some of which are initializing stores (which detects the uninitialized case or a redundant initialization).
>
> This specific bit of code after the dominated by checks determines if there is a path from `n`'s declaring block to the entry block that does not pass through any of `dom`'s declaring blocks? Why is that is important?
Yes, this is about uninitialized variables (of any type), where there are two or more assignments in divergent paths. Concept of uninitialized variable will definitely help to avoid obsolete default constants declaration. This is a detection of such situation, so the default initialization is skipped and the roundtrip is stable.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/219#discussion_r1740365979
More information about the babylon-dev
mailing list