@@ -226,7 +226,6 @@ void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDC
226
226
!ShenandoahHeap::heap ()->unload_classes () ||
227
227
ShenandoahHeap::heap ()->is_traversal_mode (),
228
228
" Expect class unloading or traversal when Shenandoah cycle is running" );
229
- ShenandoahParallelOopsDoThreadClosure tc_cl (oops, code, tc);
230
229
ResourceMark rm;
231
230
232
231
_serial_roots.oops_do (oops, worker_id);
@@ -238,13 +237,16 @@ void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDC
238
237
assert (ShenandoahHeap::heap ()->is_concurrent_traversal_in_progress (), " Only possible with traversal GC" );
239
238
}
240
239
241
- _thread_roots.threads_do (&tc_cl, worker_id);
242
-
243
240
// With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
244
241
// and instead do that in concurrent phase under the relevant lock. This saves init mark
245
242
// pause time.
246
243
if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
247
244
_code_roots.code_blobs_do (code, worker_id);
245
+ ShenandoahParallelOopsDoThreadClosure tc_cl (oops, NULL , tc);
246
+ _thread_roots.threads_do (&tc_cl, worker_id);
247
+ } else {
248
+ ShenandoahParallelOopsDoThreadClosure tc_cl (oops, code, tc);
249
+ _thread_roots.threads_do (&tc_cl, worker_id);
248
250
}
249
251
250
252
AlwaysTrueClosure always_true;
0 commit comments