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 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.
|
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.
|