comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @ 20266:6c523f5d5440

8038412: Move object_iterate_careful down from Space to ContigousSpace and CFLSpace Summary: Only declare the functions where they are actually needed. Reviewed-by: tschatzl, stefank
author mgerdin
date Wed, 12 Mar 2014 17:13:48 +0100
parents 5255b195f828
children 4001310db3f5
comparison
equal deleted inserted replaced
20265:5255b195f828 20266:6c523f5d5440
905 assert(blk_start_addr > prev, "Invariant"); 905 assert(blk_start_addr > prev, "Invariant");
906 cl->set_previous(blk_start_addr); // min address for next time 906 cl->set_previous(blk_start_addr); // min address for next time
907 } 907 }
908 } 908 }
909 909
910 // Callers of this iterator beware: The closure application should
911 // be robust in the face of uninitialized objects and should (always)
912 // return a correct size so that the next addr + size below gives us a
913 // valid block boundary. [See for instance,
914 // ScanMarkedObjectsAgainCarefullyClosure::do_object_careful()
915 // in ConcurrentMarkSweepGeneration.cpp.]
916 HeapWord*
917 CompactibleFreeListSpace::object_iterate_careful(ObjectClosureCareful* cl) {
918 assert_lock_strong(freelistLock());
919 HeapWord *addr, *last;
920 size_t size;
921 for (addr = bottom(), last = end();
922 addr < last; addr += size) {
923 FreeChunk* fc = (FreeChunk*)addr;
924 if (fc->is_free()) {
925 // Since we hold the free list lock, which protects direct
926 // allocation in this generation by mutators, a free object
927 // will remain free throughout this iteration code.
928 size = fc->size();
929 } else {
930 // Note that the object need not necessarily be initialized,
931 // because (for instance) the free list lock does NOT protect
932 // object initialization. The closure application below must
933 // therefore be correct in the face of uninitialized objects.
934 size = cl->do_object_careful(oop(addr));
935 if (size == 0) {
936 // An unparsable object found. Signal early termination.
937 return addr;
938 }
939 }
940 }
941 return NULL;
942 }
943 910
944 // Callers of this iterator beware: The closure application should 911 // Callers of this iterator beware: The closure application should
945 // be robust in the face of uninitialized objects and should (always) 912 // be robust in the face of uninitialized objects and should (always)
946 // return a correct size so that the next addr + size below gives us a 913 // return a correct size so that the next addr + size below gives us a
947 // valid block boundary. [See for instance, 914 // valid block boundary. [See for instance,