1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Wed Dec 10 23:46:10 2008 -0800 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Thu Dec 11 12:05:08 2008 -0800 1.3 @@ -499,26 +499,15 @@ 1.4 // We lost, someone else "owns" this object 1.5 guarantee(o->is_forwarded(), "Object must be forwarded if the cas failed."); 1.6 1.7 - // Unallocate the space used. NOTE! We may have directly allocated 1.8 - // the object. If so, we cannot deallocate it, so we have to test! 1.9 + // Try to deallocate the space. If it was directly allocated we cannot 1.10 + // deallocate it, so we have to test. If the deallocation fails, 1.11 + // overwrite with a filler object. 1.12 if (new_obj_is_tenured) { 1.13 if (!_old_lab.unallocate_object(new_obj)) { 1.14 - // The promotion lab failed to unallocate the object. 1.15 - // We need to overwrite the object with a filler that 1.16 - // contains no interior pointers. 1.17 - MemRegion mr((HeapWord*)new_obj, new_obj_size); 1.18 - // Clean this up and move to oopFactory (see bug 4718422) 1.19 - SharedHeap::fill_region_with_object(mr); 1.20 + CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); 1.21 } 1.22 - } else { 1.23 - if (!_young_lab.unallocate_object(new_obj)) { 1.24 - // The promotion lab failed to unallocate the object. 1.25 - // We need to overwrite the object with a filler that 1.26 - // contains no interior pointers. 1.27 - MemRegion mr((HeapWord*)new_obj, new_obj_size); 1.28 - // Clean this up and move to oopFactory (see bug 4718422) 1.29 - SharedHeap::fill_region_with_object(mr); 1.30 - } 1.31 + } else if (!_young_lab.unallocate_object(new_obj)) { 1.32 + CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); 1.33 } 1.34 1.35 // don't update this before the unallocation!