[lworld] RFR: 8335256: [lworld] C2: Remove larval InlineTypeNode [v5]
Quan Anh Mai
qamai at openjdk.org
Tue May 6 00:13:24 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 with a new target base due to a merge or a rebase. The pull request now contains six commits:
- move progress check
- Merge branch 'lworld' into larvaloop
- fast path for non intrinsics
- fix test failures
- Merge branch 'lworld' into larvaloop
- remove larval InlineTypeNode
-------------
Changes: https://git.openjdk.org/valhalla/pull/1447/files
Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1447&range=04
Stats: 851 lines in 18 files changed: 285 ins; 416 del; 150 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