[code-reflection] RFR: Bytecode round 12 [v3]

Paul Sandoz psandoz at openjdk.org
Tue Sep 3 19:56:51 UTC 2024


On Mon, 2 Sep 2024 06:07:10 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> 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.
>
> This code detect there is no path from a VarLoadOp to the entry block that bypass the VarStoreOps. The default initialization is necessary if there is such path. I've just made it more abstract as a dominance test of a dominant set.

I still don't understand why the second check is needed, traversing the predecessors of `n`'s declaring block. If `n` is not dominated by any values in set `doms` then presumably such traversal has to encounter the entry block? 

The implementation of `Value::isDominatedBy` defers to block domination:

    public boolean isDominatedBy(Value dom) {
        if (this == dom) {
            return true;
        }

        if (declaringBlock() != dom.declaringBlock()) {
            return declaringBlock().isDominatedBy(dom.declaringBlock());
        }
...

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

PR Review Comment: https://git.openjdk.org/babylon/pull/219#discussion_r1742604589


More information about the babylon-dev mailing list