mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-20 18:37:51 +00:00
8370667: GenShen: Only make assertions about region pinning for collected generation
Reviewed-by: xpeng, ysr
This commit is contained in:
parent
c69e0eb2f9
commit
c6eea8acf6
@ -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.
|
||||
|
||||
|
||||
@ -2419,11 +2419,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
|
||||
|
||||
@ -669,7 +669,8 @@ public:
|
||||
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
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user