> https://github.com/openjdk/valhalla/pull/2390 triggered some weird failures 
> and it turned out that this invariant is broken when 
> `ValueClass.newReferenceArray` is called before the default refined klass is 
> created:
> https://github.com/openjdk/valhalla/blob/7558cd73f557e34b0f11dd0a37952854ab2881f6/src/hotspot/share/oops/objArrayKlass.cpp#L410-L414
> 
> In that case, the first entry in the linked list will not be the default 
> refined klass but the not-flat, nullable variant. This leads to the code 
> emitted by `LibraryCallKit::load_default_refined_array_klass` returning the 
> wrong refined klass and thus to wrong results with the `_copyOf` and 
> `_newArray` intrinsics.
> 
> I added a targeted regression test for this that covers both intrinsics and 
> randomizes the order in which refined klasses are created.
> 
> The fix was provided by @fparain.
> 
> Thanks,
> Tobias
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Tobias Hartmann has updated the pull request incrementally with one additional 
commit since the last revision:

  More tests disabled

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/2406/files
  - new: https://git.openjdk.org/valhalla/pull/2406/files/26ed330c..90cee0e7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2406&range=05
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2406&range=04-05

  Stats: 13 lines in 1 file changed: 3 ins; 0 del; 10 mod
  Patch: https://git.openjdk.org/valhalla/pull/2406.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2406/head:pull/2406

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

Reply via email to