[lworld] RFR: 8378686: [lworld] C2 fails with assert(_gvn.type(n) == TypePtr::NULL_PTR) failed: must be a null constant

Tobias Hartmann thartmann at openjdk.org
Wed Feb 25 16:01:22 UTC 2026


On Wed, 25 Feb 2026 15:43:01 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> Hi,
> 
>     value class MyValue {
>         MyValue other;
>     }
> 
> A cyclic field is not aggressively scalarized, so when we obtain an object of `MyValue`, the field `other` stays as a `LoadP`. When we go `getfield` from a `MyValue`, we obtain the `LoadP` into the state map. We have `InlineTypeNode::adjust_scalarization_depth` but it only has its effect if the field is already an `InlineTypeNode`. We need to add a case to scalarize if the obtained field is an oop.
> 
> Many thanks to @TobiHartmann for the test case.
> 
> Please kindly review, thanks a lot.

Wow, that was quick. Looks good, thanks for fixing!

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

Marked as reviewed by thartmann (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/2166#pullrequestreview-3855199488


More information about the valhalla-dev mailing list