Consolidate read table cleaning

This commit is contained in:
William Kemper 2025-06-12 11:48:29 -07:00
parent 5e2c20a80f
commit 9552021cbe
3 changed files with 9 additions and 14 deletions

View File

@ -640,10 +640,6 @@ void ShenandoahConcurrentGC::op_reset() {
} else {
_generation->prepare_gc();
}
if (heap->mode()->is_generational()) {
heap->old_generation()->card_scan()->mark_read_table_as_clean();
}
}
class ShenandoahInitMarkUpdateRegionStateClosure : public ShenandoahHeapRegionClosure {

View File

@ -136,15 +136,11 @@ void ShenandoahDegenGC::op_degenerated() {
heap->set_unload_classes(_generation->heuristics()->can_unload_classes() &&
(!heap->mode()->is_generational() || _generation->is_global()));
if (heap->mode()->is_generational()) {
// Clean the read table before swapping it. The end goal here is to have a clean
// write table, and to have the read table updated with the previous write table.
heap->old_generation()->card_scan()->mark_read_table_as_clean();
op_reset();
if (_generation->is_young()) {
// Swap remembered sets for young
_generation->swap_card_tables();
}
if (heap->mode()->is_generational() && _generation->is_young()) {
// Swap remembered sets for young
_generation->swap_card_tables();
}
case _degenerated_roots:
@ -182,8 +178,6 @@ void ShenandoahDegenGC::op_degenerated() {
}
}
op_reset();
// STW mark
op_mark();

View File

@ -246,6 +246,11 @@ void ShenandoahGeneration::merge_write_table() {
void ShenandoahGeneration::prepare_gc() {
reset_mark_bitmap<true>();
ShenandoahHeap* const heap = ShenandoahHeap::heap();
if (heap->mode()->is_generational()) {
heap->old_generation()->card_scan()->mark_read_table_as_clean();
}
}
void ShenandoahGeneration::parallel_heap_region_iterate_free(ShenandoahHeapRegionClosure* cl) {