File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
src/hotspot/share/gc/shenandoah Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio
4545
4646
4747 // Check all pinned regions have updated status before choosing the collection set.
48- heap->assert_pinned_region_status ();
48+ heap->assert_pinned_region_status (_generation );
4949
5050 // Step 1. Build up the region candidates we care about, rejecting losers and accepting winners right away.
5151
Original file line number Diff line number Diff line change @@ -2419,11 +2419,17 @@ void ShenandoahHeap::sync_pinned_region_status() {
24192419}
24202420
24212421#ifdef ASSERT
2422- void ShenandoahHeap::assert_pinned_region_status () {
2422+ void ShenandoahHeap::assert_pinned_region_status () const {
2423+ assert_pinned_region_status (global_generation ());
2424+ }
2425+
2426+ void ShenandoahHeap::assert_pinned_region_status (ShenandoahGeneration* generation) const {
24232427 for (size_t i = 0 ; i < num_regions (); i++) {
24242428 ShenandoahHeapRegion* r = get_region (i);
2425- assert ((r->is_pinned () && r->pin_count () > 0 ) || (!r->is_pinned () && r->pin_count () == 0 ),
2426- " Region %zu pinning status is inconsistent" , i);
2429+ if (generation->contains (r)) {
2430+ assert ((r->is_pinned () && r->pin_count () > 0 ) || (!r->is_pinned () && r->pin_count () == 0 ),
2431+ " Region %zu pinning status is inconsistent" , i);
2432+ }
24272433 }
24282434}
24292435#endif
Original file line number Diff line number Diff line change @@ -669,7 +669,8 @@ class ShenandoahHeap : public CollectedHeap {
669669 void unpin_object (JavaThread* thread, oop obj) override ;
670670
671671 void sync_pinned_region_status ();
672- void assert_pinned_region_status () NOT_DEBUG_RETURN;
672+ void assert_pinned_region_status () const NOT_DEBUG_RETURN;
673+ void assert_pinned_region_status (ShenandoahGeneration* generation) const NOT_DEBUG_RETURN;
673674
674675// ---------- CDS archive support
675676
Original file line number Diff line number Diff line change @@ -494,7 +494,7 @@ void ShenandoahOldGeneration::prepare_regions_and_collection_set(bool concurrent
494494 ShenandoahFinalMarkUpdateRegionStateClosure cl (complete_marking_context ());
495495
496496 parallel_heap_region_iterate (&cl);
497- heap->assert_pinned_region_status ();
497+ heap->assert_pinned_region_status (this );
498498 }
499499
500500 {
You can’t perform that action at this time.
0 commit comments