8058534: Remove HeapRegion::_orig_end

Also reviewed by kim.barrett@oracle.com

Reviewed-by: tonyp, brutisso, tschatzl
This commit is contained in:
Joseph Provino 2014-09-19 09:23:55 +02:00
parent 366ea37781
commit bc07a22d12
2 changed files with 14 additions and 12 deletions

View file

@ -213,7 +213,7 @@ void HeapRegion::reset_after_compaction() {
void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) { void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
assert(_humongous_start_region == NULL, assert(_humongous_start_region == NULL,
"we should have already filtered out humongous regions"); "we should have already filtered out humongous regions");
assert(_end == _orig_end, assert(_end == orig_end(),
"we should have already filtered out humongous regions"); "we should have already filtered out humongous regions");
_in_collection_set = false; _in_collection_set = false;
@ -266,7 +266,7 @@ void HeapRegion::calc_gc_efficiency() {
void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) { void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) {
assert(!isHumongous(), "sanity / pre-condition"); assert(!isHumongous(), "sanity / pre-condition");
assert(end() == _orig_end, assert(end() == orig_end(),
"Should be normal before the humongous object allocation"); "Should be normal before the humongous object allocation");
assert(top() == bottom(), "should be empty"); assert(top() == bottom(), "should be empty");
assert(bottom() <= new_top && new_top <= new_end, "pre-condition"); assert(bottom() <= new_top && new_top <= new_end, "pre-condition");
@ -280,7 +280,7 @@ void HeapRegion::set_startsHumongous(HeapWord* new_top, HeapWord* new_end) {
void HeapRegion::set_continuesHumongous(HeapRegion* first_hr) { void HeapRegion::set_continuesHumongous(HeapRegion* first_hr) {
assert(!isHumongous(), "sanity / pre-condition"); assert(!isHumongous(), "sanity / pre-condition");
assert(end() == _orig_end, assert(end() == orig_end(),
"Should be normal before the humongous object allocation"); "Should be normal before the humongous object allocation");
assert(top() == bottom(), "should be empty"); assert(top() == bottom(), "should be empty");
assert(first_hr->startsHumongous(), "pre-condition"); assert(first_hr->startsHumongous(), "pre-condition");
@ -294,14 +294,14 @@ void HeapRegion::clear_humongous() {
if (startsHumongous()) { if (startsHumongous()) {
assert(top() <= end(), "pre-condition"); assert(top() <= end(), "pre-condition");
set_end(_orig_end); set_end(orig_end());
if (top() > end()) { if (top() > end()) {
// at least one "continues humongous" region after it // at least one "continues humongous" region after it
set_top(end()); set_top(end());
} }
} else { } else {
// continues humongous // continues humongous
assert(end() == _orig_end, "sanity"); assert(end() == orig_end(), "sanity");
} }
assert(capacity() == HeapRegion::GrainBytes, "pre-condition"); assert(capacity() == HeapRegion::GrainBytes, "pre-condition");
@ -326,7 +326,7 @@ HeapRegion::HeapRegion(uint hrm_index,
_hrm_index(hrm_index), _hrm_index(hrm_index),
_humongous_start_region(NULL), _humongous_start_region(NULL),
_in_collection_set(false), _in_collection_set(false),
_next_in_special_set(NULL), _orig_end(NULL), _next_in_special_set(NULL),
_claimed(InitialClaimValue), _evacuation_failed(false), _claimed(InitialClaimValue), _evacuation_failed(false),
_prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0), _prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
_next_young_region(NULL), _next_young_region(NULL),
@ -349,10 +349,14 @@ void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
G1OffsetTableContigSpace::initialize(mr, clear_space, mangle_space); G1OffsetTableContigSpace::initialize(mr, clear_space, mangle_space);
_orig_end = mr.end();
hr_clear(false /*par*/, false /*clear_space*/); hr_clear(false /*par*/, false /*clear_space*/);
set_top(bottom()); set_top(bottom());
record_top_and_timestamp(); record_top_and_timestamp();
assert(mr.end() == orig_end(),
err_msg("Given region end address " PTR_FORMAT " should match exactly "
"bottom plus one region size, i.e. " PTR_FORMAT,
p2i(mr.end()), p2i(orig_end())));
} }
CompactibleSpace* HeapRegion::next_compaction_space() const { CompactibleSpace* HeapRegion::next_compaction_space() const {

View file

@ -226,9 +226,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
// For a humongous region, region in which it starts. // For a humongous region, region in which it starts.
HeapRegion* _humongous_start_region; HeapRegion* _humongous_start_region;
// For the start region of a humongous sequence, it's original end().
HeapWord* _orig_end;
// True iff the region is in current collection_set. // True iff the region is in current collection_set.
bool _in_collection_set; bool _in_collection_set;
@ -452,7 +449,7 @@ class HeapRegion: public G1OffsetTableContigSpace {
// their _end set up to be the end of the last continues region of the // their _end set up to be the end of the last continues region of the
// corresponding humongous object. // corresponding humongous object.
bool is_in_reserved_raw(const void* p) const { bool is_in_reserved_raw(const void* p) const {
return _bottom <= p && p < _orig_end; return _bottom <= p && p < orig_end();
} }
// Makes the current region be a "starts humongous" region, i.e., // Makes the current region be a "starts humongous" region, i.e.,
@ -556,7 +553,8 @@ class HeapRegion: public G1OffsetTableContigSpace {
void set_next_dirty_cards_region(HeapRegion* hr) { _next_dirty_cards_region = hr; } void set_next_dirty_cards_region(HeapRegion* hr) { _next_dirty_cards_region = hr; }
bool is_on_dirty_cards_region_list() const { return get_next_dirty_cards_region() != NULL; } bool is_on_dirty_cards_region_list() const { return get_next_dirty_cards_region() != NULL; }
HeapWord* orig_end() const { return _orig_end; } // For the start region of a humongous sequence, it's original end().
HeapWord* orig_end() const { return _bottom + GrainWords; }
// Reset HR stuff to default values. // Reset HR stuff to default values.
void hr_clear(bool par, bool clear_space, bool locked = false); void hr_clear(bool par, bool clear_space, bool locked = false);