Skip to content

Commit a2a64da

Browse files
Xiaolong PengPaul Hohensee
authored andcommitted
8352588: GenShen: Enabling JFR asserts when getting GCId
Reviewed-by: wkemper, ysr
1 parent 79bffe2 commit a2a64da

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ void ShenandoahControlThread::run_service() {
135135
// GC is starting, bump the internal ID
136136
update_gc_id();
137137

138+
GCIdMark gc_id_mark;
139+
138140
heuristics->cancel_trigger_request();
139141

140142
heap->reset_bytes_allocated_since_gc_start();
@@ -299,7 +301,6 @@ void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cau
299301
ShenandoahHeap* heap = ShenandoahHeap::heap();
300302
if (check_cancellation_or_degen(ShenandoahGC::_degenerated_outside_cycle)) return;
301303

302-
GCIdMark gc_id_mark;
303304
ShenandoahGCSession session(cause, heap->global_generation());
304305

305306
TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
@@ -343,7 +344,6 @@ void ShenandoahControlThread::stop_service() {
343344

344345
void ShenandoahControlThread::service_stw_full_cycle(GCCause::Cause cause) {
345346
ShenandoahHeap* const heap = ShenandoahHeap::heap();
346-
GCIdMark gc_id_mark;
347347
ShenandoahGCSession session(cause, heap->global_generation());
348348

349349
ShenandoahFullGC gc;
@@ -353,7 +353,6 @@ void ShenandoahControlThread::service_stw_full_cycle(GCCause::Cause cause) {
353353
void ShenandoahControlThread::service_stw_degenerated_cycle(GCCause::Cause cause, ShenandoahGC::ShenandoahDegenPoint point) {
354354
assert (point != ShenandoahGC::_degenerated_unset, "Degenerated point should be set");
355355
ShenandoahHeap* const heap = ShenandoahHeap::heap();
356-
GCIdMark gc_id_mark;
357356
ShenandoahGCSession session(cause, heap->global_generation());
358357

359358
ShenandoahDegenGC gc(point, heap->global_generation());

src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ void ShenandoahGenerationalControlThread::run_gc_cycle(const ShenandoahGCRequest
233233
// GC is starting, bump the internal ID
234234
update_gc_id();
235235

236+
GCIdMark gc_id_mark;
237+
236238
_heap->reset_bytes_allocated_since_gc_start();
237239

238240
MetaspaceCombinedStats meta_sizes = MetaspaceUtils::get_combined_statistics();
@@ -263,7 +265,6 @@ void ShenandoahGenerationalControlThread::run_gc_cycle(const ShenandoahGCRequest
263265
}
264266
case servicing_old: {
265267
assert(request.generation->is_old(), "Expected old generation here");
266-
GCIdMark gc_id_mark;
267268
service_concurrent_old_cycle(request);
268269
break;
269270
}
@@ -386,7 +387,6 @@ void ShenandoahGenerationalControlThread::process_phase_timings() const {
386387
// +---> Global Degen +--------------------> Full <----+
387388
//
388389
void ShenandoahGenerationalControlThread::service_concurrent_normal_cycle(const ShenandoahGCRequest& request) {
389-
GCIdMark gc_id_mark;
390390
log_info(gc, ergo)("Start GC cycle (%s)", request.generation->name());
391391
if (request.generation->is_old()) {
392392
service_concurrent_old_cycle(request);
@@ -621,7 +621,6 @@ bool ShenandoahGenerationalControlThread::check_cancellation_or_degen(Shenandoah
621621
}
622622

623623
void ShenandoahGenerationalControlThread::service_stw_full_cycle(GCCause::Cause cause) {
624-
GCIdMark gc_id_mark;
625624
ShenandoahGCSession session(cause, _heap->global_generation());
626625
maybe_set_aging_cycle();
627626
ShenandoahFullGC gc;
@@ -632,7 +631,6 @@ void ShenandoahGenerationalControlThread::service_stw_full_cycle(GCCause::Cause
632631
void ShenandoahGenerationalControlThread::service_stw_degenerated_cycle(const ShenandoahGCRequest& request) {
633632
assert(_degen_point != ShenandoahGC::_degenerated_unset, "Degenerated point should be set");
634633

635-
GCIdMark gc_id_mark;
636634
ShenandoahGCSession session(request.cause, request.generation);
637635

638636
ShenandoahDegenGC gc(_degen_point, request.generation);

0 commit comments

Comments
 (0)