Release store in C2 putfield

Andrew Haley aph at
Wed Sep 3 14:16:32 UTC 2014

In Parse::do_put_xxx, I see

  const MemNode::MemOrd mo =
    is_vol ?
    // Volatile fields need releasing stores.
    MemNode::release :
    // Non-volatile fields also need releasing stores if they hold an
    // object reference, because the object reference might point to
    // a freshly created object.

AArch64 doesn't need a release store here: its memory guarantees are
strong enough that a simple store is sufficient.  But my question is
not about that, but how to handle it properly.

I can, of course, do something like:

-    StoreNode::release_if_reference(bt);
+    NOT_AARCH64(StoreNode::release_if_reference(bt))
+    AARCH64_ONLY(MemNode::unordered);

But I don't want to put AArch64-specific code in shared files.  There
doesn't seem to be a better way to do it, though.

Any suggestions?


More information about the hotspot-dev mailing list