From 4cf4c599b9a8a08cdd7ab865355af4e12e364750 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 13 Mar 2023 11:30:52 +0000 Subject: [PATCH] 8303824: Parallel: Use more strict card table API Reviewed-by: tschatzl, iwalulya, ysr --- src/hotspot/share/gc/parallel/psOldGen.hpp | 5 +++++ src/hotspot/share/gc/parallel/psParallelCompact.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp index c3ef2f5940d..c26f251f9a2 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.hpp +++ b/src/hotspot/share/gc/parallel/psOldGen.hpp @@ -103,6 +103,11 @@ class PSOldGen : public CHeapObj { (HeapWord*)(_virtual_space->high_boundary())); } + MemRegion committed() const { + return MemRegion((HeapWord*)(_virtual_space->low()), + (HeapWord*)(_virtual_space->high())); + } + size_t max_gen_size() const { return _max_gen_size; } size_t min_gen_size() const { return _min_gen_size; } diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index e346a62d50f..7130cb7880a 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -1017,11 +1017,11 @@ void PSParallelCompact::post_compact() to_space->is_empty(); PSCardTable* ct = heap->card_table(); - MemRegion old_mr = heap->old_gen()->reserved(); + MemRegion old_mr = heap->old_gen()->committed(); if (young_gen_empty) { - ct->clear(old_mr); + ct->clear_MemRegion(old_mr); } else { - ct->invalidate(old_mr); + ct->dirty_MemRegion(old_mr); } // Delete metaspaces for unloaded class loaders and clean up loader_data graph