comparison src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp @ 3777:e8b0b0392037

7046182: G1: remove unnecessary iterations over the collection set Summary: Remove two unnecessary iterations over the collection set which are supposed to prepare the RSet's of the CSet regions for parallel iterations (we'll make sure this is done incrementally). I'll piggyback on this CR the removal of the G1_REM_SET_LOGGING code. Reviewed-by: brutisso, johnc
author tonyp
date Tue, 21 Jun 2011 15:23:07 -0400
parents 97ba643ea3ed
children 65a8ff39a6da
comparison
equal deleted inserted replaced
3776:23d434c6290d 3777:e8b0b0392037
260 260
261 #if 0 261 #if 0
262 virtual void cleanup() = 0; 262 virtual void cleanup() = 0;
263 #endif 263 #endif
264 264
265 // Should be called from single-threaded code.
266 void init_for_par_iteration();
267 // Attempt to claim the region. Returns true iff this call caused an 265 // Attempt to claim the region. Returns true iff this call caused an
268 // atomic transition from Unclaimed to Claimed. 266 // atomic transition from Unclaimed to Claimed.
269 bool claim_iter(); 267 bool claim_iter();
270 // Sets the iteration state to "complete". 268 // Sets the iteration state to "complete".
271 void set_iter_complete(); 269 void set_iter_complete();
272 // Returns "true" iff the region's iteration is complete. 270 // Returns "true" iff the region's iteration is complete.
273 bool iter_is_complete(); 271 bool iter_is_complete();
274 272
275 // Support for claiming blocks of cards during iteration 273 // Support for claiming blocks of cards during iteration
276 void set_iter_claimed(size_t x) { _iter_claimed = (jlong)x; }
277 size_t iter_claimed() const { return (size_t)_iter_claimed; } 274 size_t iter_claimed() const { return (size_t)_iter_claimed; }
278 // Claim the next block of cards 275 // Claim the next block of cards
279 size_t iter_claimed_next(size_t step) { 276 size_t iter_claimed_next(size_t step) {
280 size_t current, next; 277 size_t current, next;
281 do { 278 do {
282 current = iter_claimed(); 279 current = iter_claimed();
283 next = current + step; 280 next = current + step;
284 } while (Atomic::cmpxchg((jlong)next, &_iter_claimed, (jlong)current) != (jlong)current); 281 } while (Atomic::cmpxchg((jlong)next, &_iter_claimed, (jlong)current) != (jlong)current);
285 return current; 282 return current;
286 } 283 }
284 void reset_for_par_iteration();
285
286 bool verify_ready_for_par_iteration() {
287 return (_iter_state == Unclaimed) && (_iter_claimed == 0);
288 }
287 289
288 // Initialize the given iterator to iterate over this rem set. 290 // Initialize the given iterator to iterate over this rem set.
289 void init_iterator(HeapRegionRemSetIterator* iter) const; 291 void init_iterator(HeapRegionRemSetIterator* iter) const;
290 292
291 #if 0 293 #if 0