src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
changeset 54058 be40860e8227
parent 53536 482109fae02b
child 54103 8b61a38be0c5
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Mon Mar 11 13:37:56 2019 -0400
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Mon Mar 11 14:06:05 2019 -0400
@@ -34,7 +34,7 @@
 #include "gc/shenandoah/shenandoahTimingTracker.hpp"
 #include "gc/shenandoah/shenandoahUtils.hpp"
 #include "gc/shenandoah/shenandoahVMOperations.hpp"
-#include "gc/shared/weakProcessor.hpp"
+#include "gc/shared/weakProcessor.inline.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/iterator.hpp"
 #include "memory/resourceArea.hpp"
@@ -47,7 +47,8 @@
   _srs(n_workers),
   _par_state_string(StringTable::weak_storage()),
   _phase(phase),
-  _coderoots_all_iterator(ShenandoahCodeRoots::iterator())
+  _coderoots_all_iterator(ShenandoahCodeRoots::iterator()),
+  _weak_processor_task(n_workers)
 {
   heap->phase_timings()->record_workers_start(_phase);
 
@@ -192,10 +193,9 @@
     SystemDictionary::oops_do(strong_roots);
   }
   if (jni_weak_roots != NULL) {
-    if (_process_strong_tasks->try_claim_task(SHENANDOAH_RP_PS_JNIHandles_weak_oops_do)) {
       ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::JNIWeakRoots, worker_id);
-      WeakProcessor::oops_do(jni_weak_roots);
-    }
+      AlwaysTrueClosure always_true;
+      _weak_processor_task.work<AlwaysTrueClosure, OopClosure>(worker_id, &always_true, jni_weak_roots);
   }
 
   if (ShenandoahStringDedup::is_enabled() && weak_roots != NULL) {