@@ -482,17 +482,14 @@ bool ShenandoahGenerationalControlThread::resume_concurrent_old_cycle(Shenandoah
482482 }
483483
484484 if (_heap->cancelled_gc ()) {
485- // It's possible the gc cycle was cancelled after the last time
486- // the collection checked for cancellation. In which case, the
487- // old gc cycle is still completed, and we have to deal with this
488- // cancellation. We set the degeneration point to be outside
489- // the cycle because if this is an allocation failure, that is
490- // what must be done (there is no degenerated old cycle). If the
491- // cancellation was due to a heuristic wanting to start a young
492- // cycle, then we are not actually going to a degenerated cycle,
493- // so the degenerated point doesn't matter here.
494- check_cancellation_or_degen (ShenandoahGC::_degenerated_outside_cycle);
495- if (cause == GCCause::_shenandoah_concurrent_gc) {
485+ // It's possible the gc cycle was cancelled after the last time the collection checked for cancellation. In which
486+ // case, the old gc cycle is still completed, and we have to deal with this cancellation. We set the degeneration
487+ // point to be outside the cycle because if this is an allocation failure, that is what must be done (there is no
488+ // degenerated old cycle). If the cancellation was due to a heuristic wanting to start a young cycle, then we are
489+ // not actually going to a degenerated cycle, so don't set the degeneration point here.
490+ if (ShenandoahCollectorPolicy::is_allocation_failure (cause)) {
491+ check_cancellation_or_degen (ShenandoahGC::_degenerated_outside_cycle);
492+ } else if (cause == GCCause::_shenandoah_concurrent_gc) {
496493 _heap->shenandoah_policy ()->record_interrupted_old ();
497494 }
498495 return false ;
0 commit comments