comparison src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp @ 794:315a5d70b295

6484957: G1: parallel concurrent refinement 6826318: G1: remove traversal-based refinement code Summary: Removed traversal-based refinement code as it's no longer used. Made the concurrent refinement (queue-based) parallel. Reviewed-by: tonyp
author iveresov
date Mon, 11 May 2009 16:30:56 -0700
parents 0fbdb4381b99
children 215f81b4d9b3
comparison
equal deleted inserted replaced
758:9b3a41ccc927 794:315a5d70b295
24 24
25 // Forward decl 25 // Forward decl
26 class ConcurrentG1RefineThread; 26 class ConcurrentG1RefineThread;
27 class G1RemSet; 27 class G1RemSet;
28 28
29 // What to do after a yield:
30 enum PostYieldAction {
31 PYA_continue, // Continue the traversal
32 PYA_restart, // Restart
33 PYA_cancel // It's been completed by somebody else: cancel.
34 };
35
36 class ConcurrentG1Refine: public CHeapObj { 29 class ConcurrentG1Refine: public CHeapObj {
37 ConcurrentG1RefineThread* _cg1rThread; 30 ConcurrentG1RefineThread** _threads;
38 31 int _n_threads;
39 volatile jint _pya;
40 PostYieldAction _last_pya;
41
42 static bool _enabled; // Protected by G1ConcRefine_mon.
43 unsigned _traversals;
44
45 // Number of cards processed during last refinement traversal.
46 unsigned _first_traversal;
47 unsigned _last_cards_during;
48 32
49 // The cache for card refinement. 33 // The cache for card refinement.
50 bool _use_cache; 34 bool _use_cache;
51 bool _def_use_cache; 35 bool _def_use_cache;
52 size_t _n_periods; 36 size_t _n_periods;
72 public: 56 public:
73 ConcurrentG1Refine(); 57 ConcurrentG1Refine();
74 ~ConcurrentG1Refine(); 58 ~ConcurrentG1Refine();
75 59
76 void init(); // Accomplish some initialization that has to wait. 60 void init(); // Accomplish some initialization that has to wait.
61 void stop();
77 62
78 // Enabled Conc refinement, waking up thread if necessary. 63 // Iterate over the conc refine threads
79 void enable(); 64 void threads_do(ThreadClosure *tc);
80
81 // Returns the number of traversals performed since this refiner was enabled.
82 unsigned disable();
83
84 // Requires G1ConcRefine_mon to be held.
85 bool enabled() { return _enabled; }
86
87 // Returns only when G1 concurrent refinement has been enabled.
88 void wait_for_ConcurrentG1Refine_enabled();
89
90 // Do one concurrent refinement pass over the card table. Returns "true"
91 // if heuristics determine that another pass should be done immediately.
92 bool refine();
93
94 // Indicate that an in-progress refinement pass should start over.
95 void set_pya_restart();
96 // Indicate that an in-progress refinement pass should quit.
97 void set_pya_cancel();
98
99 // Get the appropriate post-yield action. Also sets last_pya.
100 PostYieldAction get_pya();
101
102 // The last PYA read by "get_pya".
103 PostYieldAction get_last_pya();
104
105 bool do_traversal();
106
107 ConcurrentG1RefineThread* cg1rThread() { return _cg1rThread; }
108 65
109 // If this is the first entry for the slot, writes into the cache and 66 // If this is the first entry for the slot, writes into the cache and
110 // returns NULL. If it causes an eviction, returns the evicted pointer. 67 // returns NULL. If it causes an eviction, returns the evicted pointer.
111 // Otherwise, its a cache hit, and returns NULL. 68 // Otherwise, its a cache hit, and returns NULL.
112 jbyte* cache_insert(jbyte* card_ptr); 69 jbyte* cache_insert(jbyte* card_ptr);