CAS code misses check for null

Roland Westrelin rwestrel at redhat.com
Tue Jun 14 09:20:21 UTC 2016


Thanks for looking at this.

> I don't understand this change:
>
> -  bind(fail);
> +  bind(check);
> +
> +  ands(zr, tmp2, expected);
> +  br(EQ, failure);
>
> What does this ANDS do?  I would have thought something more like

It checks if either tmp2 or expected are null and sets the flags. If at
least one is null then we branch to failure.

>     tbz(expected, failure);
>     tbz(tmp2, failure);
>
> would be correct.  Otherwise you're just ANDing bits of an address
> together.
>
> Also,
>
> +
>    if (!acquire) dmb(LD); // Required: updates to the brooks pointer
> -                         // could be missed otherwise
> +  // could be missed otherwise
>
> this change of indentation is wrong.

I will fix that.

Roland.


More information about the shenandoah-dev mailing list