< prev index next >

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

Print this page
rev 7903 : [mq]: 8073052-kim-sangheon-stefanj-changes

@@ -187,11 +187,11 @@
   friend class G1Allocator;
 
   // Closures used in implementation.
   friend class G1ParScanThreadState;
   friend class G1ParTask;
-  friend class G1ParGCAllocator;
+  friend class G1PLABAllocator;
   friend class G1PrepareCompactClosure;
 
   // Other related classes.
   friend class HeapRegionClaimer;
 

@@ -244,13 +244,17 @@
   G1RegionMappingChangedListener _listener;
 
   // The sequence of all heap regions in the heap.
   HeapRegionManager _hrm;
 
-  // Class that handles the different kinds of allocations.
+  // Handles the different kinds of allocations within a region.
   G1Allocator* _allocator;
 
+  // Outside of GC pauses, the number of bytes used in all regions other
+  // than the current allocation region(s).
+  size_t _summary_bytes_used;
+
   // Statistics for each allocation context
   AllocationContextStats _allocation_context_stats;
 
   // PLAB sizing policy for survivors.
   PLABStats _survivor_plab_stats;

@@ -264,26 +268,10 @@
   // that subsequent expansion attempts will also fail if one fails).
   // Currently, it is only consulted during GC and it's reset at the
   // start of each GC.
   bool _expand_heap_after_alloc_failure;
 
-  // It resets the mutator alloc region before new allocations can take place.
-  void init_mutator_alloc_region();
-
-  // It releases the mutator alloc region.
-  void release_mutator_alloc_region();
-
-  // It initializes the GC alloc regions at the start of a GC.
-  void init_gc_alloc_regions(EvacuationInfo& evacuation_info);
-
-  // It releases the GC alloc regions at the end of a GC.
-  void release_gc_alloc_regions(uint no_of_gc_workers, EvacuationInfo& evacuation_info);
-
-  // It does any cleanup that needs to be done on the GC alloc regions
-  // before a Full GC.
-  void abandon_gc_alloc_regions();
-
   // Helper for monitoring and management support.
   G1MonitoringSupport* _g1mm;
 
   // Records whether the region at the given index is kept live by roots or
   // references from the young generation.

@@ -696,10 +684,13 @@
 
   G1YCType yc_type();
 
   G1HRPrinter* hr_printer() { return &_hr_printer; }
 
+  // Allocates a new heap region instance.
+  HeapRegion* new_heap_region(uint hrs_index, MemRegion mr);
+  
   // Frees a non-humongous region by initializing its contents and
   // adding it to the free list that's passed as a parameter (this is
   // usually a local list which will be appended to the master free
   // list later). The used bytes of freed regions are accumulated in
   // pre_used. If par is true, the region's RSet will not be freed

@@ -1098,10 +1089,20 @@
   // This should be called when we're not holding the heap lock. The
   // result might be a bit inaccurate.
   size_t used_unlocked() const;
   size_t recalculate_used() const;
 
+  void increase_used(size_t bytes) { _summary_bytes_used += bytes; }
+  void set_used(size_t bytes) { _summary_bytes_used = bytes; }
+
+  void decrease_used(size_t bytes) {
+    assert(_summary_bytes_used >= bytes,
+           err_msg("invariant: _summary_bytes_used: "SIZE_FORMAT" should be >= bytes: "SIZE_FORMAT,
+               _summary_bytes_used, bytes));
+    _summary_bytes_used -= bytes;
+  }
+
   // These virtual functions do the actual allocation.
   // Some heaps may offer a contiguous region for shared non-blocking
   // allocation, via inlined code (by exporting the address of the top and
   // end fields defining the extent of the contiguous allocation region.)
   // But G1CollectedHeap doesn't yet support this.
< prev index next >