RFR: Fix object iteration over limit
Dominik Inführ
dominik.infuehr at gmail.com
Wed Oct 18 17:16:17 UTC 2017
On Wed, Oct 18, 2017 at 2:59 PM, Aleksey Shipilev <shade at redhat.com> wrote:
> 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
>
Although I can't speak for everyone, this is certainly true for me ;)
>
> -Aleksey
>
>
More information about the shenandoah-dev
mailing list