8225582: Shenandoah: Enable concurrent evacuation of JNIHandles

Reviewed-by: rkennke, shade
This commit is contained in:
Zhengyu Gu 2019-06-19 08:52:15 -04:00
parent b870874d22
commit fe66fd327f
11 changed files with 207 additions and 38 deletions

View file

@ -71,10 +71,6 @@ void ShenandoahSerialRoots::oops_do(OopClosure* cl, uint worker_id) {
_jvmti_root.oops_do(cl, worker_id);
}
ShenandoahJNIHandleRoots::ShenandoahJNIHandleRoots() :
ShenandoahSerialRoot(&JNIHandles::oops_do, ShenandoahPhaseTimings::JNIRoots) {
}
ShenandoahThreadRoots::ShenandoahThreadRoots(bool is_par) : _is_par(is_par) {
Threads::change_thread_claim_token();
}
@ -148,21 +144,22 @@ ShenandoahRootProcessor::~ShenandoahRootProcessor() {
_heap->phase_timings()->record_workers_end(_phase);
}
ShenandoahRootEvacuator::ShenandoahRootEvacuator(uint n_workers, ShenandoahPhaseTimings::Phase phase) :
ShenandoahRootEvacuator::ShenandoahRootEvacuator(uint n_workers, ShenandoahPhaseTimings::Phase phase, bool include_concurrent_roots) :
ShenandoahRootProcessor(phase),
_thread_roots(n_workers > 1),
_weak_roots(n_workers) {
_weak_roots(n_workers),
_include_concurrent_roots(include_concurrent_roots) {
}
void ShenandoahRootEvacuator::roots_do(uint worker_id, OopClosure* oops) {
MarkingCodeBlobClosure blobsCl(oops, CodeBlobToOopClosure::FixRelocations);
CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong);
CLDToOopClosure* weak_clds = ShenandoahHeap::heap()->unload_classes() ? NULL : &clds;
AlwaysTrueClosure always_true;
_serial_roots.oops_do(oops, worker_id);
_jni_roots.oops_do(oops, worker_id);
if (_include_concurrent_roots) {
_jni_roots.oops_do<OopClosure>(oops, worker_id);
}
_thread_roots.oops_do(oops, NULL, worker_id);
_cld_roots.clds_do(&clds, &clds, worker_id);