> C1/interpreter array-access profiling is racy and can publish the exact array 
> klass before the flat/null-free flag is visible:
> https://github.com/openjdk/valhalla/blob/f87d6d1cea3b578b458075a411f7aaa5dddb2cd9/src/hotspot/share/c1/c1_LIRGenerator.cpp#L1968-L1971
> 
> C2 reads profile information lock-free and can therefore, in rare cases, 
> observe the inconsistencies reported in the JBS issue. For example, it can 
> observe profiling for an array load with an `array_type` that is knowingly 
> flat but does not have the `flat_array` property set (yet). The new 
> regression test reliably reproduces such inconsistencies for array loads and 
> stores.
> 
> Since a valid profiled flat array klass is stronger information than the flat 
> flag, the fix is to prefer that information if available. With that fix, the 
> asserts don't make much sense anymore, so I removed them.
> 
> 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:

  Better name

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/2452/files
  - new: https://git.openjdk.org/valhalla/pull/2452/files/f693fc00..c0500ca5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2452&range=01
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2452&range=00-01

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

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

Reply via email to