missing memory barrier in acmp with C2
Roland Westrelin
rwestrel at redhat.com
Fri Oct 28 11:45:35 UTC 2016
> Yes, I get that, in this particular case, it's OK. No argument. But
> the additional cost of loadload|loadstore is close to zero (and may
> actually be zero) on many architectures. Except in some extraordinary
> cases we don't need to apply such finicky reasoning. And if we do, we
> may get it wrong, and we only have to get it wrong once to suffer some
> major pain. So let's not go there.
What about the memory barrier in the shenandoah write barrier:
Address evacuation_in_progress = Address(rthread, in_bytes(JavaThread::evacuation_in_progress_offset()));
ldrb(rscratch1, evacuation_in_progress);
membar(Assembler::LoadLoad);
// The read-barrier.
ldr(dst, Address(dst, BrooksPointer::byte_offset()));
Should it be loadload|loadstore?
The reason I'm asking, is that to expand the barrier as c2 IR, I had to
add support for a loadload memory barrier in the IR. If MemBarAcquire
can be used instead then I can remove all the shared changes for the
loadload memory barrier from my patch.
Roland.
More information about the shenandoah-dev
mailing list