[lworld] RFR: 8335256: [lworld] compiler/valhalla/inlinetypes/TestValueConstruction.java fails intermittently [v3]
Quan Anh Mai
qamai at openjdk.org
Tue Apr 29 19:52:20 UTC 2025
> Hi
>
> The root issue is that a larval value object is fundamentally different from a non-larval one. The most important thing is that it has a unique identity and it expects any modification on 1 reference observable by all other equivalent references. As a result, we need a mechanism to track the identity of a larval object, which `InlineTypeNode` does not provide. My current proposal to fix this issue is to abandon larval `InlineTypeNode`s and use the oop like other objects.
>
> It is probably beneficial to have another mechanism to make it easier optimizing larval inline type nodes, but I think it can be a follow-up RFE.
>
> An example regarding the issue with tracking the identity of a larval InlineTypeNode:
>
> Consider this pseudobytecode sequence:
>
> new MyValue;
> dup;
> loop;
> invokespecial MyValue::<init>;
> areturn;
>
> There are 2 equivalent references in the stack at the loop entry. When `Parse::merge` encounters them, it cannot know that these are the same because the back-edge has not been processed yet. As a result, it creates 2 separate `Phi`s for these references. Then, `invokespecial` will only make the top of the stack a non-larval object, not the next one, which is the one returned to the caller. As a result, we fail with `assert(!value->is_InlineType() || !value->as_InlineType()->is_larval(), "returning a larval")`. Worse, if the method is osr-compiled at the loop head, we have 2 separate references fed into the compiled function and there is no way we may know that they are of the same object.
>
> Please take a look and leave your reviews, thanks a lot.
Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
fix test failures
-------------
Changes:
- all: https://git.openjdk.org/valhalla/pull/1447/files
- new: https://git.openjdk.org/valhalla/pull/1447/files/d9e233ef..d91fcf99
Webrevs:
- full: https://webrevs.openjdk.org/?repo=valhalla&pr=1447&range=02
- incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1447&range=01-02
Stats: 216 lines in 6 files changed: 32 ins; 141 del; 43 mod
Patch: https://git.openjdk.org/valhalla/pull/1447.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1447/head:pull/1447
PR: https://git.openjdk.org/valhalla/pull/1447
More information about the valhalla-dev
mailing list