hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
changeset 27009 e7e723732b6b
parent 26846 7d4376f8560e
child 27624 fe43edc5046d
equal deleted inserted replaced
27008:10d6c1e39d87 27009:e7e723732b6b
   215     if (locked) {
   215     if (locked) {
   216       hrrs->clear_locked();
   216       hrrs->clear_locked();
   217     } else {
   217     } else {
   218       hrrs->clear();
   218       hrrs->clear();
   219     }
   219     }
   220     _claimed = InitialClaimValue;
       
   221   }
   220   }
   222   zero_marked_bytes();
   221   zero_marked_bytes();
   223 
   222 
   224   _offsets.resize(HeapRegion::GrainWords);
   223   _offsets.resize(HeapRegion::GrainWords);
   225   init_top_at_mark_start();
   224   init_top_at_mark_start();
   290     assert(end() == orig_end(), "sanity");
   289     assert(end() == orig_end(), "sanity");
   291   }
   290   }
   292 
   291 
   293   assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
   292   assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
   294   _humongous_start_region = NULL;
   293   _humongous_start_region = NULL;
   295 }
       
   296 
       
   297 bool HeapRegion::claimHeapRegion(jint claimValue) {
       
   298   jint current = _claimed;
       
   299   if (current != claimValue) {
       
   300     jint res = Atomic::cmpxchg(claimValue, &_claimed, current);
       
   301     if (res == current) {
       
   302       return true;
       
   303     }
       
   304   }
       
   305   return false;
       
   306 }
   294 }
   307 
   295 
   308 HeapRegion::HeapRegion(uint hrm_index,
   296 HeapRegion::HeapRegion(uint hrm_index,
   309                        G1BlockOffsetSharedArray* sharedOffsetArray,
   297                        G1BlockOffsetSharedArray* sharedOffsetArray,
   310                        MemRegion mr) :
   298                        MemRegion mr) :
   312     _hrm_index(hrm_index),
   300     _hrm_index(hrm_index),
   313     _allocation_context(AllocationContext::system()),
   301     _allocation_context(AllocationContext::system()),
   314     _humongous_start_region(NULL),
   302     _humongous_start_region(NULL),
   315     _in_collection_set(false),
   303     _in_collection_set(false),
   316     _next_in_special_set(NULL),
   304     _next_in_special_set(NULL),
   317     _claimed(InitialClaimValue), _evacuation_failed(false),
   305     _evacuation_failed(false),
   318     _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
   306     _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
   319     _next_young_region(NULL),
   307     _next_young_region(NULL),
   320     _next_dirty_cards_region(NULL), _next(NULL), _prev(NULL),
   308     _next_dirty_cards_region(NULL), _next(NULL), _prev(NULL),
   321 #ifdef ASSERT
   309 #ifdef ASSERT
   322     _containing_set(NULL),
   310     _containing_set(NULL),