284 // and we need to do update-refs. Otherwise, it would be the shortcut cycle.
285 if (heap->has_forwarded_objects()) {
286 op_init_update_refs();
287 assert(!heap->cancelled_gc(), "STW reference update can not OOM");
288 } else {
289 _abbreviated = true;
290 }
291
292 // labs are retired, walk the old regions and update remembered set
293 if (ShenandoahHeap::heap()->mode()->is_generational()) {
294 ShenandoahGenerationalHeap::heap()->old_generation()->update_card_table();
295 }
296
297 case _degenerated_update_refs:
298 if (heap->has_forwarded_objects()) {
299 op_update_refs();
300 op_update_roots();
301 assert(!heap->cancelled_gc(), "STW reference update can not OOM");
302 }
303
304 // Disarm nmethods that armed in concurrent cycle.
305 // In above case, update roots should disarm them
306 ShenandoahCodeRoots::disarm_nmethods();
307
308 op_cleanup_complete();
309
310 if (heap->mode()->is_generational()) {
311 ShenandoahGenerationalHeap::heap()->complete_degenerated_cycle();
312 }
313
314 break;
315 default:
316 ShouldNotReachHere();
317 }
318
319 DEBUG_ONLY(heap->assert_no_self_forwards());
320
321 if (ShenandoahVerify) {
322 heap->verifier()->verify_after_degenerated(_generation);
323 }
324
325 if (VerifyAfterGC) {
326 Universe::verify();
327 }
328
329 // Decide if this cycle made good progress, and, if not, should it upgrade to a full GC.
330 const bool progress = metrics.is_good_progress();
331 ShenandoahCollectorPolicy* policy = heap->shenandoah_policy();
332 policy->record_degenerated(_generation->is_young(), _abbreviated, progress);
333 if (progress) {
334 heap->notify_gc_progress();
335 _generation->heuristics()->record_degenerated(heap->mode()->is_generational() && _generation->is_global());
336 heap->start_idle_span();
337 } else if (policy->should_upgrade_degenerated_gc()) {
338 // Upgrade to full GC, register full-GC impact on heuristics.
339 op_degenerated_futile();
340 } else {
|
284 // and we need to do update-refs. Otherwise, it would be the shortcut cycle.
285 if (heap->has_forwarded_objects()) {
286 op_init_update_refs();
287 assert(!heap->cancelled_gc(), "STW reference update can not OOM");
288 } else {
289 _abbreviated = true;
290 }
291
292 // labs are retired, walk the old regions and update remembered set
293 if (ShenandoahHeap::heap()->mode()->is_generational()) {
294 ShenandoahGenerationalHeap::heap()->old_generation()->update_card_table();
295 }
296
297 case _degenerated_update_refs:
298 if (heap->has_forwarded_objects()) {
299 op_update_refs();
300 op_update_roots();
301 assert(!heap->cancelled_gc(), "STW reference update can not OOM");
302 }
303
304 op_cleanup_complete();
305
306 if (heap->mode()->is_generational()) {
307 ShenandoahGenerationalHeap::heap()->complete_degenerated_cycle();
308 }
309
310 break;
311 default:
312 ShouldNotReachHere();
313 }
314
315 DEBUG_ONLY(heap->assert_no_self_forwards());
316
317 // Leaving degenerated GC, we need to flip barriers back to idle.
318 ShenandoahCodeRoots::arm_nmethods();
319
320 if (ShenandoahVerify) {
321 heap->verifier()->verify_after_degenerated(_generation);
322 }
323
324 if (VerifyAfterGC) {
325 Universe::verify();
326 }
327
328 // Decide if this cycle made good progress, and, if not, should it upgrade to a full GC.
329 const bool progress = metrics.is_good_progress();
330 ShenandoahCollectorPolicy* policy = heap->shenandoah_policy();
331 policy->record_degenerated(_generation->is_young(), _abbreviated, progress);
332 if (progress) {
333 heap->notify_gc_progress();
334 _generation->heuristics()->record_degenerated(heap->mode()->is_generational() && _generation->is_global());
335 heap->start_idle_span();
336 } else if (policy->should_upgrade_degenerated_gc()) {
337 // Upgrade to full GC, register full-GC impact on heuristics.
338 op_degenerated_futile();
339 } else {
|