comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 517:e9be0e04635a

6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off Summary: Added safe_object_iterate() for use by JMapPerm. Reviewed-by: tonyp
author jmasa
date Tue, 06 Jan 2009 07:05:05 -0800
parents 5d254928c888
children 0af8b0718fc9
comparison
equal deleted inserted replaced
500:ca7d48236048 517:e9be0e04635a
704 blk->do_object(oop(cur)); 704 blk->do_object(oop(cur));
705 } 705 }
706 } 706 }
707 } 707 }
708 708
709 // Apply the given closure to each live object in the space
710 // The usage of CompactibleFreeListSpace
711 // by the ConcurrentMarkSweepGeneration for concurrent GC's allows
712 // objects in the space with references to objects that are no longer
713 // valid. For example, an object may reference another object
714 // that has already been sweep up (collected). This method uses
715 // obj_is_alive() to determine whether it is safe to apply the closure to
716 // an object. See obj_is_alive() for details on how liveness of an
717 // object is decided.
718
719 void CompactibleFreeListSpace::safe_object_iterate(ObjectClosure* blk) {
720 assert_lock_strong(freelistLock());
721 NOT_PRODUCT(verify_objects_initialized());
722 HeapWord *cur, *limit;
723 size_t curSize;
724 for (cur = bottom(), limit = end(); cur < limit;
725 cur += curSize) {
726 curSize = block_size(cur);
727 if (block_is_obj(cur) && obj_is_alive(cur)) {
728 blk->do_object(oop(cur));
729 }
730 }
731 }
732
709 void CompactibleFreeListSpace::object_iterate_mem(MemRegion mr, 733 void CompactibleFreeListSpace::object_iterate_mem(MemRegion mr,
710 UpwardsObjectClosure* cl) { 734 UpwardsObjectClosure* cl) {
711 assert_locked(); 735 assert_locked();
712 NOT_PRODUCT(verify_objects_initialized()); 736 NOT_PRODUCT(verify_objects_initialized());
713 Space::object_iterate_mem(mr, cl); 737 Space::object_iterate_mem(mr, cl);