[lworld] Integrated: 8356599: [lworld] C2 incorrectly folds array object klass load for atomic arrays

Tobias Hartmann thartmann at openjdk.org
Fri May 9 06:48:10 UTC 2025


On Fri, 9 May 2025 06:38:11 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

> `TypeAryKlassPtr` and `TypeAryPtr`/`TypeAry` in C2's typesystem currently don't keep track of atomicity of arrays. As a result, C2 might incorrectly fold loads from `GraphKit::load_object_klass` to non-atomic `TypeAryKlassPtr`, resulting in the `GraphKit::null_free_atomic_array_test` to incorrectly return false at runtime.
> 
> I fixed this by selectively disabling folding of the klass load done by the `GraphKit::null_free_atomic_array_test` via a `fold_for_arrays` flag for now. I'll revisit this with JDK-8350865.
> 
> Thanks,
> Tobias

This pull request has now been integrated.

Changeset: c65b4584
Author:    Tobias Hartmann <thartmann at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/c65b458426e51bd8f1893f455cdef33041baf408
Stats:     170 lines in 13 files changed: 117 ins; 17 del; 36 mod

8356599: [lworld] C2 incorrectly folds array object klass load for atomic arrays
8355941: [lworld] TestArrayAccessDeopt.java fails due to unexpected deoptimization

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

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


More information about the valhalla-dev mailing list