< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahCollectionSet.inline.hpp

Print this page
rev 10542 : [backport] Constify ShHeapRegionSet and ShCollectionSet


  22  */
  23 
  24 
  25 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTIONSET_INLINE_HPP
  26 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTIONSET_INLINE_HPP
  27 
  28 #include "gc_implementation/shenandoah/shenandoahHeap.hpp"
  29 #include "gc_implementation/shenandoah/shenandoahHeapRegion.hpp"
  30 
  31 bool ShenandoahCollectionSet::is_in(size_t region_number) const {
  32   assert(region_number < _heap->num_regions(), "Sanity");
  33   return _cset_map[region_number] == 1;
  34 }
  35 
  36 bool ShenandoahCollectionSet::is_in(ShenandoahHeapRegion* r) const {
  37   return is_in(r->region_number());
  38 }
  39 
  40 bool ShenandoahCollectionSet::is_in(HeapWord* p) const {
  41   assert(_heap->is_in(p), "Must be in the heap");
  42   uintx index = ((uintx) p) >> ShenandoahHeapRegion::region_size_bytes_shift();
  43   // no need to subtract the bottom of the heap from p,
  44   // _biased_cset_map is biased
  45   return _biased_cset_map[index] == 1;
  46 }
  47 
  48 
  49 #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTIONSET_INLINE_HPP


  22  */
  23 
  24 
  25 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTIONSET_INLINE_HPP
  26 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTIONSET_INLINE_HPP
  27 
  28 #include "gc_implementation/shenandoah/shenandoahHeap.hpp"
  29 #include "gc_implementation/shenandoah/shenandoahHeapRegion.hpp"
  30 
  31 bool ShenandoahCollectionSet::is_in(size_t region_number) const {
  32   assert(region_number < _heap->num_regions(), "Sanity");
  33   return _cset_map[region_number] == 1;
  34 }
  35 
  36 bool ShenandoahCollectionSet::is_in(ShenandoahHeapRegion* r) const {
  37   return is_in(r->region_number());
  38 }
  39 
  40 bool ShenandoahCollectionSet::is_in(HeapWord* p) const {
  41   assert(_heap->is_in(p), "Must be in the heap");
  42   uintx index = ((uintx) p) >> _region_size_bytes_shift;
  43   // no need to subtract the bottom of the heap from p,
  44   // _biased_cset_map is biased
  45   return _biased_cset_map[index] == 1;
  46 }
  47 
  48 
  49 #endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTIONSET_INLINE_HPP
< prev index next >