33
34 // The concurrent mark thread triggers the various steps of the concurrent marking
35 // cycle, including various marking cleanup.
36 //
37 // The concurrent cycle may either be "Full" (i.e. include marking, rebuilding and
38 // scrubbing, resetting for the next cycle) or "Undo", i.e. shortened to just the
39 // reset part.
40 class G1ConcurrentMarkThread: public ConcurrentGCThread {
41 G1ConcurrentMark* _cm;
42
43 enum ServiceState : uint {
44 Idle,
45 FullCycleMarking,
46 FullCycleRebuildOrScrub,
47 FullCycleResetForNextCycle,
48 UndoCycleResetForNextCycle
49 };
50
51 Atomic<ServiceState> _state;
52
53 ServiceState state() const { return _state.load_relaxed(); }
54
55 // Returns whether we are in a "Full" cycle.
56 bool is_in_full_concurrent_cycle() const;
57
58 // Wait for next cycle. Returns the command passed over.
59 bool wait_for_next_cycle();
60
61 bool mark_loop_needs_restart() const;
62
63 // Phases and subphases for the full concurrent cycle in order.
64 //
65 // All these methods return true if the cycle should be aborted.
66 bool phase_clear_cld_claimed_marks();
67 bool phase_scan_root_regions();
68
69 bool phase_mark_loop();
70 bool subphase_mark_from_roots();
71 bool subphase_preclean();
72 bool subphase_delay_to_keep_mmu_before_remark();
73 bool subphase_remark();
|
33
34 // The concurrent mark thread triggers the various steps of the concurrent marking
35 // cycle, including various marking cleanup.
36 //
37 // The concurrent cycle may either be "Full" (i.e. include marking, rebuilding and
38 // scrubbing, resetting for the next cycle) or "Undo", i.e. shortened to just the
39 // reset part.
40 class G1ConcurrentMarkThread: public ConcurrentGCThread {
41 G1ConcurrentMark* _cm;
42
43 enum ServiceState : uint {
44 Idle,
45 FullCycleMarking,
46 FullCycleRebuildOrScrub,
47 FullCycleResetForNextCycle,
48 UndoCycleResetForNextCycle
49 };
50
51 Atomic<ServiceState> _state;
52
53 ServiceState state() const { return _state.load_acquire(); }
54 void set_state(ServiceState new_state) { _state.release_store(new_state); }
55
56 // Returns whether we are in a "Full" cycle.
57 bool is_in_full_concurrent_cycle() const;
58
59 // Wait for next cycle. Returns the command passed over.
60 bool wait_for_next_cycle();
61
62 bool mark_loop_needs_restart() const;
63
64 // Phases and subphases for the full concurrent cycle in order.
65 //
66 // All these methods return true if the cycle should be aborted.
67 bool phase_clear_cld_claimed_marks();
68 bool phase_scan_root_regions();
69
70 bool phase_mark_loop();
71 bool subphase_mark_from_roots();
72 bool subphase_preclean();
73 bool subphase_delay_to_keep_mmu_before_remark();
74 bool subphase_remark();
|