< prev index next >

src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp

Print this page




 359 }
 360 
 361 inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
 362   uint region = addr_to_region((HeapWord*)obj);
 363   // Clear the flag in the humongous_reclaim_candidates table.  Also
 364   // reset the entry in the _in_cset_fast_test table so that subsequent references
 365   // to the same humongous object do not go into the slow path again.
 366   // This is racy, as multiple threads may at the same time enter here, but this
 367   // is benign.
 368   // During collection we only ever clear the "candidate" flag, and only ever clear the
 369   // entry in the in_cset_fast_table.
 370   // We only ever evaluate the contents of these tables (in the VM thread) after
 371   // having synchronized the worker threads with the VM thread, or in the same
 372   // thread (i.e. within the VM thread).
 373   if (is_humongous_reclaim_candidate(region)) {
 374     set_humongous_reclaim_candidate(region, false);
 375     _in_cset_fast_test.clear_humongous(region);
 376   }
 377 }
 378 

















 379 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP


 359 }
 360 
 361 inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
 362   uint region = addr_to_region((HeapWord*)obj);
 363   // Clear the flag in the humongous_reclaim_candidates table.  Also
 364   // reset the entry in the _in_cset_fast_test table so that subsequent references
 365   // to the same humongous object do not go into the slow path again.
 366   // This is racy, as multiple threads may at the same time enter here, but this
 367   // is benign.
 368   // During collection we only ever clear the "candidate" flag, and only ever clear the
 369   // entry in the in_cset_fast_table.
 370   // We only ever evaluate the contents of these tables (in the VM thread) after
 371   // having synchronized the worker threads with the VM thread, or in the same
 372   // thread (i.e. within the VM thread).
 373   if (is_humongous_reclaim_candidate(region)) {
 374     set_humongous_reclaim_candidate(region, false);
 375     _in_cset_fast_test.clear_humongous(region);
 376   }
 377 }
 378 
 379 inline bool G1CollectedHeap::requires_marking(const void* entry) const {
 380   // Includes rejection of NULL pointers.
 381   assert(is_in_reserved(entry),
 382          err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry)));
 383 
 384   HeapRegion* region = heap_region_containing(entry);
 385   assert(region != NULL, err_msg("No region for " PTR_FORMAT, p2i(entry)));
 386   if (entry >= region->next_top_at_mark_start()) {
 387     return false;
 388   }
 389 
 390   assert(((oop)entry)->is_oop(true /* ignore mark word */),
 391          err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry)));
 392 
 393   return ! isMarkedNext((oop) entry);
 394 }
 395 
 396 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
< prev index next >