--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp 2015-03-06 20:51:41.276359478 +0100 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp 2015-03-06 20:51:41.213357641 +0100 @@ -189,7 +189,7 @@ // Closures used in implementation. friend class G1ParScanThreadState; friend class G1ParTask; - friend class G1ParGCAllocator; + friend class G1PLABAllocator; friend class G1PrepareCompactClosure; // Other related classes. @@ -246,9 +246,13 @@ // 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; @@ -266,22 +270,6 @@ // 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; @@ -698,6 +686,9 @@ 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 @@ -1100,6 +1091,16 @@ 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