< prev index next >

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

Print this page




 304            "Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value());
 305     assert(_alloc_buffers[dest.value()] != NULL,
 306            "Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value());
 307     return _alloc_buffers[dest.value()];
 308   }
 309 
 310   virtual void flush_and_retire_stats();
 311 
 312   virtual void waste(size_t& wasted, size_t& undo_wasted);
 313 };
 314 
 315 // G1ArchiveRegionMap is a boolean array used to mark G1 regions as
 316 // archive regions.  This allows a quick check for whether an object
 317 // should not be marked because it is in an archive region.
 318 class G1ArchiveRegionMap : public G1BiasedMappedArray<bool> {
 319 protected:
 320   bool default_value() const { return false; }
 321 };
 322 
 323 // G1ArchiveAllocator is used to allocate memory in archive
 324 // regions. Such regions are not modifiable by GC, being neither
 325 // scavenged nor compacted, or even marked in the object header.
 326 // They can contain no pointers to non-archive heap regions,







 327 class G1ArchiveAllocator : public CHeapObj<mtGC> {
 328 protected:
 329   bool _open; // An 'open' archive region may contain references pointing to
 330               // non-archive heap region. GC can adjust pointers in 'open'
 331               // archive region.
 332   G1CollectedHeap* _g1h;
 333 
 334   // The current allocation region
 335   HeapRegion* _allocation_region;
 336 
 337   // Regions allocated for the current archive range.
 338   GrowableArray<HeapRegion*> _allocated_regions;
 339 
 340   // The number of bytes used in the current range.
 341   size_t _summary_bytes_used;
 342 
 343   // Current allocation window within the current region.
 344   HeapWord* _bottom;
 345   HeapWord* _top;
 346   HeapWord* _max;
 347 
 348   // Allocate a new region for this archive allocator.
 349   // Allocation is from the top of the reserved heap downward.
 350   bool alloc_new_region();
 351 




 304            "Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value());
 305     assert(_alloc_buffers[dest.value()] != NULL,
 306            "Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value());
 307     return _alloc_buffers[dest.value()];
 308   }
 309 
 310   virtual void flush_and_retire_stats();
 311 
 312   virtual void waste(size_t& wasted, size_t& undo_wasted);
 313 };
 314 
 315 // G1ArchiveRegionMap is a boolean array used to mark G1 regions as
 316 // archive regions.  This allows a quick check for whether an object
 317 // should not be marked because it is in an archive region.
 318 class G1ArchiveRegionMap : public G1BiasedMappedArray<bool> {
 319 protected:
 320   bool default_value() const { return false; }
 321 };
 322 
 323 // G1ArchiveAllocator is used to allocate memory in archive
 324 // regions. Such regions are not scavenged nor compacted by GC.
 325 // There are two types of archive regions, which are
 326 // differ in the kind of references allowed for the contained objects:
 327 //
 328 // - 'Closed' archive region contain no references outside of archive
 329 //   regions. The region is immutable by GC. GC does not mark object
 330 //   header in 'closed' archive region. 
 331 // - An 'open' archive region may contain references pointing to
 332 //   non-archive heap region. GC can adjust pointers and mark object
 333 //   header in 'open' archive region.
 334 class G1ArchiveAllocator : public CHeapObj<mtGC> {
 335 protected:
 336   bool _open; // Indicate if the region is 'open' archive.


 337   G1CollectedHeap* _g1h;
 338 
 339   // The current allocation region
 340   HeapRegion* _allocation_region;
 341 
 342   // Regions allocated for the current archive range.
 343   GrowableArray<HeapRegion*> _allocated_regions;
 344 
 345   // The number of bytes used in the current range.
 346   size_t _summary_bytes_used;
 347 
 348   // Current allocation window within the current region.
 349   HeapWord* _bottom;
 350   HeapWord* _top;
 351   HeapWord* _max;
 352 
 353   // Allocate a new region for this archive allocator.
 354   // Allocation is from the top of the reserved heap downward.
 355   bool alloc_new_region();
 356 


< prev index next >