134 const SvcGCMarker _svc_gc_mark;
135 const IsGCActiveMark _is_gc_active_mark;
136 TraceMemoryManagerStats _trace_pause;
137
138 public:
139 ShenandoahGCPauseMark(uint gc_id, SvcGCMarker::reason_type type);
140 };
141
142 class ShenandoahSafepoint : public AllStatic {
143 public:
144 // check if Shenandoah GC safepoint is in progress
145 static inline bool is_at_shenandoah_safepoint() {
146 if (!SafepointSynchronize::is_at_safepoint()) return false;
147
148 VM_Operation* vm_op = VMThread::vm_operation();
149 if (vm_op == NULL) return false;
150
151 VM_Operation::VMOp_Type type = vm_op->type();
152 return type == VM_Operation::VMOp_ShenandoahInitMark ||
153 type == VM_Operation::VMOp_ShenandoahFinalMarkStartEvac ||
154 type == VM_Operation::VMOp_ShenandoahInitUpdateRefs ||
155 type == VM_Operation::VMOp_ShenandoahFinalUpdateRefs ||
156 type == VM_Operation::VMOp_ShenandoahFullGC ||
157 type == VM_Operation::VMOp_ShenandoahDegeneratedGC;
158 }
159 };
160
161 class ShenandoahWorkerSession : public StackObj {
162 protected:
163 uint _worker_id;
164
165 ShenandoahWorkerSession(uint worker_id);
166 ~ShenandoahWorkerSession();
167 public:
168 static inline uint worker_id() {
169 Thread* thr = Thread::current();
170 uint id = ShenandoahThreadLocalData::worker_id(thr);
171 assert(id != ShenandoahThreadLocalData::INVALID_WORKER_ID, "Worker session has not been created");
172 return id;
173 }
174 };
175
|
134 const SvcGCMarker _svc_gc_mark;
135 const IsGCActiveMark _is_gc_active_mark;
136 TraceMemoryManagerStats _trace_pause;
137
138 public:
139 ShenandoahGCPauseMark(uint gc_id, SvcGCMarker::reason_type type);
140 };
141
142 class ShenandoahSafepoint : public AllStatic {
143 public:
144 // check if Shenandoah GC safepoint is in progress
145 static inline bool is_at_shenandoah_safepoint() {
146 if (!SafepointSynchronize::is_at_safepoint()) return false;
147
148 VM_Operation* vm_op = VMThread::vm_operation();
149 if (vm_op == NULL) return false;
150
151 VM_Operation::VMOp_Type type = vm_op->type();
152 return type == VM_Operation::VMOp_ShenandoahInitMark ||
153 type == VM_Operation::VMOp_ShenandoahFinalMarkStartEvac ||
154 type == VM_Operation::VMOp_ShenandoahInitEvacUpdate ||
155 type == VM_Operation::VMOp_ShenandoahFinalEvacUpdate ||
156 type == VM_Operation::VMOp_ShenandoahFullGC ||
157 type == VM_Operation::VMOp_ShenandoahDegeneratedGC;
158 }
159 };
160
161 class ShenandoahWorkerSession : public StackObj {
162 protected:
163 uint _worker_id;
164
165 ShenandoahWorkerSession(uint worker_id);
166 ~ShenandoahWorkerSession();
167 public:
168 static inline uint worker_id() {
169 Thread* thr = Thread::current();
170 uint id = ShenandoahThreadLocalData::worker_id(thr);
171 assert(id != ShenandoahThreadLocalData::INVALID_WORKER_ID, "Worker session has not been created");
172 return id;
173 }
174 };
175
|