< prev index next >

src/share/vm/gc_implementation/g1/g1InCSetState.hpp

Print this page
rev 7696 : 8030646: track collection set membership in one place

@@ -23,10 +23,11 @@
  */
 
 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1INCSETSTATE_HPP
 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1INCSETSTATE_HPP
 
+#include "gc_implementation/g1/heapRegion.hpp"
 #include "gc_implementation/g1/g1BiasedArray.hpp"
 #include "memory/allocation.hpp"
 
 // Per-region state during garbage collection.
 struct InCSetState {

@@ -123,10 +124,12 @@
     set_by_index(index, InCSetState::Old);
   }
 
   bool is_in_cset_or_humongous(HeapWord* addr) const { return at(addr).is_in_cset_or_humongous(); }
   bool is_in_cset(HeapWord* addr) const { return at(addr).is_in_cset(); }
+  bool is_in_cset(const HeapRegion* hr) const { return get_by_index(hr->hrm_index()).is_in_cset(); }
   InCSetState at(HeapWord* addr) const { return get_by_address(addr); }
   void clear() { G1BiasedMappedArray<InCSetState>::clear(); }
+  void clear(const HeapRegion* hr) { return set_by_index(hr->hrm_index(), InCSetState::NotInCSet); }
 };
 
 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1INCSETSTATE_HPP
< prev index next >