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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "code/nmethod.hpp"
27 #include "gc/g1/g1BlockOffsetTable.inline.hpp"
28 #include "gc/g1/g1CollectedHeap.inline.hpp"
29 #include "gc/g1/g1CollectionSet.hpp"
30 #include "gc/g1/g1HeapRegionTraceType.hpp"
31 #include "gc/g1/g1OopClosures.inline.hpp"
32 #include "gc/g1/heapRegion.inline.hpp"
33 #include "gc/g1/heapRegionBounds.inline.hpp"
34 #include "gc/g1/heapRegionManager.inline.hpp"
35 #include "gc/g1/heapRegionRemSet.hpp"
36 #include "gc/g1/heapRegionTracer.hpp"
37 #include "gc/shared/genOopClosures.inline.hpp"
38 #include "gc/shared/space.inline.hpp"
39 #include "logging/log.hpp"
40 #include "logging/logStream.hpp"
41 #include "memory/iterator.inline.hpp"
42 #include "memory/resourceArea.hpp"
43 #include "oops/access.inline.hpp"
44 #include "oops/compressedOops.inline.hpp"
45 #include "oops/oop.inline.hpp"
46 #include "runtime/atomic.hpp"
47 #include "runtime/orderAccess.hpp"
48 #include "utilities/growableArray.hpp"
49
50 int HeapRegion::LogOfHRGrainBytes = 0;
231 _bot_part.set_object_can_span(false);
232 }
233
234 HeapRegion::HeapRegion(uint hrm_index,
235 G1BlockOffsetTable* bot,
236 MemRegion mr) :
237 G1ContiguousSpace(bot),
238 _rem_set(NULL),
239 _hrm_index(hrm_index),
240 _type(),
241 _humongous_start_region(NULL),
242 _evacuation_failed(false),
243 _next(NULL), _prev(NULL),
244 #ifdef ASSERT
245 _containing_set(NULL),
246 #endif
247 _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
248 _index_in_opt_cset(InvalidCSetIndex), _young_index_in_cset(-1),
249 _surv_rate_group(NULL), _age_index(-1),
250 _prev_top_at_mark_start(NULL), _next_top_at_mark_start(NULL),
251 _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
252 {
253 _rem_set = new HeapRegionRemSet(bot, this);
254
255 initialize(mr);
256 }
257
258 void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
259 assert(_rem_set->is_empty(), "Remembered set must be empty");
260
261 G1ContiguousSpace::initialize(mr, clear_space, mangle_space);
262
263 hr_clear(false /*par*/, false /*clear_space*/);
264 set_top(bottom());
265 }
266
267 void HeapRegion::report_region_type_change(G1HeapRegionTraceType::Type to) {
268 HeapRegionTracer::send_region_type_change(_hrm_index,
269 get_trace_type(),
270 to,
271 (uintptr_t)bottom(),
|
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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "code/nmethod.hpp"
27 #include "gc/g1/g1BlockOffsetTable.inline.hpp"
28 #include "gc/g1/g1CollectedHeap.inline.hpp"
29 #include "gc/g1/g1CollectionSet.hpp"
30 #include "gc/g1/g1HeapRegionTraceType.hpp"
31 #include "gc/g1/g1MemoryNodeManager.hpp"
32 #include "gc/g1/g1OopClosures.inline.hpp"
33 #include "gc/g1/heapRegion.inline.hpp"
34 #include "gc/g1/heapRegionBounds.inline.hpp"
35 #include "gc/g1/heapRegionManager.inline.hpp"
36 #include "gc/g1/heapRegionRemSet.hpp"
37 #include "gc/g1/heapRegionTracer.hpp"
38 #include "gc/shared/genOopClosures.inline.hpp"
39 #include "gc/shared/space.inline.hpp"
40 #include "logging/log.hpp"
41 #include "logging/logStream.hpp"
42 #include "memory/iterator.inline.hpp"
43 #include "memory/resourceArea.hpp"
44 #include "oops/access.inline.hpp"
45 #include "oops/compressedOops.inline.hpp"
46 #include "oops/oop.inline.hpp"
47 #include "runtime/atomic.hpp"
48 #include "runtime/orderAccess.hpp"
49 #include "utilities/growableArray.hpp"
50
51 int HeapRegion::LogOfHRGrainBytes = 0;
232 _bot_part.set_object_can_span(false);
233 }
234
235 HeapRegion::HeapRegion(uint hrm_index,
236 G1BlockOffsetTable* bot,
237 MemRegion mr) :
238 G1ContiguousSpace(bot),
239 _rem_set(NULL),
240 _hrm_index(hrm_index),
241 _type(),
242 _humongous_start_region(NULL),
243 _evacuation_failed(false),
244 _next(NULL), _prev(NULL),
245 #ifdef ASSERT
246 _containing_set(NULL),
247 #endif
248 _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
249 _index_in_opt_cset(InvalidCSetIndex), _young_index_in_cset(-1),
250 _surv_rate_group(NULL), _age_index(-1),
251 _prev_top_at_mark_start(NULL), _next_top_at_mark_start(NULL),
252 _recorded_rs_length(0), _predicted_elapsed_time_ms(0),
253 _node_index(G1MemoryNodeManager::InvalidNodeIndex)
254 {
255 _rem_set = new HeapRegionRemSet(bot, this);
256
257 initialize(mr);
258 }
259
260 void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
261 assert(_rem_set->is_empty(), "Remembered set must be empty");
262
263 G1ContiguousSpace::initialize(mr, clear_space, mangle_space);
264
265 hr_clear(false /*par*/, false /*clear_space*/);
266 set_top(bottom());
267 }
268
269 void HeapRegion::report_region_type_change(G1HeapRegionTraceType::Type to) {
270 HeapRegionTracer::send_region_type_change(_hrm_index,
271 get_trace_type(),
272 to,
273 (uintptr_t)bottom(),
|