< prev index next >

src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp

Print this page
rev 59103 : imported patch hotspot


  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_GC_G1_G1HEAPREGIONATTR_HPP
  26 #define SHARE_GC_G1_G1HEAPREGIONATTR_HPP
  27 
  28 #include "gc/g1/g1BiasedArray.hpp"
  29 #include "gc/g1/heapRegion.hpp"
  30 
  31 // Per-region attributes often used during garbage collection to avoid costly
  32 // lookups for that information all over the place.
  33 struct G1HeapRegionAttr {
  34 public:
  35   // We use different types to represent the state value depending on platform as
  36   // some have issues loading parts of words.
  37 #ifdef SPARC
  38   typedef int32_t region_type_t;
  39   typedef uint32_t needs_remset_update_t;
  40 #else
  41   typedef int8_t region_type_t;
  42   typedef uint8_t needs_remset_update_t;
  43 #endif
  44 
  45 private:
  46   needs_remset_update_t _needs_remset_update;
  47   region_type_t _type;
  48 
  49 public:
  50   // Selection of the values for the _type field were driven to micro-optimize the
  51   // encoding and frequency of the checks.
  52   // The most common check for a given reference is whether the region is in the
  53   // collection set or not, and which generation this region is in.
  54   // The selected encoding allows us to use a single check (> NotInCSet) for the
  55   // former.
  56   //
  57   // The other values are used for objects in regions requiring various special handling,
  58   // eager reclamation of humongous objects or optional regions.
  59   static const region_type_t Optional     =  -3;    // The region is optional not in the current collection set.
  60   static const region_type_t Humongous    =  -2;    // The region is a humongous candidate not in the current collection set.
  61   static const region_type_t NotInCSet    =  -1;    // The region is not in the collection set.
  62   static const region_type_t Young        =   0;    // The region is in the collection set and a young region.
  63   static const region_type_t Old          =   1;    // The region is in the collection set and an old region.




  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_GC_G1_G1HEAPREGIONATTR_HPP
  26 #define SHARE_GC_G1_G1HEAPREGIONATTR_HPP
  27 
  28 #include "gc/g1/g1BiasedArray.hpp"
  29 #include "gc/g1/heapRegion.hpp"
  30 
  31 // Per-region attributes often used during garbage collection to avoid costly
  32 // lookups for that information all over the place.
  33 struct G1HeapRegionAttr {
  34 public:
  35   // We use different types to represent the state value depending on platform as
  36   // some have issues loading parts of words.




  37   typedef int8_t region_type_t;
  38   typedef uint8_t needs_remset_update_t;

  39 
  40 private:
  41   needs_remset_update_t _needs_remset_update;
  42   region_type_t _type;
  43 
  44 public:
  45   // Selection of the values for the _type field were driven to micro-optimize the
  46   // encoding and frequency of the checks.
  47   // The most common check for a given reference is whether the region is in the
  48   // collection set or not, and which generation this region is in.
  49   // The selected encoding allows us to use a single check (> NotInCSet) for the
  50   // former.
  51   //
  52   // The other values are used for objects in regions requiring various special handling,
  53   // eager reclamation of humongous objects or optional regions.
  54   static const region_type_t Optional     =  -3;    // The region is optional not in the current collection set.
  55   static const region_type_t Humongous    =  -2;    // The region is a humongous candidate not in the current collection set.
  56   static const region_type_t NotInCSet    =  -1;    // The region is not in the collection set.
  57   static const region_type_t Young        =   0;    // The region is in the collection set and a young region.
  58   static const region_type_t Old          =   1;    // The region is in the collection set and an old region.


< prev index next >