CAS code misses check for null
Roland Westrelin
rwestrel at redhat.com
Tue Jun 14 13:01:57 UTC 2016
> 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.
Roiland.
More information about the shenandoah-dev
mailing list