comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 20264:30c99d8e0f02

8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes Reviewed-by: tschatzl, stefank
author mgerdin
date Thu, 06 Mar 2014 09:08:18 +0100
parents c49dcaf78a65
children 5255b195f828
comparison
equal deleted inserted replaced
20263:4dfab3faf5e7 20264:30c99d8e0f02
789 for (cur = bottom(), limit = end(); cur < limit; 789 for (cur = bottom(), limit = end(); cur < limit;
790 cur += curSize) { 790 cur += curSize) {
791 curSize = block_size(cur); 791 curSize = block_size(cur);
792 if (block_is_obj(cur)) { 792 if (block_is_obj(cur)) {
793 oop(cur)->oop_iterate(cl); 793 oop(cur)->oop_iterate(cl);
794 }
795 }
796 }
797
798 // Apply the given closure to each oop in the space \intersect memory region.
799 void CompactibleFreeListSpace::oop_iterate(MemRegion mr, ExtendedOopClosure* cl) {
800 assert_lock_strong(freelistLock());
801 if (is_empty()) {
802 return;
803 }
804 MemRegion cur = MemRegion(bottom(), end());
805 mr = mr.intersection(cur);
806 if (mr.is_empty()) {
807 return;
808 }
809 if (mr.equals(cur)) {
810 oop_iterate(cl);
811 return;
812 }
813 assert(mr.end() <= end(), "just took an intersection above");
814 HeapWord* obj_addr = block_start(mr.start());
815 HeapWord* t = mr.end();
816
817 SpaceMemRegionOopsIterClosure smr_blk(cl, mr);
818 if (block_is_obj(obj_addr)) {
819 // Handle first object specially.
820 oop obj = oop(obj_addr);
821 obj_addr += adjustObjectSize(obj->oop_iterate(&smr_blk));
822 } else {
823 FreeChunk* fc = (FreeChunk*)obj_addr;
824 obj_addr += fc->size();
825 }
826 while (obj_addr < t) {
827 HeapWord* obj = obj_addr;
828 obj_addr += block_size(obj_addr);
829 // If "obj_addr" is not greater than top, then the
830 // entire object "obj" is within the region.
831 if (obj_addr <= t) {
832 if (block_is_obj(obj)) {
833 oop(obj)->oop_iterate(cl);
834 }
835 } else {
836 // "obj" extends beyond end of region
837 if (block_is_obj(obj)) {
838 oop(obj)->oop_iterate(&smr_blk);
839 }
840 break;
841 } 794 }
842 } 795 }
843 } 796 }
844 797
845 // NOTE: In the following methods, in order to safely be able to 798 // NOTE: In the following methods, in order to safely be able to