< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp

Print this page




 259 }
 260 
 261 inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
 262   uint region = addr_to_region((HeapWord*)obj);
 263   // Clear the flag in the humongous_reclaim_candidates table.  Also
 264   // reset the entry in the _in_cset_fast_test table so that subsequent references
 265   // to the same humongous object do not go into the slow path again.
 266   // This is racy, as multiple threads may at the same time enter here, but this
 267   // is benign.
 268   // During collection we only ever clear the "candidate" flag, and only ever clear the
 269   // entry in the in_cset_fast_table.
 270   // We only ever evaluate the contents of these tables (in the VM thread) after
 271   // having synchronized the worker threads with the VM thread, or in the same
 272   // thread (i.e. within the VM thread).
 273   if (is_humongous_reclaim_candidate(region)) {
 274     set_humongous_reclaim_candidate(region, false);
 275     _in_cset_fast_test.clear_humongous(region);
 276   }
 277 }
 278 

















 279 #endif // SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP


 259 }
 260 
 261 inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
 262   uint region = addr_to_region((HeapWord*)obj);
 263   // Clear the flag in the humongous_reclaim_candidates table.  Also
 264   // reset the entry in the _in_cset_fast_test table so that subsequent references
 265   // to the same humongous object do not go into the slow path again.
 266   // This is racy, as multiple threads may at the same time enter here, but this
 267   // is benign.
 268   // During collection we only ever clear the "candidate" flag, and only ever clear the
 269   // entry in the in_cset_fast_table.
 270   // We only ever evaluate the contents of these tables (in the VM thread) after
 271   // having synchronized the worker threads with the VM thread, or in the same
 272   // thread (i.e. within the VM thread).
 273   if (is_humongous_reclaim_candidate(region)) {
 274     set_humongous_reclaim_candidate(region, false);
 275     _in_cset_fast_test.clear_humongous(region);
 276   }
 277 }
 278 
 279 inline bool G1CollectedHeap::requires_marking(const void* entry) const {
 280   // Includes rejection of NULL pointers.
 281   assert(is_in_reserved(entry),
 282          "Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry));
 283 
 284   HeapRegion* region = heap_region_containing(entry);
 285   assert(region != NULL, "No region for " PTR_FORMAT, p2i(entry));
 286   if (entry >= region->next_top_at_mark_start()) {
 287     return false;
 288   }
 289 
 290   assert(oopDesc::is_oop(oop(entry), true /* ignore mark word */),
 291          "Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry));
 292 
 293   return ! is_marked_next((oop) entry);
 294 }
 295 
 296 #endif // SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
< prev index next >