< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp

Print this page
rev 12384 : 8276201: Shenandoah: Race results degenerated GC to enter wrong entry point
Reviewed-by: shade

1645       set_unload_classes(heuristics()->can_unload_classes());
1646 
1647       if (_heap->process_references()) {
1648         ReferenceProcessor* rp = _heap->ref_processor();
1649         rp->set_active_mt_degree(_heap->workers()->active_workers());
1650 
1651         // enable ("weak") refs discovery
1652         rp->enable_discovery(true /*verify_no_refs*/, true);
1653         rp->setup_policy(_heap->collector_policy()->should_clear_all_soft_refs());
1654       }
1655 
1656       op_reset();
1657 
1658       op_init_mark();
1659       if (cancelled_gc()) {
1660         op_degenerated_fail();
1661         return;
1662       }
1663 
1664     case _degenerated_mark:

1665       op_final_mark();

1666       if (cancelled_gc()) {
1667         op_degenerated_fail();
1668         return;
1669       }
1670 
1671       op_cleanup_early();
1672 
1673     case _degenerated_evac:
1674       // If heuristics thinks we should do the cycle, this flag would be set,
1675       // and we can do evacuation. Otherwise, it would be the shortcut cycle.
1676       if (is_evacuation_in_progress()) {
1677 
1678         // Degeneration under oom-evac protocol might have left some objects in
1679         // collection set un-evacuated. Restart evacuation from the beginning to
1680         // capture all objects. For all the objects that are already evacuated,
1681         // it would be a simple check, which is supposed to be fast. This is also
1682         // safe to do even without degeneration, as CSet iterator is at beginning
1683         // in preparation for evacuation anyway.
1684         //
1685         // Before doing that, we need to make sure we never had any cset-pinned



1645       set_unload_classes(heuristics()->can_unload_classes());
1646 
1647       if (_heap->process_references()) {
1648         ReferenceProcessor* rp = _heap->ref_processor();
1649         rp->set_active_mt_degree(_heap->workers()->active_workers());
1650 
1651         // enable ("weak") refs discovery
1652         rp->enable_discovery(true /*verify_no_refs*/, true);
1653         rp->setup_policy(_heap->collector_policy()->should_clear_all_soft_refs());
1654       }
1655 
1656       op_reset();
1657 
1658       op_init_mark();
1659       if (cancelled_gc()) {
1660         op_degenerated_fail();
1661         return;
1662       }
1663 
1664     case _degenerated_mark:
1665       if (is_concurrent_mark_in_progress()) {
1666         op_final_mark();
1667       }
1668       if (cancelled_gc()) {
1669         op_degenerated_fail();
1670         return;
1671       }
1672 
1673       op_cleanup_early();
1674 
1675     case _degenerated_evac:
1676       // If heuristics thinks we should do the cycle, this flag would be set,
1677       // and we can do evacuation. Otherwise, it would be the shortcut cycle.
1678       if (is_evacuation_in_progress()) {
1679 
1680         // Degeneration under oom-evac protocol might have left some objects in
1681         // collection set un-evacuated. Restart evacuation from the beginning to
1682         // capture all objects. For all the objects that are already evacuated,
1683         // it would be a simple check, which is supposed to be fast. This is also
1684         // safe to do even without degeneration, as CSet iterator is at beginning
1685         // in preparation for evacuation anyway.
1686         //
1687         // Before doing that, we need to make sure we never had any cset-pinned


< prev index next >