On Mon, 19 Jan 2026 14:51:48 GMT, Christian Hagedorn <[email protected]> 
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

This pull request has now been integrated.

Changeset: 1de6b3eb
Author:    Christian Hagedorn <[email protected]>
URL:       
https://git.openjdk.org/valhalla/commit/1de6b3eba9f6342971d62dbdc3a5642abab07cd8
Stats:     505 lines in 8 files changed: 435 ins; 40 del; 30 mod

8375548: [lworld] C2: Support value class arrays with compiler replay

Reviewed-by: thartmann

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

PR: https://git.openjdk.org/valhalla/pull/1931

Reply via email to