/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc_implementation/g1/heapRegionSet.inline.hpp"
//////////////////// HeapRegionSetBase ////////////////////
}
}
if (!regions_humongous()) {
if (hr->isHumongous()) {
error_message = "the region should not be humongous";
}
} else {
error_message = "the region should be 'starts humongous'";
}
}
if (!regions_empty()) {
error_message = "the region should not be empty";
}
} else {
error_message = "the region should be empty";
}
}
#ifdef ASSERT
// The _containing_set field is only available when ASSERT is defined.
error_message = "inconsistent containing set found";
}
#endif // ASSERT
if (extra_error_message != NULL) {
}
if (error_message != NULL) {
#ifdef ASSERT
#endif // ASSERT
return false;
} else {
return true;
}
}
// It's important that we also observe the MT safety protocol even
// for the verification calls. If we do verification without the
// appropriate locks and the set changes underneath our feet
// verification might fail and send us on a wild goose chase.
hrs_assert_mt_safety_ok(this);
total_used_bytes() == 0 && total_capacity_bytes() == 0) ||
total_used_bytes() >= 0 && total_capacity_bytes() >= 0),
hrs_ext_msg(this, "invariant"));
hrs_ext_msg(this, "invariant"));
hrs_ext_msg(this, "invariant"));
hrs_ext_msg(this, "invariant"));
}
// See comment in verify() about MT safety and verification.
hrs_assert_mt_safety_ok(this);
hrs_ext_msg(this, "verification should not be in progress"));
// Do the basic verification first before we do the checks over the regions.
_calc_length = 0;
_calc_region_num = 0;
_verify_in_progress = true;
}
// See comment in verify() about MT safety and verification.
hrs_assert_mt_safety_ok(this);
hrs_ext_msg(this, "verification should be in progress"));
_calc_length += 1;
}
// See comment in verify() about MT safety and verification.
hrs_assert_mt_safety_ok(this);
hrs_ext_msg(this, "verification should be in progress"));
hrs_err_msg("[%s] length: %u should be == calc length: %u",
hrs_err_msg("[%s] region num: %u should be == calc region num: %u",
"calc capacity bytes: "SIZE_FORMAT,
name(),
"calc used bytes: "SIZE_FORMAT,
_verify_in_progress = false;
}
}
}
total_used_bytes());
}
_length = 0;
_region_num = 0;
_total_used_bytes = 0;
}
_calc_length(0), _calc_region_num(0),
_calc_total_capacity_bytes(0), _calc_total_used_bytes(0) { }
//////////////////// HeapRegionSet ////////////////////
hrs_assert_mt_safety_ok(this);
hrs_assert_sets_match(this, proxy_set);
hrs_err_msg("[%s] proxy set length: %u should be <= length: %u",
hrs_err_msg("[%s] proxy set region num: %u should be <= region num: %u",
"should be <= used bytes: "SIZE_FORMAT,
}
//////////////////// HeapRegionLinkedList ////////////////////
}
hrs_assert_mt_safety_ok(this);
#ifdef ASSERT
while (iter.more_available()) {
// In set_containing_set() we check that we either set the value
// from NULL to non-NULL or vice versa to catch bugs. So, we have
// to NULL it first before setting it to the value.
hr->set_containing_set(this);
}
#endif // ASSERT
} else {
}
}
hrs_assert_mt_safety_ok(this);
#ifdef ASSERT
while (iter.more_available()) {
// In set_containing_set() we check that we either set the value
// from NULL to non-NULL or vice versa to catch bugs. So, we have
// to NULL it first before setting it to the value.
hr->set_containing_set(this);
}
#endif // ASSERT
} else {
}
}
hrs_assert_mt_safety_ok(this);
hrs_assert_region_ok(this, curr, this);
}
clear();
}
hrs_assert_mt_safety_ok(this);
hrs_assert_region_ok(this, curr, this);
if (curr->pending_removal()) {
hrs_err_msg("[%s] should not come across more regions "
"pending for removal than target_count: %u",
name(), target_count));
} else {
}
} else {
}
curr->set_pending_removal(false);
count += 1;
// If we have come across the target number of regions we can
// just bail out. However, for debugging purposes, we can just
// carry on iterating to make sure there are not more regions
// tagged with pending removal.
} else {
}
}
hrs_err_msg("[%s] count: %u should be == target_count: %u",
hrs_err_msg("[%s] new length should be consistent "
"new length: %u old length: %u target_count: %u",
}
void HeapRegionLinkedList::verify() {
// See comment in HeapRegionSetBase::verify() about MT safety and
// verification.
hrs_assert_mt_safety_ok(this);
// This will also do the basic verification too.
verify_start();
count += 1;
hrs_err_msg("[%s] the calculated length: %u "
"seems very long, is there maybe a cycle? "
}
verify_end();
}
void HeapRegionLinkedList::clear() {
}
if (print_contents) {
HeapRegionLinkedListIterator iter(this);
while (iter.more_available()) {
}
}
}