File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
src/hotspot/share/gc/shenandoah Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -415,10 +415,6 @@ void ShenandoahConcurrentGC::entry_reset() {
415415 msg);
416416 op_reset ();
417417 }
418-
419- if (heap->mode ()->is_generational ()) {
420- heap->old_generation ()->card_scan ()->mark_read_table_as_clean ();
421- }
422418}
423419
424420void ShenandoahConcurrentGC::entry_scan_remembered_set () {
@@ -644,6 +640,10 @@ void ShenandoahConcurrentGC::op_reset() {
644640 } else {
645641 _generation->prepare_gc ();
646642 }
643+
644+ if (heap->mode ()->is_generational ()) {
645+ heap->old_generation ()->card_scan ()->mark_read_table_as_clean ();
646+ }
647647}
648648
649649class ShenandoahInitMarkUpdateRegionStateClosure : public ShenandoahHeapRegionClosure {
Original file line number Diff line number Diff line change @@ -136,9 +136,15 @@ void ShenandoahDegenGC::op_degenerated() {
136136 heap->set_unload_classes (_generation->heuristics ()->can_unload_classes () &&
137137 (!heap->mode ()->is_generational () || _generation->is_global ()));
138138
139- if (heap->mode ()->is_generational () && _generation->is_young ()) {
140- // Swap remembered sets for young
141- _generation->swap_card_tables ();
139+ if (heap->mode ()->is_generational ()) {
140+ // Clean the read table before swapping it. The end goal here is to have a clean
141+ // write table, and to have the read table updated with the previous write table.
142+ heap->old_generation ()->card_scan ()->mark_read_table_as_clean ();
143+
144+ if (_generation->is_young ()) {
145+ // Swap remembered sets for young
146+ _generation->swap_card_tables ();
147+ }
142148 }
143149
144150 case _degenerated_roots:
You can’t perform that action at this time.
0 commit comments