RFR: 8331711: G1 doesn't need pre write barrier for stores from new allocated objects [v2]

Liang Mao lmao at openjdk.org
Mon May 6 09:58:12 UTC 2024


> The pre-write barrier of G1 is used to capture the object disconnected from the marking graph which could be unmarked aka *white* and stored into *black* objects then break tri-color invariance. But references in new allocated objects are created in object initialization after marking start and never could be white. So we don't need pre-write barrier for stores from new allocated objects. The same mechanism is also used for barrier eliminantion in GenZGC.
> 
> Additional testing:
>  - [x] Linux aarch64 server release/fastdebug, test/hotspot/jtreg/gc with +UseG1GC
>  - [x] Run several iterations of SPECjbb2015 with aggressively frequent concurrent mark

Liang Mao 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 'openjdk/master' into 8331711
 - 8331711: G1 doesn't need pre write barrier for stores from new allocated objects

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/19098/files
  - new: https://git.openjdk.org/jdk/pull/19098/files/b34d6e7b..12681d73

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

  Stats: 122 lines in 12 files changed: 67 ins; 38 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/19098.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19098/head:pull/19098

PR: https://git.openjdk.org/jdk/pull/19098


More information about the hotspot-dev mailing list