< prev index next >

src/share/vm/gc/g1/g1Allocator.hpp

Print this page
rev 8817 : [mq]: jon-review-statistics

@@ -121,11 +121,11 @@
   // old objects.
   OldGCAllocRegion _old_gc_alloc_region;
 
   HeapRegion* _retained_old_gc_alloc_region;
 public:
-  G1DefaultAllocator(G1CollectedHeap* heap) : G1Allocator(heap), _retained_old_gc_alloc_region(NULL) { }
+  G1DefaultAllocator(G1CollectedHeap* heap);
 
   virtual void init_mutator_alloc_region();
   virtual void release_mutator_alloc_region();
 
   virtual void init_gc_alloc_regions(EvacuationInfo& evacuation_info);

@@ -170,10 +170,14 @@
   G1PLAB(size_t gclab_word_size);
   virtual ~G1PLAB() {
     guarantee(_retired, "Allocation buffer has not been retired");
   }
 
+  // The amount of space in words wasted within the PLAB including
+  // waste due to refills and alignment.
+  size_t wasted() const { return _wasted; }
+
   virtual void set_buf(HeapWord* buf) {
     PLAB::set_buf(buf);
     _retired = false;
   }
 

@@ -205,11 +209,14 @@
   // != 0 : align survivors to that alignment
   // These values were chosen to favor the non-alignment case since some
   // architectures have a special compare against zero instructions.
   const uint _survivor_alignment_bytes;
 
-  virtual void retire_alloc_buffers() = 0;
+  // Number of words allocated directly (not counting PLAB allocation).
+  size_t _direct_allocated[InCSetState::Num];
+
+  virtual void flush_and_retire_stats() = 0;
   virtual G1PLAB* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0;
 
   // Calculate the survivor space object alignment in bytes. Returns that or 0 if
   // there are no restrictions on survivor alignment.
   static uint calc_survivor_alignment_bytes() {

@@ -288,11 +295,11 @@
     assert(_alloc_buffers[dest.value()] != NULL,
            err_msg("Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value()));
     return _alloc_buffers[dest.value()];
   }
 
-  virtual void retire_alloc_buffers();
+  virtual void flush_and_retire_stats();
 
   virtual void waste(size_t& wasted, size_t& undo_wasted);
 };
 
 // G1ArchiveAllocator is used to allocate memory in archive
< prev index next >