Integrated: 8341525: G1: use bit clearing to remove tightly-coupled initialization store pre-barriers

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Mon Oct 7 08:31:41 UTC 2024


On Fri, 4 Oct 2024 13:04:52 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> This cleanup applies bit clearing rather than bit toggling to clear the G1 pre-barrier bit of tightly-coupled initializing stores when `ReduceInitialCardMarks` is disabled. Although using bit toggling is correct in this context (see [JBS issue description](https://bugs.openjdk.org/browse/JDK-8341525)), bit clearing communicates more clearly (no pun intended) the intent of setting the pre-barrier bit to zero regardless of its previous value. No new tests are added because there already exist tests that exercise this case, for example `testCloneObjectWithFewFields` in `test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java`.
> 
> Thanks to @shipilev for [reporting](https://github.com/openjdk/jdk/pull/19746#discussion_r1786573527) this maintainability issue.
> 
> #### Testing
> - tier1-5 (linux-x64, linux-aarch64, windows-x64, macosx-x64, and macosx-aarch64; release and debug mode).
> - tier1-3 with `-XX:-ReduceInitialCardMarks` (linux-x64; debug mode).

This pull request has now been integrated.

Changeset: 81ebbb24
Author:    Roberto Castañeda Lozano <rcastanedalo at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/81ebbb2463df8b014bb209dc4028668fc78e8327
Stats:     2 lines in 1 file changed: 1 ins; 0 del; 1 mod

8341525: G1: use bit clearing to remove tightly-coupled initialization store pre-barriers

Reviewed-by: mdoerr, kbarrett, shade, tschatzl

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

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


More information about the hotspot-dev mailing list