src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
changeset 55428 e9da3a44a7ed
parent 55335 f7cc25dda38a
child 55444 6a7d6b6bbd78
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Wed Jun 19 12:17:22 2019 +0100
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Wed Jun 19 08:52:15 2019 -0400
@@ -71,10 +71,6 @@
   _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 @@
   _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);