RFR: JDK-8210656: Object equals abstraction for BarrierSetC2

Roman Kennke rkennke at redhat.com
Wed Sep 12 20:11:51 UTC 2018


This introduces an abstraction to deal with object equality in
BarrierSetC2. This is needed by GCs that can have different copies of
same objects alive like Shenandoah.

The approach chosen here is slightly different than we did in e.g.
BarrierSetAssembler and the runtime Access API: instead of owning the
whole equality, it only provides a resolve-like method to resolve the
operands to stable values. The reason for doing this is that it's easier
to do this way in intrinsics if those barriers are detached from the
actual CmpP. This is because the barriers create new memory states, and
we'd have to create memphis around those things, which is considerably
more complex.

I chose to add a new resolve_for_obj_equals(a, b) method instead of
using two calls to resolve(a); resolve(b); because this allows for
optimization: if any of a or b is known to be NULL, we can elide
barriers for both. This is not possible to do with two independent
resolve() calls.

Bug:
https://bugs.openjdk.java.net/browse/JDK-8210656
Webrev:
http://cr.openjdk.java.net/~rkennke/JDK-8210656/webrev.00/

Testing: passes hotspot/jtreg:tier1

What do you think about this?

Thanks,
Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20180912/bb052a85/signature.asc>


More information about the hotspot-gc-dev mailing list