34 class G1CMBitMap; |
34 class G1CMBitMap; |
35 class G1CMTask; |
35 class G1CMTask; |
36 class G1ConcurrentMark; |
36 class G1ConcurrentMark; |
37 class ConcurrentGCTimer; |
37 class ConcurrentGCTimer; |
38 class G1OldTracer; |
38 class G1OldTracer; |
|
39 class G1SurvivorRegions; |
39 typedef GenericTaskQueue<oop, mtGC> G1CMTaskQueue; |
40 typedef GenericTaskQueue<oop, mtGC> G1CMTaskQueue; |
40 typedef GenericTaskQueueSet<G1CMTaskQueue, mtGC> G1CMTaskQueueSet; |
41 typedef GenericTaskQueueSet<G1CMTaskQueue, mtGC> G1CMTaskQueueSet; |
41 |
42 |
42 // Closure used by CM during concurrent reference discovery |
43 // Closure used by CM during concurrent reference discovery |
43 // and reference processing (during remarking) to determine |
44 // and reference processing (during remarking) to determine |
201 // Apply fn to each oop in the mark stack, up to the bound recorded |
202 // Apply fn to each oop in the mark stack, up to the bound recorded |
202 // via one of the above "note" functions. The mark stack must not |
203 // via one of the above "note" functions. The mark stack must not |
203 // be modified while iterating. |
204 // be modified while iterating. |
204 template<typename Fn> void iterate(Fn fn); |
205 template<typename Fn> void iterate(Fn fn); |
205 }; |
206 }; |
206 |
|
207 class YoungList; |
|
208 |
207 |
209 // Root Regions are regions that are not empty at the beginning of a |
208 // Root Regions are regions that are not empty at the beginning of a |
210 // marking cycle and which we might collect during an evacuation pause |
209 // marking cycle and which we might collect during an evacuation pause |
211 // while the cycle is active. Given that, during evacuation pauses, we |
210 // while the cycle is active. Given that, during evacuation pauses, we |
212 // do not copy objects that are explicitly marked, what we have to do |
211 // do not copy objects that are explicitly marked, what we have to do |
219 // Currently, we only support root region scanning once (at the start |
218 // Currently, we only support root region scanning once (at the start |
220 // of the marking cycle) and the root regions are all the survivor |
219 // of the marking cycle) and the root regions are all the survivor |
221 // regions populated during the initial-mark pause. |
220 // regions populated during the initial-mark pause. |
222 class G1CMRootRegions VALUE_OBJ_CLASS_SPEC { |
221 class G1CMRootRegions VALUE_OBJ_CLASS_SPEC { |
223 private: |
222 private: |
224 YoungList* _young_list; |
223 const G1SurvivorRegions* _survivors; |
225 G1ConcurrentMark* _cm; |
224 G1ConcurrentMark* _cm; |
226 |
225 |
227 volatile bool _scan_in_progress; |
226 volatile bool _scan_in_progress; |
228 volatile bool _should_abort; |
227 volatile bool _should_abort; |
229 volatile int _claimed_survivor_index; |
228 volatile int _claimed_survivor_index; |
230 |
229 |
231 void notify_scan_done(); |
230 void notify_scan_done(); |
232 |
231 |
233 public: |
232 public: |
234 G1CMRootRegions(); |
233 G1CMRootRegions(); |
235 // We actually do most of the initialization in this method. |
234 // We actually do most of the initialization in this method. |
236 void init(G1CollectedHeap* g1h, G1ConcurrentMark* cm); |
235 void init(const G1SurvivorRegions* survivors, G1ConcurrentMark* cm); |
237 |
236 |
238 // Reset the claiming / scanning of the root regions. |
237 // Reset the claiming / scanning of the root regions. |
239 void prepare_for_scan(); |
238 void prepare_for_scan(); |
240 |
239 |
241 // Forces get_next() to return NULL so that the iteration aborts early. |
240 // Forces get_next() to return NULL so that the iteration aborts early. |