Skip to content

Commit 8330339

Browse files
Fix safepoint worker handling
1 parent dc931cb commit 8330339

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,9 @@ void ShenandoahHeap::concurrent_retire_gc_labs() {
12371237

12381238
// Safepoint workers may be asked to evacuate objects if they are visiting oops to create a heap dump
12391239
// during a concurrent evacuation phase. These threads will _not_ be used during a degenerated cycle.
1240-
safepoint_workers()->threads_do(&retire);
1240+
if (safepoint_workers() != nullptr) {
1241+
safepoint_workers()->threads_do(&retire);
1242+
}
12411243

12421244
// A degenerated cycle won't attempt to use LABs from the mutator threads
12431245
ShenandoahRetireJavaGCLABClosure retire_java_labs;
@@ -1400,14 +1402,6 @@ class ShenandoahCheckCleanGCLABClosure : public ThreadClosure {
14001402
}
14011403
};
14021404

1403-
class ShenandoahAssertNoLabs : public ThreadClosure {
1404-
public:
1405-
void do_thread(Thread* thread) override {
1406-
assert(ShenandoahThreadLocalData::gclab(thread) == nullptr, "Thread should not have GCLAB");
1407-
assert(ShenandoahThreadLocalData::plab(thread) == nullptr, "Thread should not have PLAB");
1408-
}
1409-
};
1410-
14111405
void ShenandoahHeap::labs_make_parsable() {
14121406
assert(UseTLAB, "Only call with UseTLAB");
14131407

@@ -1458,8 +1452,7 @@ void ShenandoahHeap::gclabs_retire(bool resize) {
14581452
workers()->threads_do(&cl);
14591453

14601454
if (safepoint_workers() != nullptr) {
1461-
ShenandoahAssertNoLabs no_labs;
1462-
safepoint_workers()->threads_do(&no_labs);
1455+
safepoint_workers()->threads_do(&cl);
14631456
}
14641457
}
14651458

0 commit comments

Comments
 (0)