< prev index next >

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

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHHEAP_HPP
  26 #define SHARE_GC_SHENANDOAH_SHENANDOAHHEAP_HPP
  27 
  28 #include "gc/shared/markBitMap.hpp"
  29 #include "gc/shared/softRefPolicy.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "gc/shenandoah/shenandoahAsserts.hpp"
  32 #include "gc/shenandoah/shenandoahAllocRequest.hpp"
  33 #include "gc/shenandoah/shenandoahLock.hpp"
  34 #include "gc/shenandoah/shenandoahEvacOOMHandler.hpp"
  35 #include "gc/shenandoah/shenandoahPadding.hpp"
  36 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
  37 #include "gc/shenandoah/shenandoahUnload.hpp"
  38 #include "services/memoryManager.hpp"
  39 #include "utilities/globalDefinitions.hpp"
  40 
  41 class ConcurrentGCTimer;
  42 class ReferenceProcessor;
  43 class ShenandoahCollectorPolicy;
  44 class ShenandoahControlThread;

  45 class ShenandoahGCSession;
  46 class ShenandoahGCStateResetter;
  47 class ShenandoahHeuristics;
  48 class ShenandoahMarkingContext;
  49 class ShenandoahMarkCompact;
  50 class ShenandoahMode;
  51 class ShenandoahPhaseTimings;
  52 class ShenandoahHeap;
  53 class ShenandoahHeapRegion;
  54 class ShenandoahHeapRegionClosure;
  55 class ShenandoahCollectionSet;
  56 class ShenandoahFreeSet;
  57 class ShenandoahConcurrentMark;
  58 class ShenandoahMarkCompact;
  59 class ShenandoahMonitoringSupport;
  60 class ShenandoahPacer;
  61 class ShenandoahVerifier;
  62 class ShenandoahWorkGang;
  63 class VMStructs;
  64 


 661   // SATB barriers hooks
 662   template<bool RESOLVE>
 663   inline bool requires_marking(const void* entry) const;
 664   void force_satb_flush_all_threads();
 665 
 666   // Support for bitmap uncommits
 667   bool commit_bitmap_slice(ShenandoahHeapRegion *r);
 668   bool uncommit_bitmap_slice(ShenandoahHeapRegion *r);
 669   bool is_bitmap_slice_committed(ShenandoahHeapRegion* r, bool skip_self = false);
 670 
 671   // Liveness caching support
 672   ShenandoahLiveData* get_liveness_cache(uint worker_id);
 673   void flush_liveness_cache(uint worker_id);
 674 
 675   size_t pretouch_heap_page_size() { return _pretouch_heap_page_size; }
 676 
 677 // ---------- Evacuation support
 678 //
 679 private:
 680   ShenandoahCollectionSet* _collection_set;
 681   ShenandoahEvacOOMHandler _oom_evac_handler;



 682 
 683   void evacuate_and_update_roots();
 684 
 685 public:
 686   static address in_cset_fast_test_addr();
 687 
 688   ShenandoahCollectionSet* collection_set() const { return _collection_set; }
 689 
 690   // Checks if object is in the collection set.
 691   inline bool in_collection_set(oop obj) const;
 692 
 693   // Checks if location is in the collection set. Can be interior pointer, not the oop itself.
 694   inline bool in_collection_set_loc(void* loc) const;
 695 
 696   // Evacuates object src. Returns the evacuated object, either evacuated
 697   // by this thread, or by some other thread.
 698   inline oop evacuate_object(oop src, Thread* thread);
 699 
 700   // Call before/after evacuation.
 701   inline void enter_evacuation(Thread* t);
 702   inline void leave_evacuation(Thread* t);
 703 
 704 // ---------- Helper functions
 705 //
 706 public:
 707   template <class T>
 708   inline oop evac_update_with_forwarded(T* p);
 709 
 710   template <class T>
 711   inline oop maybe_update_with_forwarded(T* p);
 712 
 713   template <class T>
 714   inline oop maybe_update_with_forwarded_not_null(T* p, oop obj);
 715 
 716   template <class T>
 717   inline oop update_with_forwarded_not_null(T* p, oop obj);
 718 
 719   static inline oop cas_oop(oop n, narrowOop* addr, oop c);
 720   static inline oop cas_oop(oop n, oop* addr, oop c);
 721   static inline oop cas_oop(oop n, narrowOop* addr, narrowOop c);
 722 


  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHHEAP_HPP
  26 #define SHARE_GC_SHENANDOAH_SHENANDOAHHEAP_HPP
  27 
  28 #include "gc/shared/markBitMap.hpp"
  29 #include "gc/shared/softRefPolicy.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "gc/shenandoah/shenandoahAsserts.hpp"
  32 #include "gc/shenandoah/shenandoahAllocRequest.hpp"
  33 #include "gc/shenandoah/shenandoahLock.hpp"

  34 #include "gc/shenandoah/shenandoahPadding.hpp"
  35 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
  36 #include "gc/shenandoah/shenandoahUnload.hpp"
  37 #include "services/memoryManager.hpp"
  38 #include "utilities/globalDefinitions.hpp"
  39 
  40 class ConcurrentGCTimer;
  41 class ReferenceProcessor;
  42 class ShenandoahCollectorPolicy;
  43 class ShenandoahControlThread;
  44 class ShenandoahEvacLockingBitmap;
  45 class ShenandoahGCSession;
  46 class ShenandoahGCStateResetter;
  47 class ShenandoahHeuristics;
  48 class ShenandoahMarkingContext;
  49 class ShenandoahMarkCompact;
  50 class ShenandoahMode;
  51 class ShenandoahPhaseTimings;
  52 class ShenandoahHeap;
  53 class ShenandoahHeapRegion;
  54 class ShenandoahHeapRegionClosure;
  55 class ShenandoahCollectionSet;
  56 class ShenandoahFreeSet;
  57 class ShenandoahConcurrentMark;
  58 class ShenandoahMarkCompact;
  59 class ShenandoahMonitoringSupport;
  60 class ShenandoahPacer;
  61 class ShenandoahVerifier;
  62 class ShenandoahWorkGang;
  63 class VMStructs;
  64 


 661   // SATB barriers hooks
 662   template<bool RESOLVE>
 663   inline bool requires_marking(const void* entry) const;
 664   void force_satb_flush_all_threads();
 665 
 666   // Support for bitmap uncommits
 667   bool commit_bitmap_slice(ShenandoahHeapRegion *r);
 668   bool uncommit_bitmap_slice(ShenandoahHeapRegion *r);
 669   bool is_bitmap_slice_committed(ShenandoahHeapRegion* r, bool skip_self = false);
 670 
 671   // Liveness caching support
 672   ShenandoahLiveData* get_liveness_cache(uint worker_id);
 673   void flush_liveness_cache(uint worker_id);
 674 
 675   size_t pretouch_heap_page_size() { return _pretouch_heap_page_size; }
 676 
 677 // ---------- Evacuation support
 678 //
 679 private:
 680   ShenandoahCollectionSet* _collection_set;
 681 
 682   MemRegion  _evac_locking_bitmap_region;
 683   ShenandoahEvacLockingBitmap* _evac_locking_bitmap;
 684   ShenandoahSharedFlag _evac_failed;
 685 
 686   void evacuate_and_update_roots();
 687 
 688 public:
 689   static address in_cset_fast_test_addr();
 690 
 691   ShenandoahCollectionSet* collection_set() const { return _collection_set; }
 692 
 693   // Checks if object is in the collection set.
 694   inline bool in_collection_set(oop obj) const;
 695 
 696   // Checks if location is in the collection set. Can be interior pointer, not the oop itself.
 697   inline bool in_collection_set_loc(void* loc) const;
 698 
 699   // Evacuates object src. Returns the evacuated object, either evacuated
 700   // by this thread, or by some other thread.
 701   inline oop evacuate_object(oop src, Thread* thread);




 702 
 703 // ---------- Helper functions
 704 //
 705 public:
 706   template <class T>
 707   inline oop evac_update_with_forwarded(T* p);
 708 
 709   template <class T>
 710   inline oop maybe_update_with_forwarded(T* p);
 711 
 712   template <class T>
 713   inline oop maybe_update_with_forwarded_not_null(T* p, oop obj);
 714 
 715   template <class T>
 716   inline oop update_with_forwarded_not_null(T* p, oop obj);
 717 
 718   static inline oop cas_oop(oop n, narrowOop* addr, oop c);
 719   static inline oop cas_oop(oop n, oop* addr, oop c);
 720   static inline oop cas_oop(oop n, narrowOop* addr, narrowOop c);
 721 
< prev index next >