1.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Tue Jan 06 07:05:05 2009 -0800 1.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Sun Jan 11 16:58:24 2009 -0800 1.3 @@ -6633,7 +6633,11 @@ 1.4 if (_bitMap->isMarked(addr)) { 1.5 // it's marked; is it potentially uninitialized? 1.6 if (p->klass_or_null() != NULL) { 1.7 - if (CMSPermGenPrecleaningEnabled && !p->is_parsable()) { 1.8 + // If is_conc_safe is false, the object may be undergoing 1.9 + // change by the VM outside a safepoint. Don't try to 1.10 + // scan it, but rather leave it for the remark phase. 1.11 + if (CMSPermGenPrecleaningEnabled && 1.12 + (!p->is_conc_safe() || !p->is_parsable())) { 1.13 // Signal precleaning to redirty the card since 1.14 // the klass pointer is already installed. 1.15 assert(size == 0, "Initial value"); 1.16 @@ -8071,9 +8075,13 @@ 1.17 #ifdef DEBUG 1.18 if (oop(addr)->klass_or_null() != NULL && 1.19 ( !_collector->should_unload_classes() 1.20 - || oop(addr)->is_parsable())) { 1.21 + || (oop(addr)->is_parsable()) && 1.22 + oop(addr)->is_conc_safe())) { 1.23 // Ignore mark word because we are running concurrent with mutators 1.24 assert(oop(addr)->is_oop(true), "live block should be an oop"); 1.25 + // is_conc_safe is checked before performing this assertion 1.26 + // because an object that is not is_conc_safe may yet have 1.27 + // the return from size() correct. 1.28 assert(size == 1.29 CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()), 1.30 "P-mark and computed size do not agree"); 1.31 @@ -8086,6 +8094,13 @@ 1.32 (!_collector->should_unload_classes() 1.33 || oop(addr)->is_parsable()), 1.34 "Should be an initialized object"); 1.35 + // Note that there are objects used during class redefinition 1.36 + // (e.g., merge_cp in VM_RedefineClasses::merge_cp_and_rewrite() 1.37 + // which are discarded with their is_conc_safe state still 1.38 + // false. These object may be floating garbage so may be 1.39 + // seen here. If they are floating garbage their size 1.40 + // should be attainable from their klass. Do not that 1.41 + // is_conc_safe() is true for oop(addr). 1.42 // Ignore mark word because we are running concurrent with mutators 1.43 assert(oop(addr)->is_oop(true), "live block should be an oop"); 1.44 // Verify that the bit map has no bits marked between