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

Quan Anh Mai qamai at openjdk.org
Thu Feb 26 03:52:39 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.

Thanks for your quick review, too :)

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

PR Comment: https://git.openjdk.org/valhalla/pull/2166#issuecomment-3963794152


More information about the valhalla-dev mailing list