< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp

Print this page
rev 54037 : 8220350: Refactor ShenandoahHeap::initialize
Reviewed-by: XXX
rev 54039 : 8220162: Shenandoah should not commit HugeTLBFS memory
Reviewed-by: XXX


 225 // ---------- Workers handling
 226 //
 227 private:
 228   uint _max_workers;
 229   ShenandoahWorkGang* _workers;
 230   ShenandoahWorkGang* _safepoint_workers;
 231 
 232 public:
 233   uint max_workers();
 234   void assert_gc_workers(uint nworker) NOT_DEBUG_RETURN;
 235 
 236   WorkGang* workers() const;
 237   WorkGang* get_safepoint_workers();
 238 
 239   void gc_threads_do(ThreadClosure* tcl) const;
 240 
 241 // ---------- Heap regions handling machinery
 242 //
 243 private:
 244   MemRegion _heap_region;

 245   size_t    _num_regions;
 246   ShenandoahHeapRegion** _regions;
 247   ShenandoahRegionIterator _update_refs_iterator;
 248 
 249 public:
 250   inline size_t num_regions() const { return _num_regions; }

 251 
 252   inline ShenandoahHeapRegion* const heap_region_containing(const void* addr) const;
 253   inline size_t heap_region_index_containing(const void* addr) const;
 254 
 255   inline ShenandoahHeapRegion* const get_region(size_t region_idx) const;
 256 
 257   void heap_region_iterate(ShenandoahHeapRegionClosure* blk) const;
 258   void parallel_heap_region_iterate(ShenandoahHeapRegionClosure* blk) const;
 259 
 260 // ---------- GC state machinery
 261 //
 262 // GC state describes the important parts of collector state, that may be
 263 // used to make barrier selection decisions in the native and generated code.
 264 // Multiple bits can be set at once.
 265 //
 266 // Important invariant: when GC state is zero, the heap is stable, and no barriers
 267 // are required.
 268 //
 269 public:
 270   enum GCStateBitPos {


 631   void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
 632   size_t min_dummy_object_size() const;
 633 
 634   void resize_tlabs();
 635 
 636   void ensure_parsability(bool retire_tlabs);
 637   void make_parsable(bool retire_tlabs);
 638 
 639 // ---------- Marking support
 640 //
 641 private:
 642   ShenandoahMarkingContext* _marking_context;
 643   MemRegion  _bitmap_region;
 644   MemRegion  _aux_bitmap_region;
 645   MarkBitMap _verification_bit_map;
 646   MarkBitMap _aux_bit_map;
 647 
 648   size_t _bitmap_size;
 649   size_t _bitmap_regions_per_slice;
 650   size_t _bitmap_bytes_per_slice;



 651 
 652   // Used for buffering per-region liveness data.
 653   // Needed since ShenandoahHeapRegion uses atomics to update liveness.
 654   //
 655   // The array has max-workers elements, each of which is an array of
 656   // jushort * max_regions. The choice of jushort is not accidental:
 657   // there is a tradeoff between static/dynamic footprint that translates
 658   // into cache pressure (which is already high during marking), and
 659   // too many atomic updates. size_t/jint is too large, jbyte is too small.
 660   jushort** _liveness_cache;
 661 
 662 public:
 663   inline ShenandoahMarkingContext* complete_marking_context() const;
 664   inline ShenandoahMarkingContext* marking_context() const;
 665   inline void mark_complete_marking_context();
 666   inline void mark_incomplete_marking_context();
 667 
 668   template<class T>
 669   inline void marked_object_iterate(ShenandoahHeapRegion* region, T* cl);
 670 




 225 // ---------- Workers handling
 226 //
 227 private:
 228   uint _max_workers;
 229   ShenandoahWorkGang* _workers;
 230   ShenandoahWorkGang* _safepoint_workers;
 231 
 232 public:
 233   uint max_workers();
 234   void assert_gc_workers(uint nworker) NOT_DEBUG_RETURN;
 235 
 236   WorkGang* workers() const;
 237   WorkGang* get_safepoint_workers();
 238 
 239   void gc_threads_do(ThreadClosure* tcl) const;
 240 
 241 // ---------- Heap regions handling machinery
 242 //
 243 private:
 244   MemRegion _heap_region;
 245   bool      _heap_region_special;
 246   size_t    _num_regions;
 247   ShenandoahHeapRegion** _regions;
 248   ShenandoahRegionIterator _update_refs_iterator;
 249 
 250 public:
 251   inline size_t num_regions() const { return _num_regions; }
 252   inline bool is_heap_region_special() { return _heap_region_special; }
 253 
 254   inline ShenandoahHeapRegion* const heap_region_containing(const void* addr) const;
 255   inline size_t heap_region_index_containing(const void* addr) const;
 256 
 257   inline ShenandoahHeapRegion* const get_region(size_t region_idx) const;
 258 
 259   void heap_region_iterate(ShenandoahHeapRegionClosure* blk) const;
 260   void parallel_heap_region_iterate(ShenandoahHeapRegionClosure* blk) const;
 261 
 262 // ---------- GC state machinery
 263 //
 264 // GC state describes the important parts of collector state, that may be
 265 // used to make barrier selection decisions in the native and generated code.
 266 // Multiple bits can be set at once.
 267 //
 268 // Important invariant: when GC state is zero, the heap is stable, and no barriers
 269 // are required.
 270 //
 271 public:
 272   enum GCStateBitPos {


 633   void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
 634   size_t min_dummy_object_size() const;
 635 
 636   void resize_tlabs();
 637 
 638   void ensure_parsability(bool retire_tlabs);
 639   void make_parsable(bool retire_tlabs);
 640 
 641 // ---------- Marking support
 642 //
 643 private:
 644   ShenandoahMarkingContext* _marking_context;
 645   MemRegion  _bitmap_region;
 646   MemRegion  _aux_bitmap_region;
 647   MarkBitMap _verification_bit_map;
 648   MarkBitMap _aux_bit_map;
 649 
 650   size_t _bitmap_size;
 651   size_t _bitmap_regions_per_slice;
 652   size_t _bitmap_bytes_per_slice;
 653 
 654   bool _bitmap_region_special;
 655   bool _aux_bitmap_region_special;
 656 
 657   // Used for buffering per-region liveness data.
 658   // Needed since ShenandoahHeapRegion uses atomics to update liveness.
 659   //
 660   // The array has max-workers elements, each of which is an array of
 661   // jushort * max_regions. The choice of jushort is not accidental:
 662   // there is a tradeoff between static/dynamic footprint that translates
 663   // into cache pressure (which is already high during marking), and
 664   // too many atomic updates. size_t/jint is too large, jbyte is too small.
 665   jushort** _liveness_cache;
 666 
 667 public:
 668   inline ShenandoahMarkingContext* complete_marking_context() const;
 669   inline ShenandoahMarkingContext* marking_context() const;
 670   inline void mark_complete_marking_context();
 671   inline void mark_incomplete_marking_context();
 672 
 673   template<class T>
 674   inline void marked_object_iterate(ShenandoahHeapRegion* region, T* cl);
 675 


< prev index next >