< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp

Print this page

        

*** 22,83 **** */ #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP #define SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP - #include "classfile/classLoaderDataGraph.hpp" - #include "gc/shared/oopStorageParState.inline.hpp" #include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahRootProcessor.hpp" #include "gc/shenandoah/shenandoahTimingTracker.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" #include "memory/resourceArea.hpp" - #include "runtime/safepoint.hpp" - - template <bool CONCURRENT> - ShenandoahJNIHandleRoots<CONCURRENT>::ShenandoahJNIHandleRoots() : - _itr(JNIHandles::global_handles()) { - } - - template <bool CONCURRENT> - template <typename T> - void ShenandoahJNIHandleRoots<CONCURRENT>::oops_do(T* cl, uint worker_id) { - if (CONCURRENT) { - _itr.oops_do(cl); - } else { - ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times(); - ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::JNIRoots, worker_id); - _itr.oops_do(cl); - } - } template <typename IsAlive, typename KeepAlive> void ShenandoahWeakRoots::oops_do(IsAlive* is_alive, KeepAlive* keep_alive, uint worker_id) { _task.work<IsAlive, KeepAlive>(worker_id, is_alive, keep_alive); } - template <bool SINGLE_THREADED> - ShenandoahClassLoaderDataRoots<SINGLE_THREADED>::ShenandoahClassLoaderDataRoots() { - if (!SINGLE_THREADED) { - ClassLoaderDataGraph::clear_claimed_marks(); - } - } - - template <bool SINGLE_THREADED> - void ShenandoahClassLoaderDataRoots<SINGLE_THREADED>::clds_do(CLDClosure* strong_clds, CLDClosure* weak_clds, uint worker_id) { - if (SINGLE_THREADED) { - assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); - assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread"); - - ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds); - } else { - ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times(); - ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::CLDGRoots, worker_id); - ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds); - } - } - template <typename ITR> ShenandoahCodeCacheRoots<ITR>::ShenandoahCodeCacheRoots() { nmethod::oops_do_marking_prologue(); } --- 22,42 ----
*** 138,148 **** "Expect class unloading or traversal when Shenandoah cycle is running"); ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc); ResourceMark rm; _serial_roots.oops_do(oops, worker_id); - _jni_roots.oops_do(oops, worker_id); _cld_roots.clds_do(clds, clds, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); // 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 --- 97,106 ----
*** 157,167 **** assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading"); ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc); ResourceMark rm; _serial_roots.oops_do(oops, worker_id); - _jni_roots.oops_do(oops, worker_id); _cld_roots.clds_do(clds, NULL, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); } template <typename IsAlive, typename KeepAlive> --- 115,124 ----
*** 169,179 **** CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations); CLDToOopClosure clds(keep_alive, ClassLoaderData::_claim_strong); CLDToOopClosure* weak_clds = ShenandoahHeap::heap()->unload_classes() ? NULL : &clds; _serial_roots.oops_do(keep_alive, worker_id); - _jni_roots.oops_do(keep_alive, worker_id); _thread_roots.oops_do(keep_alive, NULL, worker_id); _cld_roots.clds_do(&clds, weak_clds, worker_id); if(_update_code_cache) { --- 126,135 ----
< prev index next >