[lworld] RFR: 8375548: [lworld] C2: Support value class arrays with compiler replay [v2]
Tobias Hartmann
thartmann at openjdk.org
Fri Jan 23 10:26:45 UTC 2026
On Thu, 22 Jan 2026 14:42:44 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> When using compiler replay with `--enable-preview` with array store/load profiling, we only create `ObjArrayKlass` objects instead of subclass objects (i.e. `RefArrayKlass` or `FlatArrayKlass`). The reason is that we are directly resolving klasses with `SystemDirectory::resolve_or_fail()`:
>> https://github.com/openjdk/valhalla/blob/a4fb7ebd5af316d3e99d10bffb44d5be3aab5548/src/hotspot/share/ci/ciReplay.cpp#L557
>>
>> This method will call `InstanceKlass::array_klass()` at some point which directly creates an `ObjArrayKlass` object. This let's the replayed compilation fail when trying to speculate on an value class array which expects a subclass of `ObjArrayKlass`.
>>
>> The fix I propose is to make sure that we are always creating subclass objects by explicitly using `ArrayProperties::DEFAULT` when parsing an `ArrayKlass` during replay compilation.
>>
>> I added a compiler replay test which triggers the same assert as shown in the report.
>>
>> Thanks,
>> Christian
>
> Christian Hagedorn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - support value class arrays
> - Merge branch 'lworld' into JDK-8375548
> - Revert "8375548: [lworld] C2: Compiler replay fails with an assertion due to not loading object array klasses with ArrayProperties::DEFAULT"
>
> This reverts commit 0cdb2549427a02c6d77adbbf29ba5ed1d1d38293.
> - 8375548: [lworld] C2: Compiler replay fails with an assertion due to not loading object array klasses with ArrayProperties::DEFAULT
Nice! That looks good to me.
-------------
Marked as reviewed by thartmann (Committer).
PR Review: https://git.openjdk.org/valhalla/pull/1931#pullrequestreview-3696829724
More information about the valhalla-dev
mailing list