RFR: 8229470: Shenandoah: Fix C1 getAndSetObject() failure

Roman Kennke roman at kennke.org
Tue Aug 13 11:28:43 UTC 2019


>> Fix:
>> http://cr.openjdk.java.net/~rkennke/JDK-8229470/webrev.00/
>> Testing: failed testcase, hotspot_gc_shenandoah
> 
> It fixes the failure for me.
> 
> But how does this fix work? Does that failure happen at pre_barrier path? If so, should it be moved
> under ShenandoahSATBBarrier branch, or into the pre_barrier itself?

The intrinsic code doesn't like a physical register in set_result().
However, yesterday I changed to:

  LIR_Opr result = gen->result_register_for(obj->value_type());

in load_reference_barrier(), which allocates a physical reg (rax on x86,
r0 on aarch64). This is done so that we have the result reg in the right
place for the runtime call, which returns the oop in that register. This
avoids some register shuffling in the LRB stub. However, it doesn't work
for xchg, and this fix allocates a (virtual) tmp reg, and copies the
result into that. Depending on C1 regalloc, this may result in the
shuffling that we originally avoided, or it may actually get the result
in rax/r0 in which case the __ move(..) amounts to a noop. In any case,
the extra shuffling is only done in xchg().

Roman


More information about the shenandoah-dev mailing list