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 *
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/g1HeapRegionTraceType.hpp"
30 #include "gc/g1/g1OopClosures.inline.hpp"
31 #include "gc/g1/heapRegion.inline.hpp"
32 #include "gc/g1/heapRegionBounds.inline.hpp"
33 #include "gc/g1/heapRegionManager.inline.hpp"
34 #include "gc/g1/heapRegionRemSet.hpp"
35 #include "gc/g1/heapRegionTracer.hpp"
36 #include "gc/shared/genOopClosures.inline.hpp"
37 #include "gc/shared/space.inline.hpp"
38 #include "logging/log.hpp"
39 #include "logging/logStream.hpp"
40 #include "memory/iterator.inline.hpp"
41 #include "memory/resourceArea.hpp"
42 #include "oops/access.inline.hpp"
43 #include "oops/compressedOops.inline.hpp"
44 #include "oops/oop.inline.hpp"
45 #include "runtime/atomic.hpp"
46 #include "runtime/orderAccess.hpp"
47 #include "utilities/growableArray.hpp"
48
223 assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
224 _humongous_start_region = NULL;
225
226 _bot_part.set_object_can_span(false);
227 }
228
229 HeapRegion::HeapRegion(uint hrm_index,
230 G1BlockOffsetTable* bot,
231 MemRegion mr) :
232 G1ContiguousSpace(bot),
233 _rem_set(NULL),
234 _hrm_index(hrm_index),
235 _type(),
236 _humongous_start_region(NULL),
237 _evacuation_failed(false),
238 _next(NULL), _prev(NULL),
239 #ifdef ASSERT
240 _containing_set(NULL),
241 #endif
242 _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
243 _young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(-1),
244 _prev_top_at_mark_start(NULL), _next_top_at_mark_start(NULL),
245 _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
246 {
247 _rem_set = new HeapRegionRemSet(bot, this);
248
249 initialize(mr);
250 }
251
252 void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
253 assert(_rem_set->is_empty(), "Remembered set must be empty");
254
255 G1ContiguousSpace::initialize(mr, clear_space, mangle_space);
256
257 hr_clear(false /*par*/, false /*clear_space*/);
258 set_top(bottom());
259 }
260
261 void HeapRegion::report_region_type_change(G1HeapRegionTraceType::Type to) {
262 HeapRegionTracer::send_region_type_change(_hrm_index,
263 get_trace_type(),
|
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 *
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
224 assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
225 _humongous_start_region = NULL;
226
227 _bot_part.set_object_can_span(false);
228 }
229
230 HeapRegion::HeapRegion(uint hrm_index,
231 G1BlockOffsetTable* bot,
232 MemRegion mr) :
233 G1ContiguousSpace(bot),
234 _rem_set(NULL),
235 _hrm_index(hrm_index),
236 _type(),
237 _humongous_start_region(NULL),
238 _evacuation_failed(false),
239 _next(NULL), _prev(NULL),
240 #ifdef ASSERT
241 _containing_set(NULL),
242 #endif
243 _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
244 _index_in_opt_cset(G1OptionalCSet::InvalidCSetIndex), _young_index_in_cset(-1),
245 _surv_rate_group(NULL), _age_index(-1),
246 _prev_top_at_mark_start(NULL), _next_top_at_mark_start(NULL),
247 _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
248 {
249 _rem_set = new HeapRegionRemSet(bot, this);
250
251 initialize(mr);
252 }
253
254 void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
255 assert(_rem_set->is_empty(), "Remembered set must be empty");
256
257 G1ContiguousSpace::initialize(mr, clear_space, mangle_space);
258
259 hr_clear(false /*par*/, false /*clear_space*/);
260 set_top(bottom());
261 }
262
263 void HeapRegion::report_region_type_change(G1HeapRegionTraceType::Type to) {
264 HeapRegionTracer::send_region_type_change(_hrm_index,
265 get_trace_type(),
|