RFR: 8331711: G1 doesn't need pre write barrier for stores from new allocated objects
Liang Mao
lmao at openjdk.org
Mon May 6 09:36:59 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
-------------
Commit messages:
- 8331711: G1 doesn't need pre write barrier for stores from new allocated objects
Changes: https://git.openjdk.org/jdk/pull/19098/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19098&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8331711
Stats: 7 lines in 1 file changed: 6 ins; 1 del; 0 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