125 } |
125 } |
126 |
126 |
127 // Optimized for finding the first object that crosses into |
127 // Optimized for finding the first object that crosses into |
128 // a given block. The blocks contain the offset of the last |
128 // a given block. The blocks contain the offset of the last |
129 // object in that block. Scroll backwards by one, and the first |
129 // object in that block. Scroll backwards by one, and the first |
130 // object hit should be at the begining of the block |
130 // object hit should be at the beginning of the block |
131 HeapWord* object_start(HeapWord* addr) const { |
131 HeapWord* object_start(HeapWord* addr) const { |
132 assert(_covered_region.contains(addr), "Must be in covered region"); |
132 assert(_covered_region.contains(addr), "Must be in covered region"); |
133 jbyte* block = block_for_addr(addr); |
133 jbyte* block = block_for_addr(addr); |
134 HeapWord* scroll_forward = offset_addr_for_block(block--); |
134 HeapWord* scroll_forward = offset_addr_for_block(block--); |
135 while (scroll_forward > addr) { |
135 while (scroll_forward > addr) { |