RFR: 8255765: Shenandoah: Isolate concurrent, degenerated and full GC

Zhengyu Gu zgu at openjdk.java.net
Thu Jan 14 21:19:11 UTC 2021


The purpose of this patch is to isolate concurrent, degenerated and full gc implementation, so that, makes each GC implementation more straightforward and clean, and improves readability.

Current implementation emphasis code sharing, e.g. degenerated GC reuses concurrent GC's ops. It was not a problem in the beginning, when they actually behave similarly. Since concurrent GC moved root processing into concurrent phases, code started to diverge, we started to put bandages to make the shared ops work for both concurrent and degenerated GC, that made code hard to read and error prone.

The patch breaks up GCs into 3 (mainly just concurrent and degenerated GC, as full GC already standalone) easy to identify and understand classes (ShenandoahConcurrentGC, ShenandoahDegeneratedGC and ShenandoahMarkCompactGC), subclasses of ShenandoahGC class.

The three GCs still keep vmop/entry/op paradigm, but encapsulate GC control flow inside their own classes, as ShenandoahMarkCompact GC already does. So that, concurrent and degenerated GC no longer share ops and op implementations no longer need to consider other GC modes, which results in simplifying implementation and improving readability. Code sharing is achieved via helper methods provided by ShenandoahHeap.

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

Commit messages:
 - Remove cached heap in ShenandoahGC
 - Merge
 - Merge branch 'fix_phase_timings' into JDK-8255765-isolate-gcs
 - Merge
 - Merge
 - Merge
 - Merge
 - Removed trailing whitespaces
 - Merge
 - Merge branch 'JDK-8255019-sh-mark' into fix_phase_timings
 - ... and 89 more: https://git.openjdk.java.net/jdk/compare/a6b2162f...d9805040

Changes: https://git.openjdk.java.net/jdk/pull/1964/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1964&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255765
  Stats: 3232 lines in 21 files changed: 1815 ins; 1281 del; 136 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1964.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1964/head:pull/1964

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


More information about the shenandoah-dev mailing list