diff src/share/vm/gc_implementation/g1/heapRegion.cpp @ 1545:cc387008223e

6921317: (partial) G1: assert(top() == bottom() || zfs == Allocated,"Region must be empty, or we must be setting it to Summary: Extended the failing assertion with the new message format to get more data. Reviewed-by: tonyp
author apetrusenko
date Fri, 14 May 2010 10:28:46 -0700
parents 1316cec51b4d
children c9a07413e82b
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Thu May 13 13:05:47 2010 -0700
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Fri May 14 10:28:46 2010 -0700
@@ -554,11 +554,19 @@
 #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;
 }