< prev index next >

src/hotspot/share/gc/g1/heapRegion.cpp

Print this page

843     mangle_unused_area();
844   }
845   reset_bot();
846 }
847 
848 #ifndef PRODUCT
849 void HeapRegion::mangle_unused_area() {
850   SpaceMangler::mangle_region(MemRegion(top(), end()));
851 }
852 #endif
853 
854 HeapWord* HeapRegion::initialize_threshold() {
855   return _bot_part.initialize_threshold();
856 }
857 
858 HeapWord* HeapRegion::cross_threshold(HeapWord* start, HeapWord* end) {
859   _bot_part.alloc_block(start, end);
860   return _bot_part.threshold();
861 }
862 
863 void HeapRegion::object_iterate(ObjectClosure* blk) {

864   HeapWord* p = bottom();
865   while (p < top()) {
866     if (block_is_obj(p)) {
867       blk->do_object(cast_to_oop(p));
868     }
869     p += block_size(p);








870   }
871 }

843     mangle_unused_area();
844   }
845   reset_bot();
846 }
847 
848 #ifndef PRODUCT
849 void HeapRegion::mangle_unused_area() {
850   SpaceMangler::mangle_region(MemRegion(top(), end()));
851 }
852 #endif
853 
854 HeapWord* HeapRegion::initialize_threshold() {
855   return _bot_part.initialize_threshold();
856 }
857 
858 HeapWord* HeapRegion::cross_threshold(HeapWord* start, HeapWord* end) {
859   _bot_part.alloc_block(start, end);
860   return _bot_part.threshold();
861 }
862 
863 template<bool RESOLVE>
864 void HeapRegion::object_iterate_impl(ObjectClosure* blk) {
865   HeapWord* p = bottom();
866   while (p < top()) {
867     if (block_is_obj(p)) {
868       blk->do_object(cast_to_oop(p));
869     }
870     p += block_size<RESOLVE>(p);
871   }
872 }
873 
874 void HeapRegion::object_iterate(ObjectClosure* blk) {
875   if (!UseCompactObjectHeaders || G1CollectedHeap::heap()->collector_state()->in_full_gc()) {
876     object_iterate_impl<false>(blk);
877   } else {
878     object_iterate_impl<true>(blk);
879   }
880 }
< prev index next >