@@ -390,21 +390,23 @@ void ShenandoahConcurrentMark::initialize(uint workers) {
390
390
}
391
391
392
392
void ShenandoahConcurrentMark::concurrent_scan_code_roots (uint worker_id, ReferenceProcessor* rp) {
393
+ if (_heap->unload_classes ()) {
394
+ return ;
395
+ }
396
+
393
397
if (claim_codecache ()) {
394
398
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);
408
410
}
409
411
}
410
412
}
0 commit comments