mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8240917: Shenandoah: Avoid scanning thread code roots twice in all root scanner
Reviewed-by: rkennke
This commit is contained in:
parent
e5ab701157
commit
71e1277fb3
1 changed files with 5 additions and 3 deletions
|
@ -226,7 +226,6 @@ void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDC
|
||||||
!ShenandoahHeap::heap()->unload_classes() ||
|
!ShenandoahHeap::heap()->unload_classes() ||
|
||||||
ShenandoahHeap::heap()->is_traversal_mode(),
|
ShenandoahHeap::heap()->is_traversal_mode(),
|
||||||
"Expect class unloading or traversal when Shenandoah cycle is running");
|
"Expect class unloading or traversal when Shenandoah cycle is running");
|
||||||
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
|
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
|
|
||||||
_serial_roots.oops_do(oops, worker_id);
|
_serial_roots.oops_do(oops, worker_id);
|
||||||
|
@ -238,13 +237,16 @@ void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDC
|
||||||
assert(ShenandoahHeap::heap()->is_concurrent_traversal_in_progress(), "Only possible with traversal GC");
|
assert(ShenandoahHeap::heap()->is_concurrent_traversal_in_progress(), "Only possible with traversal GC");
|
||||||
}
|
}
|
||||||
|
|
||||||
_thread_roots.threads_do(&tc_cl, worker_id);
|
|
||||||
|
|
||||||
// With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
|
// With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
|
||||||
// and instead do that in concurrent phase under the relevant lock. This saves init mark
|
// and instead do that in concurrent phase under the relevant lock. This saves init mark
|
||||||
// pause time.
|
// pause time.
|
||||||
if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
|
if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
|
||||||
_code_roots.code_blobs_do(code, worker_id);
|
_code_roots.code_blobs_do(code, worker_id);
|
||||||
|
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, NULL, tc);
|
||||||
|
_thread_roots.threads_do(&tc_cl, worker_id);
|
||||||
|
} else {
|
||||||
|
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc);
|
||||||
|
_thread_roots.threads_do(&tc_cl, worker_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
AlwaysTrueClosure always_true;
|
AlwaysTrueClosure always_true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue