RFR: JDK-8203157: Object equals abstraction for BarrierSetAssembler

Erik Osterlund erik.osterlund at oracle.com
Mon Jun 11 17:49:40 UTC 2018


For the record, ZGC is to-space invariant and does not require any equals barriers.


> On 11 Jun 2018, at 19:11, Andrew Haley <aph at redhat.com> wrote:
>> On 06/11/2018 04:56 PM, Andrew Haley wrote:
>>> On 06/08/2018 09:17 PM, Roman Kennke wrote:
>>> Why is it better? And how would I do that? It sounds like a fairly
>>> complex undertaking for a special case. Notice that if the oop doesn't
>>> qualify as immediate operand (quite likely for an oop?) it used to be
>>> moved into rscratch1 anyway a few lines below.
>> Sorry for the slow reply.  I'm looking now.
> OK.  The problem is that this is a very bad code smell:
>      case T_ARRAY:
>        jobject2reg(opr2->as_constant_ptr()->as_jobject(), rscratch1);
>        __ cmpoop(reg1, rscratch1);
> I can't tell that this is correct.  rscratch1 is used by assembler
> macros, and I don't know if some other GC (e.g. ZGC) might need to use
> rscratch1 inside cmpoop.  The risk here is obvious.  The Right Thing
> to do IMO is to generate a scratch register for pointer comparisons.
> Unless, I guess, we know that cmpoop never ever needs a scratch
> register for any forseeable garbage collector.
> -- 
> Andrew Haley
> Java Platform Lead Engineer
> Red Hat UK Ltd. <https://www.redhat.com>
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-dev mailing list