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 *
251 void HeapRegion::set_starts_humongous(HeapWord* obj_top, size_t fill_size) {
252 assert(!is_humongous(), "sanity / pre-condition");
253 assert(top() == bottom(), "should be empty");
254
255 report_region_type_change(G1HeapRegionTraceType::StartsHumongous);
256 _type.set_starts_humongous();
257 _humongous_start_region = this;
258
259 _bot_part.set_for_starts_humongous(obj_top, fill_size);
260 }
261
262 void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
263 assert(!is_humongous(), "sanity / pre-condition");
264 assert(top() == bottom(), "should be empty");
265 assert(first_hr->is_starts_humongous(), "pre-condition");
266
267 report_region_type_change(G1HeapRegionTraceType::ContinuesHumongous);
268 _type.set_continues_humongous();
269 _humongous_start_region = first_hr;
270
271 _bot_part.set_continues_humongous(true);
272 }
273
274 void HeapRegion::clear_humongous() {
275 assert(is_humongous(), "pre-condition");
276
277 assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
278 _humongous_start_region = NULL;
279
280 _bot_part.set_continues_humongous(false);
281 }
282
283 HeapRegion::HeapRegion(uint hrm_index,
284 G1BlockOffsetTable* bot,
285 MemRegion mr) :
286 G1ContiguousSpace(bot),
287 _hrm_index(hrm_index),
288 _allocation_context(AllocationContext::system()),
289 _humongous_start_region(NULL),
290 _evacuation_failed(false),
291 _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
292 _next(NULL), _prev(NULL),
293 #ifdef ASSERT
294 _containing_set(NULL),
295 #endif // ASSERT
296 _young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(-1),
297 _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
298 {
299 _rem_set = new HeapRegionRemSet(bot, this);
300
|
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 *
251 void HeapRegion::set_starts_humongous(HeapWord* obj_top, size_t fill_size) {
252 assert(!is_humongous(), "sanity / pre-condition");
253 assert(top() == bottom(), "should be empty");
254
255 report_region_type_change(G1HeapRegionTraceType::StartsHumongous);
256 _type.set_starts_humongous();
257 _humongous_start_region = this;
258
259 _bot_part.set_for_starts_humongous(obj_top, fill_size);
260 }
261
262 void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
263 assert(!is_humongous(), "sanity / pre-condition");
264 assert(top() == bottom(), "should be empty");
265 assert(first_hr->is_starts_humongous(), "pre-condition");
266
267 report_region_type_change(G1HeapRegionTraceType::ContinuesHumongous);
268 _type.set_continues_humongous();
269 _humongous_start_region = first_hr;
270
271 _bot_part.set_object_can_span(true);
272 }
273
274 void HeapRegion::clear_humongous() {
275 assert(is_humongous(), "pre-condition");
276
277 assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
278 _humongous_start_region = NULL;
279
280 _bot_part.set_object_can_span(false);
281 }
282
283 HeapRegion::HeapRegion(uint hrm_index,
284 G1BlockOffsetTable* bot,
285 MemRegion mr) :
286 G1ContiguousSpace(bot),
287 _hrm_index(hrm_index),
288 _allocation_context(AllocationContext::system()),
289 _humongous_start_region(NULL),
290 _evacuation_failed(false),
291 _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
292 _next(NULL), _prev(NULL),
293 #ifdef ASSERT
294 _containing_set(NULL),
295 #endif // ASSERT
296 _young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(-1),
297 _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
298 {
299 _rem_set = new HeapRegionRemSet(bot, this);
300
|