hotspot/src/share/vm/memory/collectorPolicy.hpp
changeset 15482 470d0b0c09f1
parent 13728 882756847a04
child 15497 cba24d845969
equal deleted inserted replaced
15224:0f9e3436040d 15482:470d0b0c09f1
    27 
    27 
    28 #include "memory/allocation.hpp"
    28 #include "memory/allocation.hpp"
    29 #include "memory/barrierSet.hpp"
    29 #include "memory/barrierSet.hpp"
    30 #include "memory/generationSpec.hpp"
    30 #include "memory/generationSpec.hpp"
    31 #include "memory/genRemSet.hpp"
    31 #include "memory/genRemSet.hpp"
       
    32 #include "utilities/macros.hpp"
    32 
    33 
    33 // This class (or more correctly, subtypes of this class)
    34 // This class (or more correctly, subtypes of this class)
    34 // are used to define global garbage collector attributes.
    35 // are used to define global garbage collector attributes.
    35 // This includes initialization of generations and any other
    36 // This includes initialization of generations and any other
    36 // shared resources they may need.
    37 // shared resources they may need.
    46 
    47 
    47 // Forward declarations.
    48 // Forward declarations.
    48 class GenCollectorPolicy;
    49 class GenCollectorPolicy;
    49 class TwoGenerationCollectorPolicy;
    50 class TwoGenerationCollectorPolicy;
    50 class AdaptiveSizePolicy;
    51 class AdaptiveSizePolicy;
    51 #ifndef SERIALGC
    52 #if INCLUDE_ALL_GCS
    52 class ConcurrentMarkSweepPolicy;
    53 class ConcurrentMarkSweepPolicy;
    53 class G1CollectorPolicy;
    54 class G1CollectorPolicy;
    54 #endif // SERIALGC
    55 #endif // INCLUDE_ALL_GCS
    55 
    56 
    56 class GCPolicyCounters;
    57 class GCPolicyCounters;
    57 class MarkSweepPolicy;
    58 class MarkSweepPolicy;
    58 
    59 
    59 class CollectorPolicy : public CHeapObj<mtGC> {
    60 class CollectorPolicy : public CHeapObj<mtGC> {
   132 
   133 
   133   // Identification methods.
   134   // Identification methods.
   134   virtual GenCollectorPolicy*           as_generation_policy()            { return NULL; }
   135   virtual GenCollectorPolicy*           as_generation_policy()            { return NULL; }
   135   virtual TwoGenerationCollectorPolicy* as_two_generation_policy()        { return NULL; }
   136   virtual TwoGenerationCollectorPolicy* as_two_generation_policy()        { return NULL; }
   136   virtual MarkSweepPolicy*              as_mark_sweep_policy()            { return NULL; }
   137   virtual MarkSweepPolicy*              as_mark_sweep_policy()            { return NULL; }
   137 #ifndef SERIALGC
   138 #if INCLUDE_ALL_GCS
   138   virtual ConcurrentMarkSweepPolicy*    as_concurrent_mark_sweep_policy() { return NULL; }
   139   virtual ConcurrentMarkSweepPolicy*    as_concurrent_mark_sweep_policy() { return NULL; }
   139   virtual G1CollectorPolicy*            as_g1_policy()                    { return NULL; }
   140   virtual G1CollectorPolicy*            as_g1_policy()                    { return NULL; }
   140 #endif // SERIALGC
   141 #endif // INCLUDE_ALL_GCS
   141   // Note that these are not virtual.
   142   // Note that these are not virtual.
   142   bool is_generation_policy()            { return as_generation_policy() != NULL; }
   143   bool is_generation_policy()            { return as_generation_policy() != NULL; }
   143   bool is_two_generation_policy()        { return as_two_generation_policy() != NULL; }
   144   bool is_two_generation_policy()        { return as_two_generation_policy() != NULL; }
   144   bool is_mark_sweep_policy()            { return as_mark_sweep_policy() != NULL; }
   145   bool is_mark_sweep_policy()            { return as_mark_sweep_policy() != NULL; }
   145 #ifndef SERIALGC
   146 #if INCLUDE_ALL_GCS
   146   bool is_concurrent_mark_sweep_policy() { return as_concurrent_mark_sweep_policy() != NULL; }
   147   bool is_concurrent_mark_sweep_policy() { return as_concurrent_mark_sweep_policy() != NULL; }
   147   bool is_g1_policy()                    { return as_g1_policy() != NULL; }
   148   bool is_g1_policy()                    { return as_g1_policy() != NULL; }
   148 #else  // SERIALGC
   149 #else  // INCLUDE_ALL_GCS
   149   bool is_concurrent_mark_sweep_policy() { return false; }
   150   bool is_concurrent_mark_sweep_policy() { return false; }
   150   bool is_g1_policy()                    { return false; }
   151   bool is_g1_policy()                    { return false; }
   151 #endif // SERIALGC
   152 #endif // INCLUDE_ALL_GCS
   152 
   153 
   153 
   154 
   154   virtual BarrierSet::Name barrier_set_name() = 0;
   155   virtual BarrierSet::Name barrier_set_name() = 0;
   155   virtual GenRemSet::Name  rem_set_name() = 0;
   156   virtual GenRemSet::Name  rem_set_name() = 0;
   156 
   157