--- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp Thu Jan 07 14:55:12 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp Thu Jan 07 16:25:53 2016 +0100
@@ -153,7 +153,7 @@
}
void HeapRegion::reset_after_compaction() {
- G1OffsetTableContigSpace::reset_after_compaction();
+ G1ContiguousSpace::reset_after_compaction();
// After a compaction the mark bitmap is invalid, so we must
// treat all objects as being inside the unmarked area.
zero_marked_bytes();
@@ -183,7 +183,6 @@
}
zero_marked_bytes();
- _offsets.resize(HeapRegion::GrainWords);
init_top_at_mark_start();
if (clear_space) clear(SpaceDecorator::Mangle);
}
@@ -219,7 +218,7 @@
_type.set_starts_humongous();
_humongous_start_region = this;
- _offsets.set_for_starts_humongous(obj_top, fill_size);
+ _bot_part.set_for_starts_humongous(obj_top, fill_size);
}
void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
@@ -239,9 +238,9 @@
}
HeapRegion::HeapRegion(uint hrm_index,
- G1BlockOffsetSharedArray* sharedOffsetArray,
+ G1BlockOffsetTable* bot,
MemRegion mr) :
- G1OffsetTableContigSpace(sharedOffsetArray, mr),
+ G1ContiguousSpace(bot),
_hrm_index(hrm_index),
_allocation_context(AllocationContext::system()),
_humongous_start_region(NULL),
@@ -257,7 +256,7 @@
_rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0),
_predicted_bytes_to_copy(0)
{
- _rem_set = new HeapRegionRemSet(sharedOffsetArray, this);
+ _rem_set = new HeapRegionRemSet(bot, this);
initialize(mr);
}
@@ -265,7 +264,7 @@
void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
assert(_rem_set->is_empty(), "Remembered set must be empty");
- G1OffsetTableContigSpace::initialize(mr, clear_space, mangle_space);
+ G1ContiguousSpace::initialize(mr, clear_space, mangle_space);
hr_clear(false /*par*/, false /*clear_space*/);
set_top(bottom());
@@ -773,7 +772,7 @@
}
if (!is_young() && !is_empty()) {
- _offsets.verify();
+ _bot_part.verify();
}
if (is_region_humongous) {
@@ -797,7 +796,7 @@
if (p < the_end) {
// Look up top
HeapWord* addr_1 = p;
- HeapWord* b_start_1 = _offsets.block_start_const(addr_1);
+ HeapWord* b_start_1 = _bot_part.block_start_const(addr_1);
if (b_start_1 != p) {
log_info(gc, verify)("BOT look up for top: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
@@ -809,7 +808,7 @@
// Look up top + 1
HeapWord* addr_2 = p + 1;
if (addr_2 < the_end) {
- HeapWord* b_start_2 = _offsets.block_start_const(addr_2);
+ HeapWord* b_start_2 = _bot_part.block_start_const(addr_2);
if (b_start_2 != p) {
log_info(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
@@ -823,7 +822,7 @@
size_t diff = pointer_delta(the_end, p) / 2;
HeapWord* addr_3 = p + diff;
if (addr_3 < the_end) {
- HeapWord* b_start_3 = _offsets.block_start_const(addr_3);
+ HeapWord* b_start_3 = _bot_part.block_start_const(addr_3);
if (b_start_3 != p) {
log_info(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
@@ -835,7 +834,7 @@
// Look up end - 1
HeapWord* addr_4 = the_end - 1;
- HeapWord* b_start_4 = _offsets.block_start_const(addr_4);
+ HeapWord* b_start_4 = _bot_part.block_start_const(addr_4);
if (b_start_4 != p) {
log_info(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
@@ -860,52 +859,41 @@
// G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go
// away eventually.
-void G1OffsetTableContigSpace::clear(bool mangle_space) {
+void G1ContiguousSpace::clear(bool mangle_space) {
set_top(bottom());
_scan_top = bottom();
CompactibleSpace::clear(mangle_space);
reset_bot();
}
-void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) {
- Space::set_bottom(new_bottom);
- _offsets.set_bottom(new_bottom);
-}
-
-void G1OffsetTableContigSpace::set_end(HeapWord* new_end) {
- assert(new_end == _bottom + HeapRegion::GrainWords, "set_end should only ever be set to _bottom + HeapRegion::GrainWords");
- Space::set_end(new_end);
- _offsets.resize(new_end - bottom());
-}
-
#ifndef PRODUCT
-void G1OffsetTableContigSpace::mangle_unused_area() {
+void G1ContiguousSpace::mangle_unused_area() {
mangle_unused_area_complete();
}
-void G1OffsetTableContigSpace::mangle_unused_area_complete() {
+void G1ContiguousSpace::mangle_unused_area_complete() {
SpaceMangler::mangle_region(MemRegion(top(), end()));
}
#endif
-void G1OffsetTableContigSpace::print() const {
+void G1ContiguousSpace::print() const {
print_short();
tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
INTPTR_FORMAT ", " INTPTR_FORMAT ")",
- p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
+ p2i(bottom()), p2i(top()), p2i(_bot_part.threshold()), p2i(end()));
}
-HeapWord* G1OffsetTableContigSpace::initialize_threshold() {
- return _offsets.initialize_threshold();
+HeapWord* G1ContiguousSpace::initialize_threshold() {
+ return _bot_part.initialize_threshold();
}
-HeapWord* G1OffsetTableContigSpace::cross_threshold(HeapWord* start,
+HeapWord* G1ContiguousSpace::cross_threshold(HeapWord* start,
HeapWord* end) {
- _offsets.alloc_block(start, end);
- return _offsets.threshold();
+ _bot_part.alloc_block(start, end);
+ return _bot_part.threshold();
}
-HeapWord* G1OffsetTableContigSpace::scan_top() const {
+HeapWord* G1ContiguousSpace::scan_top() const {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
HeapWord* local_top = top();
OrderAccess::loadload();
@@ -918,7 +906,7 @@
}
}
-void G1OffsetTableContigSpace::record_timestamp() {
+void G1ContiguousSpace::record_timestamp() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
unsigned curr_gc_time_stamp = g1h->get_gc_time_stamp();
@@ -935,17 +923,17 @@
}
}
-void G1OffsetTableContigSpace::record_retained_region() {
+void G1ContiguousSpace::record_retained_region() {
// scan_top is the maximum address where it's safe for the next gc to
// scan this region.
_scan_top = top();
}
-void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) {
+void G1ContiguousSpace::safe_object_iterate(ObjectClosure* blk) {
object_iterate(blk);
}
-void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) {
+void G1ContiguousSpace::object_iterate(ObjectClosure* blk) {
HeapWord* p = bottom();
while (p < top()) {
if (block_is_obj(p)) {
@@ -955,17 +943,14 @@
}
}
-G1OffsetTableContigSpace::
-G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
- MemRegion mr) :
- _offsets(sharedOffsetArray, mr),
+G1ContiguousSpace::G1ContiguousSpace(G1BlockOffsetTable* bot) :
+ _bot_part(bot, this),
_par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
_gc_time_stamp(0)
{
- _offsets.set_space(this);
}
-void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
+void G1ContiguousSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
CompactibleSpace::initialize(mr, clear_space, mangle_space);
_top = bottom();
_scan_top = bottom();