< prev index next >

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

Print this page




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1ALLOCREGION_HPP
  26 #define SHARE_VM_GC_G1_G1ALLOCREGION_HPP
  27 
  28 #include "gc/g1/heapRegion.hpp"
  29 #include "gc/g1/g1EvacStats.hpp"
  30 #include "gc/g1/g1InCSetState.hpp"
  31 
  32 class G1CollectedHeap;
  33 
  34 // 0 -> no tracing, 1 -> basic tracing, 2 -> basic + allocation tracing
  35 #define G1_ALLOC_REGION_TRACING 0
  36 
  37 #define G1_ALLOC_REGION_MSG(message)                         \
  38   "[%s] %s c: %u b: %s r: " PTR_FORMAT " u: " SIZE_FORMAT, \
  39   _name, message, _count, BOOL_TO_STR(_bot_updates),       \
  40   p2i(_alloc_region), _used_bytes_before
  41 
  42 // A class that holds a region that is active in satisfying allocation
  43 // requests, potentially issued in parallel. When the active region is
  44 // full it will be retired and replaced with a new one. The
  45 // implementation assumes that fast-path allocations will be lock-free
  46 // and a lock will need to be taken when the active region needs to be
  47 // replaced.
  48 
  49 class G1AllocRegion VALUE_OBJ_CLASS_SPEC {
  50   friend class ar_ext_msg;
  51 
  52 private:
  53   // The active allocating region we are currently allocating out
  54   // of. The invariant is that if this object is initialized (i.e.,
  55   // init() has been called and release() has not) then _alloc_region
  56   // is either an active allocating region or the dummy region (i.e.,
  57   // it can never be NULL) and this object can be used to satisfy
  58   // allocation requests. If this object is not initialized
  59   // (i.e. init() has not been called or release() has been called)
  60   // then _alloc_region is NULL and this object should not be used to
  61   // satisfy allocation requests (it was done this way to force the
  62   // correct use of init() and release()).
  63   HeapRegion* volatile _alloc_region;
  64 
  65   // Allocation context associated with this alloc region.
  66   AllocationContext_t _allocation_context;
  67 
  68   // It keeps track of the distinct number of regions that are used
  69   // for allocation in the active interval of this object, i.e.,
  70   // between a call to init() and a call to release(). The count




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1ALLOCREGION_HPP
  26 #define SHARE_VM_GC_G1_G1ALLOCREGION_HPP
  27 
  28 #include "gc/g1/heapRegion.hpp"
  29 #include "gc/g1/g1EvacStats.hpp"
  30 #include "gc/g1/g1InCSetState.hpp"
  31 
  32 class G1CollectedHeap;
  33 
  34 // 0 -> no tracing, 1 -> basic tracing, 2 -> basic + allocation tracing
  35 #define G1_ALLOC_REGION_TRACING 0
  36 





  37 // A class that holds a region that is active in satisfying allocation
  38 // requests, potentially issued in parallel. When the active region is
  39 // full it will be retired and replaced with a new one. The
  40 // implementation assumes that fast-path allocations will be lock-free
  41 // and a lock will need to be taken when the active region needs to be
  42 // replaced.
  43 
  44 class G1AllocRegion VALUE_OBJ_CLASS_SPEC {

  45 
  46 private:
  47   // The active allocating region we are currently allocating out
  48   // of. The invariant is that if this object is initialized (i.e.,
  49   // init() has been called and release() has not) then _alloc_region
  50   // is either an active allocating region or the dummy region (i.e.,
  51   // it can never be NULL) and this object can be used to satisfy
  52   // allocation requests. If this object is not initialized
  53   // (i.e. init() has not been called or release() has been called)
  54   // then _alloc_region is NULL and this object should not be used to
  55   // satisfy allocation requests (it was done this way to force the
  56   // correct use of init() and release()).
  57   HeapRegion* volatile _alloc_region;
  58 
  59   // Allocation context associated with this alloc region.
  60   AllocationContext_t _allocation_context;
  61 
  62   // It keeps track of the distinct number of regions that are used
  63   // for allocation in the active interval of this object, i.e.,
  64   // between a call to init() and a call to release(). The count


< prev index next >