Skip to content

Commit 636b563

Browse files
author
William Kemper
committed
8357550: GenShen crashes during freeze: assert(!chunk->requires_barriers()) failed
Reviewed-by: shade Backport-of: 17cf497
1 parent fe9efb7 commit 636b563

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,29 @@ void ShenandoahGenerationalHeap::stop() {
183183
regulator_thread()->stop();
184184
}
185185

186+
bool ShenandoahGenerationalHeap::requires_barriers(stackChunkOop obj) const {
187+
if (is_idle()) {
188+
return false;
189+
}
190+
191+
if (is_concurrent_young_mark_in_progress() && is_in_young(obj) && !marking_context()->allocated_after_mark_start(obj)) {
192+
// We are marking young, this object is in young, and it is below the TAMS
193+
return true;
194+
}
195+
196+
if (is_in_old(obj)) {
197+
// Card marking barriers are required for objects in the old generation
198+
return true;
199+
}
200+
201+
if (has_forwarded_objects()) {
202+
// Object may have pointers that need to be updated
203+
return true;
204+
}
205+
206+
return false;
207+
}
208+
186209
void ShenandoahGenerationalHeap::evacuate_collection_set(bool concurrent) {
187210
ShenandoahRegionIterator regions;
188211
ShenandoahGenerationalEvacuationTask task(this, &regions, concurrent, false /* only promote regions */);

src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ class ShenandoahGenerationalHeap : public ShenandoahHeap {
128128

129129
void stop() override;
130130

131+
bool requires_barriers(stackChunkOop obj) const override;
132+
131133
// Used for logging the result of a region transfer outside the heap lock
132134
struct TransferResult {
133135
bool success;

0 commit comments

Comments
 (0)