RFR: 8255471: ZGC: Rework root iterators and closures [v4]

Stefan Karlsson stefank at openjdk.java.net
Fri Oct 30 11:18:55 UTC 2020


> Today we have the ZRootsIteratorClosure type to cater for the different type of roots and their containers (oop storage, threads, nmethods, runtime oop data structures). This closure is then passed down and applied to the different containers. We split the root sets into different sets: concurrent strong, concurrent weak, and non-concurrent weak. Not all of those sets contain all types of containers. This forces some of the code to implement, or at least consider, parts of the ZRootsIteratorClosure interface that it doesn't care about. It also moves some of the closure logic into shared code, even when it's only used by one of the closures.
> 
> I propose that we turn this inside out, and use direct closures that match the visited containers (NMethodClosure for nmethods, et.c.). The intention is to make it a bit easier to see from the call sites what code is run and, hopefully, making localized changes stay more local in the code.
> 
> Note: I started this code with a version building upon https://bugs.openjdk.java.net/browse/JDK-8212879, but I don't want to wait for that work to finish before sending this out, so the current patch contains handling of non-conurrent weak roots. As soon as that gets integrated, we can get rid of the ZWeakSerial and the associated non-concurrent weak roots handling.
> 
> I've tested this on tier1-7 on linux x64.

Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:

  Only restrict nmethod verification when class unloading is turned off

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/928/files
  - new: https://git.openjdk.java.net/jdk/pull/928/files/431060b7..caae91ab

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=928&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=928&range=02-03

  Stats: 7 lines in 1 file changed: 6 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/928.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/928/head:pull/928

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



More information about the hotspot-gc-dev mailing list