1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Thu Mar 12 18:17:25 2009 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Mar 18 11:37:48 2009 -0400 1.3 @@ -172,7 +172,6 @@ 1.4 NumAPIs = HeapRegion::MaxAge 1.5 }; 1.6 1.7 - 1.8 // The one and only G1CollectedHeap, so static functions can find it. 1.9 static G1CollectedHeap* _g1h; 1.10 1.11 @@ -217,11 +216,20 @@ 1.12 1.13 // Postcondition: cur_alloc_region == NULL. 1.14 void abandon_cur_alloc_region(); 1.15 + void abandon_gc_alloc_regions(); 1.16 1.17 // The to-space memory regions into which objects are being copied during 1.18 // a GC. 1.19 HeapRegion* _gc_alloc_regions[GCAllocPurposeCount]; 1.20 size_t _gc_alloc_region_counts[GCAllocPurposeCount]; 1.21 + // These are the regions, one per GCAllocPurpose, that are half-full 1.22 + // at the end of a collection and that we want to reuse during the 1.23 + // next collection. 1.24 + HeapRegion* _retained_gc_alloc_regions[GCAllocPurposeCount]; 1.25 + // This specifies whether we will keep the last half-full region at 1.26 + // the end of a collection so that it can be reused during the next 1.27 + // collection (this is specified per GCAllocPurpose) 1.28 + bool _retain_gc_alloc_region[GCAllocPurposeCount]; 1.29 1.30 // A list of the regions that have been set to be alloc regions in the 1.31 // current collection. 1.32 @@ -589,8 +597,21 @@ 1.33 1.34 // Ensure that the relevant gc_alloc regions are set. 1.35 void get_gc_alloc_regions(); 1.36 - // We're done with GC alloc regions; release them, as appropriate. 1.37 - void release_gc_alloc_regions(); 1.38 + // We're done with GC alloc regions. We are going to tear down the 1.39 + // gc alloc list and remove the gc alloc tag from all the regions on 1.40 + // that list. However, we will also retain the last (i.e., the one 1.41 + // that is half-full) GC alloc region, per GCAllocPurpose, for 1.42 + // possible reuse during the next collection, provided 1.43 + // _retain_gc_alloc_region[] indicates that it should be the 1.44 + // case. Said regions are kept in the _retained_gc_alloc_regions[] 1.45 + // array. If the parameter totally is set, we will not retain any 1.46 + // regions, irrespective of what _retain_gc_alloc_region[] 1.47 + // indicates. 1.48 + void release_gc_alloc_regions(bool totally); 1.49 +#ifndef PRODUCT 1.50 + // Useful for debugging. 1.51 + void print_gc_alloc_regions(); 1.52 +#endif // !PRODUCT 1.53 1.54 // ("Weak") Reference processing support 1.55 ReferenceProcessor* _ref_processor;