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.
|
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 #if defined(_M_ARM64)&& defined(_MSC_VER) && _MSC_VER <= 1927
36 // workaround for MSCV ARM64 bug
37 // https://developercommunity.visualstudio.com/content/problem/1079221/arm64-bad-code-generation-around-signed-char-arith.html
38 typedef int32_t region_type_t;
39 #else
40 typedef int8_t region_type_t;
41 #endif
42 typedef uint8_t needs_remset_update_t;
43
44 private:
45 needs_remset_update_t _needs_remset_update;
46 region_type_t _type;
47
48 public:
49 // Selection of the values for the _type field were driven to micro-optimize the
50 // encoding and frequency of the checks.
51 // The most common check for a given reference is whether the region is in the
52 // collection set or not, and which generation this region is in.
53 // The selected encoding allows us to use a single check (> NotInCSet) for the
54 // former.
55 //
56 // The other values are used for objects in regions requiring various special handling,
57 // eager reclamation of humongous objects or optional regions.
58 static const region_type_t Optional = -3; // The region is optional not in the current collection set.
59 static const region_type_t Humongous = -2; // The region is a humongous candidate not in the current collection set.
60 static const region_type_t NotInCSet = -1; // The region is not in the collection set.
61 static const region_type_t Young = 0; // The region is in the collection set and a young region.
|