RFR: JDK-8221766: Load-reference barriers for Shenandoah

Roman Kennke rkennke at redhat.com
Mon Apr 8 08:36:05 UTC 2019


On 4/7/19 7:18 PM, Roman Kennke wrote:
> > On 4/2/19 10:12 PM, Roman Kennke wrote:
> > > > - No more need for object equals barriers.
> > > 
> > > I'm pleased about that. I really hated the AArch64 Shenandoah
> > > CAS!
> > 
> > I'm sorry to disappoint you, but the CAS barrier is still needed.
> > The
> > memory location may still legally hold a from-space reference, and
> > comparing that to a to-space reference needs some special care. And
> > yes, ZGC has a similar problem as far as I know.
> 
> That's interesting. Could we not simply promote the reference in the
> reference field we're CASing, then do a normal CAS?

Yes. But it requires two CASes in a row. Don't know if that is better
than our loop, which is rarely even entered (normally the CAS-construct 
goes via fast-path with a single CAS).

Roman



More information about the build-dev mailing list