src/hotspot/share/gc/shared/genCollectedHeap.hpp
changeset 49048 4e8c86b75428
parent 49047 8f004146e407
child 49049 effb50eeea4e
equal deleted inserted replaced
49047:8f004146e407 49048:4e8c86b75428
    23  */
    23  */
    24 
    24 
    25 #ifndef SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
    25 #ifndef SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
    26 #define SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
    26 #define SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
    27 
    27 
    28 #include "gc/shared/adaptiveSizePolicy.hpp"
       
    29 #include "gc/shared/collectedHeap.hpp"
    28 #include "gc/shared/collectedHeap.hpp"
    30 #include "gc/shared/collectorPolicy.hpp"
    29 #include "gc/shared/collectorPolicy.hpp"
    31 #include "gc/shared/generation.hpp"
    30 #include "gc/shared/generation.hpp"
    32 #include "gc/shared/softRefGenPolicy.hpp"
    31 #include "gc/shared/softRefGenPolicy.hpp"
    33 
    32 
       
    33 class AdaptiveSizePolicy;
    34 class StrongRootsScope;
    34 class StrongRootsScope;
    35 class SubTasksDone;
    35 class SubTasksDone;
    36 class WorkGang;
    36 class WorkGang;
    37 
    37 
    38 // A "GenCollectedHeap" is a CollectedHeap that uses generational
    38 // A "GenCollectedHeap" is a CollectedHeap that uses generational
    71   // The generational collector policy.
    71   // The generational collector policy.
    72   GenCollectorPolicy* _gen_policy;
    72   GenCollectorPolicy* _gen_policy;
    73 
    73 
    74   SoftRefGenPolicy _soft_ref_gen_policy;
    74   SoftRefGenPolicy _soft_ref_gen_policy;
    75 
    75 
       
    76   // The sizing of the heap is controlled by a sizing policy.
       
    77   AdaptiveSizePolicy* _size_policy;
       
    78 
    76   // Indicates that the most recent previous incremental collection failed.
    79   // Indicates that the most recent previous incremental collection failed.
    77   // The flag is cleared when an action is taken that might clear the
    80   // The flag is cleared when an action is taken that might clear the
    78   // condition that caused that incremental collection to fail.
    81   // condition that caused that incremental collection to fail.
    79   bool _incremental_collection_failed;
    82   bool _incremental_collection_failed;
    80 
    83 
   153 public:
   156 public:
   154 
   157 
   155   // Returns JNI_OK on success
   158   // Returns JNI_OK on success
   156   virtual jint initialize();
   159   virtual jint initialize();
   157 
   160 
       
   161   void initialize_size_policy(size_t init_eden_size,
       
   162                               size_t init_promo_size,
       
   163                               size_t init_survivor_size);
       
   164 
   158   // Does operations required after initialization has been done.
   165   // Does operations required after initialization has been done.
   159   void post_initialize();
   166   void post_initialize();
   160 
   167 
   161   Generation* young_gen() const { return _young_gen; }
   168   Generation* young_gen() const { return _young_gen; }
   162   Generation* old_gen()   const { return _old_gen; }
   169   Generation* old_gen()   const { return _old_gen; }
   171 
   178 
   172   virtual SoftRefPolicy* soft_ref_policy() { return &_soft_ref_gen_policy; }
   179   virtual SoftRefPolicy* soft_ref_policy() { return &_soft_ref_gen_policy; }
   173 
   180 
   174   // Adaptive size policy
   181   // Adaptive size policy
   175   virtual AdaptiveSizePolicy* size_policy() {
   182   virtual AdaptiveSizePolicy* size_policy() {
   176     return gen_policy()->size_policy();
   183     return _size_policy;
   177   }
   184   }
   178 
   185 
   179   // Return the (conservative) maximum heap alignment
   186   // Return the (conservative) maximum heap alignment
   180   static size_t conservative_max_heap_alignment() {
   187   static size_t conservative_max_heap_alignment() {
   181     return Generation::GenGrain;
   188     return Generation::GenGrain;