1.1 --- a/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu May 20 01:34:22 2010 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp Thu May 20 08:32:11 2010 -0700 1.3 @@ -554,11 +554,19 @@ 1.4 #endif 1.5 1.6 void HeapRegion::set_zero_fill_state_work(ZeroFillState zfs) { 1.7 - assert(top() == bottom() || zfs == Allocated, 1.8 - "Region must be empty, or we must be setting it to allocated."); 1.9 assert(ZF_mon->owned_by_self() || 1.10 Universe::heap()->is_gc_active(), 1.11 "Must hold the lock or be a full GC to modify."); 1.12 +#ifdef ASSERT 1.13 + if (top() != bottom() && zfs != Allocated) { 1.14 + ResourceMark rm; 1.15 + stringStream region_str; 1.16 + print_on(®ion_str); 1.17 + assert(top() == bottom() || zfs == Allocated, 1.18 + err_msg("Region must be empty, or we must be setting it to allocated. " 1.19 + "_zfs=%d, zfs=%d, region: %s", _zfs, zfs, region_str.as_string())); 1.20 + } 1.21 +#endif 1.22 _zfs = zfs; 1.23 } 1.24