6921317: (partial) G1: assert(top() == bottom() || zfs == Allocated,"Region must be empty, or we must be setting it to

Extended the failing assertion with the new message format to get more data.

Reviewed-by: tonyp
This commit is contained in:
Andrey Petrusenko 2010-05-14 10:28:46 -07:00
parent d14dfb51af
commit 0d3978019b
2 changed files with 31 additions and 12 deletions

View file

@ -554,11 +554,19 @@ HeapWord* HeapRegion::allocate(size_t size) {
#endif
void HeapRegion::set_zero_fill_state_work(ZeroFillState zfs) {
assert(top() == bottom() || zfs == Allocated,
"Region must be empty, or we must be setting it to allocated.");
assert(ZF_mon->owned_by_self() ||
Universe::heap()->is_gc_active(),
"Must hold the lock or be a full GC to modify.");
#ifdef ASSERT
if (top() != bottom() && zfs != Allocated) {
ResourceMark rm;
stringStream region_str;
print_on(&region_str);
assert(top() == bottom() || zfs == Allocated,
err_msg("Region must be empty, or we must be setting it to allocated. "
"_zfs=%d, zfs=%d, region: %s", _zfs, zfs, region_str.as_string()));
}
#endif
_zfs = zfs;
}