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), |