Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ShenandoahGenerationalHeuristics::choose_collection_set(ShenandoahCollectio


// Check all pinned regions have updated status before choosing the collection set.
heap->assert_pinned_region_status();
heap->assert_pinned_region_status(_generation);

// Step 1. Build up the region candidates we care about, rejecting losers and accepting winners right away.

Expand Down
12 changes: 9 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2412,11 +2412,17 @@ void ShenandoahHeap::sync_pinned_region_status() {
}

#ifdef ASSERT
void ShenandoahHeap::assert_pinned_region_status() {
void ShenandoahHeap::assert_pinned_region_status() const {
assert_pinned_region_status(global_generation());
}

void ShenandoahHeap::assert_pinned_region_status(ShenandoahGeneration* generation) const {
for (size_t i = 0; i < num_regions(); i++) {
ShenandoahHeapRegion* r = get_region(i);
assert((r->is_pinned() && r->pin_count() > 0) || (!r->is_pinned() && r->pin_count() == 0),
"Region %zu pinning status is inconsistent", i);
if (generation->contains(r)) {
assert((r->is_pinned() && r->pin_count() > 0) || (!r->is_pinned() && r->pin_count() == 0),
"Region %zu pinning status is inconsistent", i);
}
}
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ class ShenandoahHeap : public CollectedHeap {
void unpin_object(JavaThread* thread, oop obj) override;

void sync_pinned_region_status();
void assert_pinned_region_status() NOT_DEBUG_RETURN;
void assert_pinned_region_status() const NOT_DEBUG_RETURN;
void assert_pinned_region_status(ShenandoahGeneration* generation) const NOT_DEBUG_RETURN;

// ---------- CDS archive support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ void ShenandoahOldGeneration::prepare_regions_and_collection_set(bool concurrent
ShenandoahFinalMarkUpdateRegionStateClosure cl(complete_marking_context());

parallel_heap_region_iterate(&cl);
heap->assert_pinned_region_status();
heap->assert_pinned_region_status(this);
}

{
Expand Down