1 /*
2 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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 *
1112 virtual bool copy_allocation_context_stats(const jint* contexts,
1113 jlong* totals,
1114 jbyte* accuracy,
1115 jint len);
1116
1117 // True iff an evacuation has failed in the most-recent collection.
1118 bool evacuation_failed() { return _evacuation_failed; }
1119
1120 void remove_from_old_sets(const uint old_regions_removed, const uint humongous_regions_removed);
1121 void prepend_to_freelist(FreeRegionList* list);
1122 void decrement_summary_bytes(size_t bytes);
1123
1124 virtual bool is_in(const void* p) const;
1125 #ifdef ASSERT
1126 // Returns whether p is in one of the available areas of the heap. Slow but
1127 // extensive version.
1128 bool is_in_exact(const void* p) const;
1129 #endif
1130
1131 // Return "TRUE" iff the given object address is within the collection
1132 // set. Slow implementation.
1133 bool obj_in_cs(oop obj);
1134
1135 inline bool is_in_cset(const HeapRegion *hr);
1136 inline bool is_in_cset(oop obj);
1137
1138 inline bool is_in_cset_or_humongous(const oop obj);
1139
1140 private:
1141 // This array is used for a quick test on whether a reference points into
1142 // the collection set or not. Each of the array's elements denotes whether the
1143 // corresponding region is in the collection set or not.
1144 G1InCSetStateFastTestBiasedMappedArray _in_cset_fast_test;
1145
1146 public:
1147
1148 inline InCSetState in_cset_state(const oop obj);
1149
1150 // Return "TRUE" iff the given object address is in the reserved
1151 // region of g1.
1152 bool is_in_g1_reserved(const void* p) const {
1153 return _hrm.reserved().contains(p);
1154 }
|
1 /*
2 * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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 *
1112 virtual bool copy_allocation_context_stats(const jint* contexts,
1113 jlong* totals,
1114 jbyte* accuracy,
1115 jint len);
1116
1117 // True iff an evacuation has failed in the most-recent collection.
1118 bool evacuation_failed() { return _evacuation_failed; }
1119
1120 void remove_from_old_sets(const uint old_regions_removed, const uint humongous_regions_removed);
1121 void prepend_to_freelist(FreeRegionList* list);
1122 void decrement_summary_bytes(size_t bytes);
1123
1124 virtual bool is_in(const void* p) const;
1125 #ifdef ASSERT
1126 // Returns whether p is in one of the available areas of the heap. Slow but
1127 // extensive version.
1128 bool is_in_exact(const void* p) const;
1129 #endif
1130
1131 // Return "TRUE" iff the given object address is within the collection
1132 // set. Assumes that the reference points into the heap.
1133 inline bool is_in_cset(const HeapRegion *hr);
1134 inline bool is_in_cset(oop obj);
1135
1136 inline bool is_in_cset_or_humongous(const oop obj);
1137
1138 private:
1139 // This array is used for a quick test on whether a reference points into
1140 // the collection set or not. Each of the array's elements denotes whether the
1141 // corresponding region is in the collection set or not.
1142 G1InCSetStateFastTestBiasedMappedArray _in_cset_fast_test;
1143
1144 public:
1145
1146 inline InCSetState in_cset_state(const oop obj);
1147
1148 // Return "TRUE" iff the given object address is in the reserved
1149 // region of g1.
1150 bool is_in_g1_reserved(const void* p) const {
1151 return _hrm.reserved().contains(p);
1152 }
|