< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahUtils.hpp

Print this page
rev 10546 : [backport] Wrap worker id in thread local worker session
rev 10612 : [backport] Wiring GC events to JFR + Restore heap occupancy in GC logs after JFR changes

*** 23,45 **** #ifndef SHARE_VM_GC_SHENANDOAHUTILS_HPP #define SHARE_VM_GC_SHENANDOAHUTILS_HPP #include "runtime/vmThread.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" #include "gc_implementation/shared/vmGCOperations.hpp" #include "memory/allocation.hpp" #include "gc_implementation/shenandoah/shenandoahPhaseTimings.hpp" class GCTimer; class ShenandoahGCSession : public StackObj { private: ! GCTimer* _timer; TraceMemoryManagerStats _trace_cycle; public: ! ShenandoahGCSession(); ~ShenandoahGCSession(); }; class ShenandoahGCPhase : public StackObj { private: --- 23,49 ---- #ifndef SHARE_VM_GC_SHENANDOAHUTILS_HPP #define SHARE_VM_GC_SHENANDOAHUTILS_HPP #include "runtime/vmThread.hpp" + #include "gc_interface/gcCause.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" #include "gc_implementation/shared/vmGCOperations.hpp" #include "memory/allocation.hpp" #include "gc_implementation/shenandoah/shenandoahPhaseTimings.hpp" class GCTimer; + class GCTracer; class ShenandoahGCSession : public StackObj { private: ! GCTimer* const _timer; ! GCTracer* const _tracer; ! TraceMemoryManagerStats _trace_cycle; public: ! ShenandoahGCSession(GCCause::Cause cause); ~ShenandoahGCSession(); }; class ShenandoahGCPhase : public StackObj { private:
*** 88,93 **** --- 92,111 ---- type == VM_Operation::VMOp_ShenandoahFullGC || type == VM_Operation::VMOp_ShenandoahDegeneratedGC; } }; + class ShenandoahWorkerSession : public StackObj { + static const uint INVALID_WORKER_ID = uint(-1); + public: + ShenandoahWorkerSession(uint worker_id); + ~ShenandoahWorkerSession(); + + static inline uint worker_id() { + Thread* thr = Thread::current(); + uint id = thr->worker_id(); + assert(id != INVALID_WORKER_ID, "Worker session has not been created"); + return id; + } + }; + #endif // SHARE_VM_GC_SHENANDOAHUTILS_HPP
< prev index next >