Skip to content

Commit 4f9020f

Browse files
committedMay 29, 2020
8245880: Shenandoah: check class unloading flag early in concurrent code root scan
Reviewed-by: shade
1 parent d101efc commit 4f9020f

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp

+15-13
Original file line numberDiff line numberDiff line change
@@ -390,21 +390,23 @@ void ShenandoahConcurrentMark::initialize(uint workers) {
390390
}
391391

392392
void ShenandoahConcurrentMark::concurrent_scan_code_roots(uint worker_id, ReferenceProcessor* rp) {
393+
if (_heap->unload_classes()) {
394+
return;
395+
}
396+
393397
if (claim_codecache()) {
394398
ShenandoahObjToScanQueue* q = task_queues()->queue(worker_id);
395-
if (!_heap->unload_classes()) {
396-
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
397-
// TODO: We can not honor StringDeduplication here, due to lock ranking
398-
// inversion. So, we may miss some deduplication candidates.
399-
if (_heap->has_forwarded_objects()) {
400-
ShenandoahMarkResolveRefsClosure cl(q, rp);
401-
CodeBlobToOopClosure blobs(&cl, !CodeBlobToOopClosure::FixRelocations);
402-
CodeCache::blobs_do(&blobs);
403-
} else {
404-
ShenandoahMarkRefsClosure cl(q, rp);
405-
CodeBlobToOopClosure blobs(&cl, !CodeBlobToOopClosure::FixRelocations);
406-
CodeCache::blobs_do(&blobs);
407-
}
399+
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
400+
// TODO: We can not honor StringDeduplication here, due to lock ranking
401+
// inversion. So, we may miss some deduplication candidates.
402+
if (_heap->has_forwarded_objects()) {
403+
ShenandoahMarkResolveRefsClosure cl(q, rp);
404+
CodeBlobToOopClosure blobs(&cl, !CodeBlobToOopClosure::FixRelocations);
405+
CodeCache::blobs_do(&blobs);
406+
} else {
407+
ShenandoahMarkRefsClosure cl(q, rp);
408+
CodeBlobToOopClosure blobs(&cl, !CodeBlobToOopClosure::FixRelocations);
409+
CodeCache::blobs_do(&blobs);
408410
}
409411
}
410412
}

0 commit comments

Comments
 (0)
Please sign in to comment.