< prev index next >

src/hotspot/share/gc/shared/genCollectedHeap.hpp

Print this page
rev 47957 : 8191564: Refactor GC related servicability code into GC specific subclasses


  95   enum GCH_strong_roots_tasks {
  96     GCH_PS_Universe_oops_do,
  97     GCH_PS_JNIHandles_oops_do,
  98     GCH_PS_ObjectSynchronizer_oops_do,
  99     GCH_PS_FlatProfiler_oops_do,
 100     GCH_PS_Management_oops_do,
 101     GCH_PS_SystemDictionary_oops_do,
 102     GCH_PS_ClassLoaderDataGraph_oops_do,
 103     GCH_PS_jvmti_oops_do,
 104     GCH_PS_CodeCache_oops_do,
 105     GCH_PS_aot_oops_do,
 106     GCH_PS_younger_gens,
 107     // Leave this one last.
 108     GCH_PS_NumElements
 109   };
 110 
 111   // Data structure for claiming the (potentially) parallel tasks in
 112   // (gen-specific) roots processing.
 113   SubTasksDone* _process_strong_tasks;
 114 



 115   // Helper functions for allocation
 116   HeapWord* attempt_allocation(size_t size,
 117                                bool   is_tlab,
 118                                bool   first_only);
 119 
 120   // Helper function for two callbacks below.
 121   // Considers collection of the first max_level+1 generations.
 122   void do_collection(bool           full,
 123                      bool           clear_all_soft_refs,
 124                      size_t         size,
 125                      bool           is_tlab,
 126                      GenerationType max_generation);
 127 
 128   // Callback from VM_GenCollectForAllocation operation.
 129   // This function does everything necessary/possible to satisfy an
 130   // allocation request that failed in the youngest generation that should
 131   // have handled it (including collection, expansion, etc.)
 132   HeapWord* satisfy_failed_allocation(size_t size, bool is_tlab);
 133 
 134   // Callback from VM_GenCollectFull operation.
 135   // Perform a full collection of the first max_level+1 generations.
 136   virtual void do_full_collection(bool clear_all_soft_refs);
 137   void do_full_collection(bool clear_all_soft_refs, GenerationType max_generation);
 138 
 139   // Does the "cause" of GC indicate that
 140   // we absolutely __must__ clear soft refs?
 141   bool must_clear_all_soft_refs();
 142 
 143   GenCollectedHeap(GenCollectorPolicy *policy);
 144 
 145   virtual void check_gen_kinds() = 0;
 146 
 147 public:
 148 
 149   // Returns JNI_OK on success
 150   virtual jint initialize();




 151 
 152   // Does operations required after initialization has been done.
 153   void post_initialize();
 154 
 155   Generation* young_gen() const { return _young_gen; }
 156   Generation* old_gen()   const { return _old_gen; }
 157 
 158   bool is_young_gen(const Generation* gen) const { return gen == _young_gen; }
 159   bool is_old_gen(const Generation* gen) const { return gen == _old_gen; }
 160 
 161   // The generational collector policy.
 162   GenCollectorPolicy* gen_policy() const { return _gen_policy; }
 163 
 164   virtual CollectorPolicy* collector_policy() const { return gen_policy(); }
 165 
 166   // Adaptive size policy
 167   virtual AdaptiveSizePolicy* size_policy() {
 168     return gen_policy()->size_policy();
 169   }
 170 




  95   enum GCH_strong_roots_tasks {
  96     GCH_PS_Universe_oops_do,
  97     GCH_PS_JNIHandles_oops_do,
  98     GCH_PS_ObjectSynchronizer_oops_do,
  99     GCH_PS_FlatProfiler_oops_do,
 100     GCH_PS_Management_oops_do,
 101     GCH_PS_SystemDictionary_oops_do,
 102     GCH_PS_ClassLoaderDataGraph_oops_do,
 103     GCH_PS_jvmti_oops_do,
 104     GCH_PS_CodeCache_oops_do,
 105     GCH_PS_aot_oops_do,
 106     GCH_PS_younger_gens,
 107     // Leave this one last.
 108     GCH_PS_NumElements
 109   };
 110 
 111   // Data structure for claiming the (potentially) parallel tasks in
 112   // (gen-specific) roots processing.
 113   SubTasksDone* _process_strong_tasks;
 114 
 115   GCMemoryManager* _minor_mgr;
 116   GCMemoryManager* _major_mgr;
 117 
 118   // Helper functions for allocation
 119   HeapWord* attempt_allocation(size_t size,
 120                                bool   is_tlab,
 121                                bool   first_only);
 122 
 123   // Helper function for two callbacks below.
 124   // Considers collection of the first max_level+1 generations.
 125   void do_collection(bool           full,
 126                      bool           clear_all_soft_refs,
 127                      size_t         size,
 128                      bool           is_tlab,
 129                      GenerationType max_generation);
 130 
 131   // Callback from VM_GenCollectForAllocation operation.
 132   // This function does everything necessary/possible to satisfy an
 133   // allocation request that failed in the youngest generation that should
 134   // have handled it (including collection, expansion, etc.)
 135   HeapWord* satisfy_failed_allocation(size_t size, bool is_tlab);
 136 
 137   // Callback from VM_GenCollectFull operation.
 138   // Perform a full collection of the first max_level+1 generations.
 139   virtual void do_full_collection(bool clear_all_soft_refs);
 140   void do_full_collection(bool clear_all_soft_refs, GenerationType max_generation);
 141 
 142   // Does the "cause" of GC indicate that
 143   // we absolutely __must__ clear soft refs?
 144   bool must_clear_all_soft_refs();
 145 
 146   GenCollectedHeap(GenCollectorPolicy *policy);
 147 
 148   virtual void check_gen_kinds() = 0;
 149 
 150 public:
 151 
 152   // Returns JNI_OK on success
 153   virtual jint initialize();
 154 
 155   virtual void init_memory_managers() = 0;
 156   GCMemoryManager* major_mgr() { return _major_mgr; }
 157   GCMemoryManager* minor_mgr() { return _minor_mgr; }
 158 
 159   // Does operations required after initialization has been done.
 160   void post_initialize();
 161 
 162   Generation* young_gen() const { return _young_gen; }
 163   Generation* old_gen()   const { return _old_gen; }
 164 
 165   bool is_young_gen(const Generation* gen) const { return gen == _young_gen; }
 166   bool is_old_gen(const Generation* gen) const { return gen == _old_gen; }
 167 
 168   // The generational collector policy.
 169   GenCollectorPolicy* gen_policy() const { return _gen_policy; }
 170 
 171   virtual CollectorPolicy* collector_policy() const { return gen_policy(); }
 172 
 173   // Adaptive size policy
 174   virtual AdaptiveSizePolicy* size_policy() {
 175     return gen_policy()->size_policy();
 176   }
 177 


< prev index next >