src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
changeset 59296 9186be5c78ba
parent 59153 1152339c298a
equal deleted inserted replaced
59295:8b6cc0bb93d0 59296:9186be5c78ba
    30 #include "gc/shenandoah/shenandoahAsserts.hpp"
    30 #include "gc/shenandoah/shenandoahAsserts.hpp"
    31 #include "gc/shenandoah/shenandoahAllocRequest.hpp"
    31 #include "gc/shenandoah/shenandoahAllocRequest.hpp"
    32 #include "gc/shenandoah/shenandoahLock.hpp"
    32 #include "gc/shenandoah/shenandoahLock.hpp"
    33 #include "gc/shenandoah/shenandoahEvacOOMHandler.hpp"
    33 #include "gc/shenandoah/shenandoahEvacOOMHandler.hpp"
    34 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
    34 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
       
    35 #include "gc/shenandoah/shenandoahUnload.hpp"
    35 #include "services/memoryManager.hpp"
    36 #include "services/memoryManager.hpp"
    36 
    37 
    37 class ConcurrentGCTimer;
    38 class ConcurrentGCTimer;
    38 class ReferenceProcessor;
    39 class ReferenceProcessor;
    39 class ShenandoahAllocTracker;
    40 class ShenandoahAllocTracker;
   269   ShenandoahSharedBitmap _gc_state;
   270   ShenandoahSharedBitmap _gc_state;
   270   ShenandoahSharedFlag   _degenerated_gc_in_progress;
   271   ShenandoahSharedFlag   _degenerated_gc_in_progress;
   271   ShenandoahSharedFlag   _full_gc_in_progress;
   272   ShenandoahSharedFlag   _full_gc_in_progress;
   272   ShenandoahSharedFlag   _full_gc_move_in_progress;
   273   ShenandoahSharedFlag   _full_gc_move_in_progress;
   273   ShenandoahSharedFlag   _progress_last_gc;
   274   ShenandoahSharedFlag   _progress_last_gc;
       
   275   ShenandoahSharedFlag   _concurrent_root_in_progress;
   274 
   276 
   275   void set_gc_state_all_threads(char state);
   277   void set_gc_state_all_threads(char state);
   276   void set_gc_state_mask(uint mask, bool value);
   278   void set_gc_state_mask(uint mask, bool value);
   277 
   279 
   278 public:
   280 public:
   285   void set_degenerated_gc_in_progress(bool in_progress);
   287   void set_degenerated_gc_in_progress(bool in_progress);
   286   void set_full_gc_in_progress(bool in_progress);
   288   void set_full_gc_in_progress(bool in_progress);
   287   void set_full_gc_move_in_progress(bool in_progress);
   289   void set_full_gc_move_in_progress(bool in_progress);
   288   void set_concurrent_traversal_in_progress(bool in_progress);
   290   void set_concurrent_traversal_in_progress(bool in_progress);
   289   void set_has_forwarded_objects(bool cond);
   291   void set_has_forwarded_objects(bool cond);
       
   292   void set_concurrent_root_in_progress(bool cond);
   290 
   293 
   291   inline bool is_stable() const;
   294   inline bool is_stable() const;
   292   inline bool is_idle() const;
   295   inline bool is_idle() const;
   293   inline bool is_concurrent_mark_in_progress() const;
   296   inline bool is_concurrent_mark_in_progress() const;
   294   inline bool is_update_refs_in_progress() const;
   297   inline bool is_update_refs_in_progress() const;
   297   inline bool is_full_gc_in_progress() const;
   300   inline bool is_full_gc_in_progress() const;
   298   inline bool is_full_gc_move_in_progress() const;
   301   inline bool is_full_gc_move_in_progress() const;
   299   inline bool is_concurrent_traversal_in_progress() const;
   302   inline bool is_concurrent_traversal_in_progress() const;
   300   inline bool has_forwarded_objects() const;
   303   inline bool has_forwarded_objects() const;
   301   inline bool is_gc_in_progress_mask(uint mask) const;
   304   inline bool is_gc_in_progress_mask(uint mask) const;
       
   305   inline bool is_stw_gc_in_progress() const;
       
   306   inline bool is_concurrent_root_in_progress() const;
   302 
   307 
   303 // ---------- GC cancellation and degeneration machinery
   308 // ---------- GC cancellation and degeneration machinery
   304 //
   309 //
   305 // Cancelled GC flag is used to notify concurrent phases that they should terminate.
   310 // Cancelled GC flag is used to notify concurrent phases that they should terminate.
   306 //
   311 //
   509 
   514 
   510 // ---------- Class Unloading
   515 // ---------- Class Unloading
   511 //
   516 //
   512 private:
   517 private:
   513   ShenandoahSharedFlag _unload_classes;
   518   ShenandoahSharedFlag _unload_classes;
       
   519   ShenandoahUnload     _unloader;
   514 
   520 
   515 public:
   521 public:
   516   void set_unload_classes(bool uc);
   522   void set_unload_classes(bool uc);
   517   bool unload_classes() const;
   523   bool unload_classes() const;
   518 
   524 
   520   void parallel_cleaning(bool full_gc);
   526   void parallel_cleaning(bool full_gc);
   521 
   527 
   522 private:
   528 private:
   523   void stw_unload_classes(bool full_gc);
   529   void stw_unload_classes(bool full_gc);
   524   void stw_process_weak_roots(bool full_gc);
   530   void stw_process_weak_roots(bool full_gc);
       
   531 
       
   532   // Prepare concurrent root processing
       
   533   void prepare_concurrent_roots();
       
   534   // Prepare and finish concurrent unloading
       
   535   void prepare_concurrent_unloading();
       
   536   void finish_concurrent_unloading();
   525 
   537 
   526 // ---------- Generic interface hooks
   538 // ---------- Generic interface hooks
   527 // Minor things that super-interface expects us to implement to play nice with
   539 // Minor things that super-interface expects us to implement to play nice with
   528 // the rest of runtime. Some of the things here are not required to be implemented,
   540 // the rest of runtime. Some of the things here are not required to be implemented,
   529 // and can be stubbed out.
   541 // and can be stubbed out.
   560 // ---------- Code roots handling hooks
   572 // ---------- Code roots handling hooks
   561 //
   573 //
   562 public:
   574 public:
   563   void register_nmethod(nmethod* nm);
   575   void register_nmethod(nmethod* nm);
   564   void unregister_nmethod(nmethod* nm);
   576   void unregister_nmethod(nmethod* nm);
   565   void flush_nmethod(nmethod* nm) {}
   577   void flush_nmethod(nmethod* nm);
   566   void verify_nmethod(nmethod* nm) {}
   578   void verify_nmethod(nmethod* nm) {}
   567 
   579 
   568 // ---------- Pinning hooks
   580 // ---------- Pinning hooks
   569 //
   581 //
   570 public:
   582 public: