CAS code misses check for null

Roman Kennke rkennke at redhat.com
Tue Jun 14 13:41:21 UTC 2016


Am Dienstag, den 14.06.2016, 15:01 +0200 schrieb Roland Westrelin:
> > 
> > Do you think that it might be easier to have a macro which takes a
> > dst
> > and does this?
> > 
> > void ShenandoahBarrierSet::interpreter_read_barrier(MacroAssembler*
> > masm, Register src, Register dst) {
> >   Label is_null;
> >   __ mov(dst, src);
> >   __ cbz(src, is_null);
> >   __ ldr(dst, Address(src, BrooksPointer::BYTE_OFFSET));
> >   __ bind(is_null);
> > }
> > 
> > It'd make all this stuff much easier to understand.  And the
> > efficiency would not be very much different.
> It would indeed be much easier to understand. Can I call
> interpreter_read_barrier() directly from
> MacroAssembler::cmpxchg_oop_shenandoah()? I see it's used from other
> places that are not the interpreter.

There's nothing interpreter specific in there, it should probably be
called asm_read_barrier() or just read_barrier(). It started out as
support for the interpreter, but since then has crept into other
places.

Roman



More information about the shenandoah-dev mailing list