Integrated: 8223923: C2: Missing interference with mismatched unsafe accesses

Vladimir Ivanov vlivanov at openjdk.java.net
Fri Aug 20 12:44:30 UTC 2021


On Tue, 17 Aug 2021 15:38:48 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> Memory effects of mixed or mismatched unsafe accesses aren't properly tracked, so every problematic access is wrapped into a pair of `MemBarCPUOrder` nodes to isolate it from the rest of the memory graph. But `MemNode::can_see_stored_value()` unconditionally steps over `MemBarCPUOrder` and exposes problematic `MergeMem` nodes.  
> 
> Proposed fix forbids stepping over `MemBarCPUOrder` nodes when looking for an earlier store into the same location.
> 
> Alternatively, a new kind of barrier could be introduced specifically for isolation purposes, but I didn't spot any issues during performance testing with the current patch to justify more complex solution. 
> 
> Testing: hs-tier1 - hs-tier6, performance testing.

This pull request has now been integrated.

Changeset: 86add21a
Author:    Vladimir Ivanov <vlivanov at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/86add21a85ec57de00aecb0a18bc99567a91d0d8
Stats:     84 lines in 2 files changed: 76 ins; 2 del; 6 mod

8223923: C2: Missing interference with mismatched unsafe accesses

Reviewed-by: thartmann

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

PR: https://git.openjdk.java.net/jdk/pull/5146


More information about the hotspot-compiler-dev mailing list