< prev index next >

src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp

Print this page




  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
  27 
  28 #include "gc_implementation/g1/g1AllocationContext.hpp"
  29 #include "gc_implementation/g1/g1Allocator.hpp"
  30 #include "gc_implementation/g1/concurrentMark.hpp"
  31 #include "gc_implementation/g1/evacuationInfo.hpp"
  32 #include "gc_implementation/g1/g1AllocRegion.hpp"
  33 #include "gc_implementation/g1/g1BiasedArray.hpp"
  34 #include "gc_implementation/g1/g1HRPrinter.hpp"
  35 #include "gc_implementation/g1/g1InCSetState.hpp"
  36 #include "gc_implementation/g1/g1MonitoringSupport.hpp"
  37 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
  38 #include "gc_implementation/g1/g1YCTypes.hpp"
  39 #include "gc_implementation/g1/heapRegionManager.hpp"
  40 #include "gc_implementation/g1/heapRegionSet.hpp"
  41 #include "gc_implementation/shared/hSpaceCounters.hpp"
  42 #include "gc_implementation/shared/parGCAllocBuffer.hpp"

  43 #include "memory/barrierSet.hpp"
  44 #include "memory/memRegion.hpp"
  45 #include "memory/sharedHeap.hpp"
  46 #include "utilities/stack.hpp"
  47 
  48 // A "G1CollectedHeap" is an implementation of a java heap for HotSpot.
  49 // It uses the "Garbage First" heap organization and algorithm, which
  50 // may combine concurrent marking with parallel, incremental compaction of
  51 // heap subsets that will yield large amounts of garbage.
  52 
  53 // Forward declarations
  54 class HeapRegion;
  55 class HRRSCleanupTask;
  56 class GenerationSpec;
  57 class OopsInHeapRegionClosure;
  58 class G1KlassScanClosure;
  59 class G1ParScanThreadState;
  60 class ObjectClosure;
  61 class SpaceClosure;
  62 class CompactibleSpaceClosure;
  63 class Space;
  64 class G1CollectorPolicy;
  65 class GenRemSet;


 161 // An instance is embedded into the G1CH and used as the
 162 // (optional) _is_alive_non_header closure in the STW
 163 // reference processor. It is also extensively used during
 164 // reference processing during STW evacuation pauses.
 165 class G1STWIsAliveClosure: public BoolObjectClosure {
 166   G1CollectedHeap* _g1;
 167 public:
 168   G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
 169   bool do_object_b(oop p);
 170 };
 171 
 172 class RefineCardTableEntryClosure;
 173 
 174 class G1RegionMappingChangedListener : public G1MappingChangedListener {
 175  private:
 176   void reset_from_card_cache(uint start_idx, size_t num_regions);
 177  public:
 178   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 179 };
 180 
 181 class G1CollectedHeap : public SharedHeap {
 182   friend class VM_CollectForMetadataAllocation;
 183   friend class VM_G1CollectForAllocation;
 184   friend class VM_G1CollectFull;
 185   friend class VM_G1IncCollectionPause;
 186   friend class VMStructs;
 187   friend class MutatorAllocRegion;
 188   friend class SurvivorGCAllocRegion;
 189   friend class OldGCAllocRegion;
 190   friend class G1Allocator;
 191 
 192   // Closures used in implementation.
 193   friend class G1ParScanThreadState;
 194   friend class G1ParTask;
 195   friend class G1ParGCAllocator;
 196   friend class G1PrepareCompactClosure;
 197 
 198   // Other related classes.
 199   friend class HeapRegionClaimer;
 200 
 201   // Testing classes.


 994   // May not return if something goes wrong.
 995   G1CollectedHeap(G1CollectorPolicy* policy);
 996 
 997   // Initialize the G1CollectedHeap to have the initial and
 998   // maximum sizes and remembered and barrier sets
 999   // specified by the policy object.
1000   jint initialize();
1001 
1002   virtual void stop();
1003 
1004   // Return the (conservative) maximum heap alignment for any G1 heap
1005   static size_t conservative_max_heap_alignment();
1006 
1007   // Does operations required after initialization has been done.
1008   void post_initialize();
1009 
1010   // Initialize weak reference processing.
1011   void ref_processing_init();
1012 
1013   // Explicitly import set_par_threads into this scope
1014   using SharedHeap::set_par_threads;
1015   // Set _n_par_threads according to a policy TBD.
1016   void set_par_threads();
1017 
1018   virtual Name kind() const {
1019     return CollectedHeap::G1CollectedHeap;
1020   }
1021 
1022   // The current policy object for the collector.
1023   G1CollectorPolicy* g1_policy() const { return _g1_policy; }
1024 
1025   virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) g1_policy(); }
1026 
1027   // Adaptive size policy.  No such thing for g1.
1028   virtual AdaptiveSizePolicy* size_policy() { return NULL; }
1029 
1030   // The rem set and barrier set.
1031   G1RemSet* g1_rem_set() const { return _g1_rem_set; }
1032 
1033   unsigned get_gc_time_stamp() {
1034     return _gc_time_stamp;




  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
  27 
  28 #include "gc_implementation/g1/g1AllocationContext.hpp"
  29 #include "gc_implementation/g1/g1Allocator.hpp"
  30 #include "gc_implementation/g1/concurrentMark.hpp"
  31 #include "gc_implementation/g1/evacuationInfo.hpp"
  32 #include "gc_implementation/g1/g1AllocRegion.hpp"
  33 #include "gc_implementation/g1/g1BiasedArray.hpp"
  34 #include "gc_implementation/g1/g1HRPrinter.hpp"
  35 #include "gc_implementation/g1/g1InCSetState.hpp"
  36 #include "gc_implementation/g1/g1MonitoringSupport.hpp"
  37 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
  38 #include "gc_implementation/g1/g1YCTypes.hpp"
  39 #include "gc_implementation/g1/heapRegionManager.hpp"
  40 #include "gc_implementation/g1/heapRegionSet.hpp"
  41 #include "gc_implementation/shared/hSpaceCounters.hpp"
  42 #include "gc_implementation/shared/parGCAllocBuffer.hpp"
  43 #include "gc_interface/collectedHeap.hpp"
  44 #include "memory/barrierSet.hpp"
  45 #include "memory/memRegion.hpp"

  46 #include "utilities/stack.hpp"
  47 
  48 // A "G1CollectedHeap" is an implementation of a java heap for HotSpot.
  49 // It uses the "Garbage First" heap organization and algorithm, which
  50 // may combine concurrent marking with parallel, incremental compaction of
  51 // heap subsets that will yield large amounts of garbage.
  52 
  53 // Forward declarations
  54 class HeapRegion;
  55 class HRRSCleanupTask;
  56 class GenerationSpec;
  57 class OopsInHeapRegionClosure;
  58 class G1KlassScanClosure;
  59 class G1ParScanThreadState;
  60 class ObjectClosure;
  61 class SpaceClosure;
  62 class CompactibleSpaceClosure;
  63 class Space;
  64 class G1CollectorPolicy;
  65 class GenRemSet;


 161 // An instance is embedded into the G1CH and used as the
 162 // (optional) _is_alive_non_header closure in the STW
 163 // reference processor. It is also extensively used during
 164 // reference processing during STW evacuation pauses.
 165 class G1STWIsAliveClosure: public BoolObjectClosure {
 166   G1CollectedHeap* _g1;
 167 public:
 168   G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
 169   bool do_object_b(oop p);
 170 };
 171 
 172 class RefineCardTableEntryClosure;
 173 
 174 class G1RegionMappingChangedListener : public G1MappingChangedListener {
 175  private:
 176   void reset_from_card_cache(uint start_idx, size_t num_regions);
 177  public:
 178   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
 179 };
 180 
 181 class G1CollectedHeap : public CollectedHeap {
 182   friend class VM_CollectForMetadataAllocation;
 183   friend class VM_G1CollectForAllocation;
 184   friend class VM_G1CollectFull;
 185   friend class VM_G1IncCollectionPause;
 186   friend class VMStructs;
 187   friend class MutatorAllocRegion;
 188   friend class SurvivorGCAllocRegion;
 189   friend class OldGCAllocRegion;
 190   friend class G1Allocator;
 191 
 192   // Closures used in implementation.
 193   friend class G1ParScanThreadState;
 194   friend class G1ParTask;
 195   friend class G1ParGCAllocator;
 196   friend class G1PrepareCompactClosure;
 197 
 198   // Other related classes.
 199   friend class HeapRegionClaimer;
 200 
 201   // Testing classes.


 994   // May not return if something goes wrong.
 995   G1CollectedHeap(G1CollectorPolicy* policy);
 996 
 997   // Initialize the G1CollectedHeap to have the initial and
 998   // maximum sizes and remembered and barrier sets
 999   // specified by the policy object.
1000   jint initialize();
1001 
1002   virtual void stop();
1003 
1004   // Return the (conservative) maximum heap alignment for any G1 heap
1005   static size_t conservative_max_heap_alignment();
1006 
1007   // Does operations required after initialization has been done.
1008   void post_initialize();
1009 
1010   // Initialize weak reference processing.
1011   void ref_processing_init();
1012 
1013   // Explicitly import set_par_threads into this scope
1014   using CollectedHeap::set_par_threads;
1015   // Set _n_par_threads according to a policy TBD.
1016   void set_par_threads();
1017 
1018   virtual Name kind() const {
1019     return CollectedHeap::G1CollectedHeap;
1020   }
1021 
1022   // The current policy object for the collector.
1023   G1CollectorPolicy* g1_policy() const { return _g1_policy; }
1024 
1025   virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) g1_policy(); }
1026 
1027   // Adaptive size policy.  No such thing for g1.
1028   virtual AdaptiveSizePolicy* size_policy() { return NULL; }
1029 
1030   // The rem set and barrier set.
1031   G1RemSet* g1_rem_set() const { return _g1_rem_set; }
1032 
1033   unsigned get_gc_time_stamp() {
1034     return _gc_time_stamp;


< prev index next >