RFR: 8272446 C1: Raw version of UnsafeGet generates load barriers [v2]

Stefan Karlsson stefank at openjdk.java.net
Mon Aug 16 11:54:57 UTC 2021


> Please review this patch to remove load barriers from the "raw" version of UnsafeGet.
> 
> After rebasing the ZGC Generational code to latest openjdk/jdk we hit a crash because a load barrier was generated for some oops that are not supposed to have a load barrier. In upstream ZGC this isn't a problem because these load barriers are just redundant and will find healed good oops. However, in the Generational version un-barriered roots (e.g. thread stacks) have no metadata bits, and we should never perform normal load barriers on them (they are handled by stack watermarks and nmethod barriers).
> 
> This load barrier was introduced with:
> JDK-8266746: C1: Replace UnsafeGetRaw with UnsafeGet when setting up OSR entry block
> 
> which makes UnsafeGet _also_ handle "raw" loads. However, the "raw" path introduced a load barrier. Note that "raw" is often used to denote a function that loads/stores values without using a barrier.
> 
> I've tested this with tier1-3 and have had some initial set of eyes looking over the patch, but it would be good to scrutinize this patch and the usage of UnsafeGet in GraphBuilder::setup_osr_entry_block.
> 
> @TheRealMDoerr could you check if this patch works with PPC?

Stefan Karlsson has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge remote-tracking branch 'origin/master' into 8272446_UnsafeGet_raw_load_barrier
 - 8272446 C1: Raw version of UnsafeGet performs load barriers

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5109/files
  - new: https://git.openjdk.java.net/jdk/pull/5109/files/6c9f8fc9..16917907

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5109&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5109&range=00-01

  Stats: 8662 lines in 312 files changed: 6964 ins; 945 del; 753 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5109.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5109/head:pull/5109

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


More information about the hotspot-compiler-dev mailing list