< prev index next >

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

Print this page
rev 48000 : [mq]: open.patch


  69 class GenCollectedHeap;
  70 class GCStats;
  71 
  72 // A "ScratchBlock" represents a block of memory in one generation usable by
  73 // another.  It represents "num_words" free words, starting at and including
  74 // the address of "this".
  75 struct ScratchBlock {
  76   ScratchBlock* next;
  77   size_t num_words;
  78   HeapWord scratch_space[1];  // Actually, of size "num_words-2" (assuming
  79                               // first two fields are word-sized.)
  80 };
  81 
  82 class Generation: public CHeapObj<mtGC> {
  83   friend class VMStructs;
  84  private:
  85   jlong _time_of_last_gc; // time when last gc on this generation happened (ms)
  86   MemRegion _prev_used_region; // for collectors that want to "remember" a value for
  87                                // used region at some specific point during collection.
  88 


  89  protected:
  90   // Minimum and maximum addresses for memory reserved (not necessarily
  91   // committed) for generation.
  92   // Used by card marking code. Must not overlap with address ranges of
  93   // other generations.
  94   MemRegion _reserved;
  95 
  96   // Memory area reserved for generation
  97   VirtualSpace _virtual_space;
  98 
  99   // ("Weak") Reference processing support
 100   ReferenceProcessor* _ref_processor;
 101 
 102   // Performance Counters
 103   CollectorCounters* _gc_counters;
 104 
 105   // Statistics for garbage collection
 106   GCStats* _gc_stats;
 107 
 108   // Initialize the generation.


 537 
 538   virtual void verify() = 0;
 539 
 540   struct StatRecord {
 541     int invocations;
 542     elapsedTimer accumulated_time;
 543     StatRecord() :
 544       invocations(0),
 545       accumulated_time(elapsedTimer()) {}
 546   };
 547 private:
 548   StatRecord _stat_record;
 549 public:
 550   StatRecord* stat_record() { return &_stat_record; }
 551 
 552   virtual void print_summary_info_on(outputStream* st);
 553 
 554   // Performance Counter support
 555   virtual void update_counters() = 0;
 556   virtual CollectorCounters* counters() { return _gc_counters; }










 557 };
 558 
 559 #endif // SHARE_VM_GC_SHARED_GENERATION_HPP


  69 class GenCollectedHeap;
  70 class GCStats;
  71 
  72 // A "ScratchBlock" represents a block of memory in one generation usable by
  73 // another.  It represents "num_words" free words, starting at and including
  74 // the address of "this".
  75 struct ScratchBlock {
  76   ScratchBlock* next;
  77   size_t num_words;
  78   HeapWord scratch_space[1];  // Actually, of size "num_words-2" (assuming
  79                               // first two fields are word-sized.)
  80 };
  81 
  82 class Generation: public CHeapObj<mtGC> {
  83   friend class VMStructs;
  84  private:
  85   jlong _time_of_last_gc; // time when last gc on this generation happened (ms)
  86   MemRegion _prev_used_region; // for collectors that want to "remember" a value for
  87                                // used region at some specific point during collection.
  88 
  89   GCMemoryManager* _gc_manager;
  90 
  91  protected:
  92   // Minimum and maximum addresses for memory reserved (not necessarily
  93   // committed) for generation.
  94   // Used by card marking code. Must not overlap with address ranges of
  95   // other generations.
  96   MemRegion _reserved;
  97 
  98   // Memory area reserved for generation
  99   VirtualSpace _virtual_space;
 100 
 101   // ("Weak") Reference processing support
 102   ReferenceProcessor* _ref_processor;
 103 
 104   // Performance Counters
 105   CollectorCounters* _gc_counters;
 106 
 107   // Statistics for garbage collection
 108   GCStats* _gc_stats;
 109 
 110   // Initialize the generation.


 539 
 540   virtual void verify() = 0;
 541 
 542   struct StatRecord {
 543     int invocations;
 544     elapsedTimer accumulated_time;
 545     StatRecord() :
 546       invocations(0),
 547       accumulated_time(elapsedTimer()) {}
 548   };
 549 private:
 550   StatRecord _stat_record;
 551 public:
 552   StatRecord* stat_record() { return &_stat_record; }
 553 
 554   virtual void print_summary_info_on(outputStream* st);
 555 
 556   // Performance Counter support
 557   virtual void update_counters() = 0;
 558   virtual CollectorCounters* counters() { return _gc_counters; }
 559 
 560   GCMemoryManager* gc_manager() const {
 561     assert(_gc_manager != NULL, "not initialized yet");
 562     return _gc_manager;
 563   }
 564 
 565   void set_gc_manager(GCMemoryManager* gc_manager) {
 566     _gc_manager = gc_manager;
 567   }
 568 
 569 };
 570 
 571 #endif // SHARE_VM_GC_SHARED_GENERATION_HPP
< prev index next >