< prev index next >

src/hotspot/share/gc/z/zLiveMap.inline.hpp

Print this page




 127 inline BitMap::idx_t ZLiveMap::segment_start(BitMap::idx_t segment) const {
 128   return segment_size() * segment;
 129 }
 130 
 131 inline BitMap::idx_t ZLiveMap::segment_end(BitMap::idx_t segment) const {
 132   return segment_start(segment) + segment_size();
 133 }
 134 
 135 inline void ZLiveMap::iterate_segment(ObjectClosure* cl, BitMap::idx_t segment, uintptr_t page_start, size_t page_object_alignment_shift) {
 136   assert(is_segment_live(segment), "Must be");
 137 
 138   const BitMap::idx_t start_index = segment_start(segment);
 139   const BitMap::idx_t end_index   = segment_end(segment);
 140   BitMap::idx_t index = _bitmap.get_next_one_offset(start_index, end_index);
 141 
 142   while (index < end_index) {
 143     // Calculate object address
 144     const uintptr_t addr = page_start + ((index / 2) << page_object_alignment_shift);
 145 
 146     // Apply closure
 147     cl->do_object(ZOop::from_address(addr));
 148 
 149     // Find next bit after this object
 150     const size_t size = ZUtils::object_size(addr);
 151     const uintptr_t next_addr = align_up(addr + size, 1 << page_object_alignment_shift);
 152     const BitMap::idx_t next_index = ((next_addr - page_start) >> page_object_alignment_shift) * 2;
 153     if (next_index >= end_index) {
 154       // End of live map
 155       break;
 156     }
 157 
 158     index = _bitmap.get_next_one_offset(next_index, end_index);
 159   }
 160 }
 161 
 162 inline void ZLiveMap::iterate(ObjectClosure* cl, uintptr_t page_start, size_t page_object_alignment_shift) {
 163   if (is_marked()) {
 164     for (BitMap::idx_t segment = first_live_segment(); segment < nsegments; segment = next_live_segment(segment)) {
 165       // For each live segment
 166       iterate_segment(cl, segment, page_start, page_object_alignment_shift);
 167     }


 127 inline BitMap::idx_t ZLiveMap::segment_start(BitMap::idx_t segment) const {
 128   return segment_size() * segment;
 129 }
 130 
 131 inline BitMap::idx_t ZLiveMap::segment_end(BitMap::idx_t segment) const {
 132   return segment_start(segment) + segment_size();
 133 }
 134 
 135 inline void ZLiveMap::iterate_segment(ObjectClosure* cl, BitMap::idx_t segment, uintptr_t page_start, size_t page_object_alignment_shift) {
 136   assert(is_segment_live(segment), "Must be");
 137 
 138   const BitMap::idx_t start_index = segment_start(segment);
 139   const BitMap::idx_t end_index   = segment_end(segment);
 140   BitMap::idx_t index = _bitmap.get_next_one_offset(start_index, end_index);
 141 
 142   while (index < end_index) {
 143     // Calculate object address
 144     const uintptr_t addr = page_start + ((index / 2) << page_object_alignment_shift);
 145 
 146     // Apply closure
 147     cl->do_object(ZOop::to_oop(addr));
 148 
 149     // Find next bit after this object
 150     const size_t size = ZUtils::object_size(addr);
 151     const uintptr_t next_addr = align_up(addr + size, 1 << page_object_alignment_shift);
 152     const BitMap::idx_t next_index = ((next_addr - page_start) >> page_object_alignment_shift) * 2;
 153     if (next_index >= end_index) {
 154       // End of live map
 155       break;
 156     }
 157 
 158     index = _bitmap.get_next_one_offset(next_index, end_index);
 159   }
 160 }
 161 
 162 inline void ZLiveMap::iterate(ObjectClosure* cl, uintptr_t page_start, size_t page_object_alignment_shift) {
 163   if (is_marked()) {
 164     for (BitMap::idx_t segment = first_live_segment(); segment < nsegments; segment = next_live_segment(segment)) {
 165       // For each live segment
 166       iterate_segment(cl, segment, page_start, page_object_alignment_shift);
 167     }
< prev index next >