Skip to content

Commit 8f1ce78

Browse files
committedJun 2, 2023
8308752: Generational ZGC: Avoid final marking through stack chunks
Reviewed-by: stefank, aboldtch
1 parent 7b0a336 commit 8f1ce78

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
 

‎src/hotspot/share/gc/z/zMark.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,17 @@ void ZMark::follow_array_object(objArrayOop obj, bool finalizable) {
375375

376376
void ZMark::follow_object(oop obj, bool finalizable) {
377377
if (_generation->is_old()) {
378-
if (ZHeap::heap()->is_old(to_zaddress(obj))) {
379-
if (finalizable) {
380-
ZMarkBarrierFollowOopClosure<true /* finalizable */, ZGenerationIdOptional::old> cl;
381-
ZIterator::oop_iterate(obj, &cl);
382-
} else {
383-
ZMarkBarrierFollowOopClosure<false /* finalizable */, ZGenerationIdOptional::old> cl;
384-
ZIterator::oop_iterate(obj, &cl);
385-
}
378+
assert(ZHeap::heap()->is_old(to_zaddress(obj)), "Should only follow objects from old gen");
379+
if (obj->is_stackChunk()) {
380+
// No support for tracing through stack chunks as finalizably reachable
381+
ZMarkBarrierFollowOopClosure<false /* finalizable */, ZGenerationIdOptional::old> cl;
382+
ZIterator::oop_iterate(obj, &cl);
383+
} else if (finalizable) {
384+
ZMarkBarrierFollowOopClosure<true /* finalizable */, ZGenerationIdOptional::old> cl;
385+
ZIterator::oop_iterate(obj, &cl);
386386
} else {
387-
fatal("Catch me!");
387+
ZMarkBarrierFollowOopClosure<false /* finalizable */, ZGenerationIdOptional::old> cl;
388+
ZIterator::oop_iterate(obj, &cl);
388389
}
389390
} else {
390391
// Young gen must help out with old marking

0 commit comments

Comments
 (0)
Please sign in to comment.