< prev index next >
src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp
Print this page
rev 55429 : 8226311: Shenandoah: Concurrent evacuation of OopStorage backed weak roots
*** 23,40 ****
--- 23,109 ----
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
#include "classfile/classLoaderDataGraph.hpp"
+ #include "classfile/stringTable.hpp"
+ #include "classfile/systemDictionary.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 "prims/resolvedMethodTable.hpp"
#include "memory/resourceArea.hpp"
template <bool CONCURRENT>
+ inline ShenandoahWeakRoot<CONCURRENT>::ShenandoahWeakRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) :
+ _itr(storage), _phase(phase) {
+ }
+
+ template <bool CONCURRENT>
+ template <typename Closure>
+ inline void ShenandoahWeakRoot<CONCURRENT>::oops_do(Closure* 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::ThreadRoots, worker_id);
+ _itr.oops_do(cl);
+ }
+ }
+
+ inline ShenandoahWeakRoot<false>::ShenandoahWeakRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) :
+ _itr(storage), _phase(phase) {
+ }
+
+ template <typename IsAliveClosure, typename KeepAliveClosure>
+ void ShenandoahWeakRoot<false /* concurrent */>::weak_oops_do(IsAliveClosure* is_alive, KeepAliveClosure* keep_alive, uint worker_id) {
+ ShenandoahWorkerTimings* worker_times = ShenandoahHeap::heap()->phase_timings()->worker_times();
+ ShenandoahWorkerTimingsTracker timer(worker_times, _phase, worker_id);
+ _itr.weak_oops_do(is_alive, keep_alive);
+ }
+
+ template <bool CONCURRENT>
+ ShenandoahWeakRoots<CONCURRENT>::ShenandoahWeakRoots() :
+ _jni_roots(JNIHandles::weak_global_handles(), ShenandoahPhaseTimings::JNIWeakRoots),
+ _string_table_roots(StringTable::weak_storage(), ShenandoahPhaseTimings::StringTableRoots),
+ _resolved_method_table_roots(ResolvedMethodTable::weak_storage(), ShenandoahPhaseTimings::ResolvedMethodTableRoots),
+ _vm_roots(SystemDictionary::vm_weak_oop_storage(), ShenandoahPhaseTimings::VMWeakRoots) {
+ }
+
+ template <bool CONCURRENT>
+ template <typename Closure>
+ void ShenandoahWeakRoots<CONCURRENT>::oops_do(Closure* cl, uint worker_id) {
+ _jni_roots.oops_do(cl, worker_id);
+ _string_table_roots.oops_do(cl, worker_id);
+ _resolved_method_table_roots.oops_do(cl, worker_id);
+ _vm_roots.oops_do(cl, worker_id);
+ }
+
+ inline ShenandoahWeakRoots<false /* concurrent */>::ShenandoahWeakRoots() :
+ _jni_roots(JNIHandles::weak_global_handles(), ShenandoahPhaseTimings::JNIWeakRoots),
+ _string_table_roots(StringTable::weak_storage(), ShenandoahPhaseTimings::StringTableRoots),
+ _resolved_method_table_roots(ResolvedMethodTable::weak_storage(), ShenandoahPhaseTimings::ResolvedMethodTableRoots),
+ _vm_roots(SystemDictionary::vm_weak_oop_storage(), ShenandoahPhaseTimings::VMWeakRoots) {
+ }
+
+ template <typename IsAliveClosure, typename KeepAliveClosure>
+ void ShenandoahWeakRoots<false /* concurrent*/>::weak_oops_do(IsAliveClosure* is_alive, KeepAliveClosure* keep_alive, uint worker_id) {
+ _jni_roots.weak_oops_do(is_alive, keep_alive, worker_id);
+ _string_table_roots.weak_oops_do(is_alive, keep_alive, worker_id);
+ _resolved_method_table_roots.weak_oops_do(is_alive, keep_alive, worker_id);
+ _vm_roots.weak_oops_do(is_alive, keep_alive, worker_id);
+ }
+
+ template <typename Closure>
+ void ShenandoahWeakRoots<false /* concurrent */>::oops_do(Closure* cl, uint worker_id) {
+ AlwaysTrueClosure always_true;
+ weak_oops_do<AlwaysTrueClosure, Closure>(&always_true, cl, worker_id);
+ }
+
+ template <bool CONCURRENT>
ShenandoahJNIHandleRoots<CONCURRENT>::ShenandoahJNIHandleRoots() :
_itr(JNIHandles::global_handles()) {
}
template <bool CONCURRENT>
*** 47,61 ****
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 <typename ITR>
ShenandoahCodeCacheRoots<ITR>::ShenandoahCodeCacheRoots() {
nmethod::oops_do_marking_prologue();
}
--- 116,125 ----
*** 183,192 ****
if(_update_code_cache) {
_code_roots.code_blobs_do(&update_blobs, worker_id);
}
! _weak_roots.oops_do<IsAlive, KeepAlive>(is_alive, keep_alive, worker_id);
_dedup_roots.oops_do(is_alive, keep_alive, worker_id);
}
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
--- 247,257 ----
if(_update_code_cache) {
_code_roots.code_blobs_do(&update_blobs, worker_id);
}
! _serial_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
! _weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
_dedup_roots.oops_do(is_alive, keep_alive, worker_id);
}
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHROOTPROCESSOR_INLINE_HPP
< prev index next >