RFR: Fix object iteration over limit

Aleksey Shipilev shade at redhat.com
Wed Oct 18 12:59:36 UTC 2017


On 10/18/2017 02:58 PM, Dominik Inführ wrote:
>    HeapWord* end = MIN2(top_at_mark_start + BrooksPointer::word_size(), region->end());
> + HeapWord* limit_bitmap = MIN2(limit, top_at_mark_start);
> +
>    HeapWord* addr = mark_bit_map->getNextMarkedWordAddress(start, end);
>  
> + // We have stepped over the TAMS with bitmap scan, rewind back:
> + if (addr >= top_at_mark_start) {
> + addr = top_at_mark_start + BrooksPointer::word_size();
> + }
> 
> I don't understand why this `if` here is necessary. mark_bit_map->getNextMarkedWordAddress(start,
> end) returns a value between [start, end]. Where end = TAMS+BrooksPointer::word_size() (or
> region->end() if smaller but this shouldn't be relevant here).
> Hence addr should already be in [start, TAMS+BrooksPointer::word_size()]. addr == TAMS shouldn't be
> possible since we mark the object, not the fwdptr before it. Where am I mistaken here?

That's right. The updated patch would not have that.

> Again, I'm sorry for being annoying, but I might have to adapt this code for my thesis, so I guess
> it is good if I understand this.

No problem, it is the rite of passage for every beginner to understand marked_object_iterate :D

-Aleksey



More information about the shenandoah-dev mailing list