< prev index next >

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

Print this page
rev 59189 : imported patch hotspot
rev 59190 : imported patch hotspot-01


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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.




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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   typedef int8_t region_type_t;
  36   typedef uint8_t needs_remset_update_t;

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


< prev index next >