[concurrency-interest] Is Reference.reachabilityFence() needed in Reference constructor?

Vitaly Davidovich vitalyd at gmail.com
Mon Oct 26 21:07:22 EDT 2015


http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/5d13c9b094c4/src/share/vm/opto/library_call.cpp#l5629

C2 does inline it but intentionally forbids commoning out reads of
Reference.get.  However, this needs a real fix not a hack.

sent from my phone
On Oct 26, 2015 3:22 PM, "Justin Sampson" <jsampson at guidewire.com> wrote:

> Alex Otenko wrote:
>
> > Wouldn't it be possible to add a test that will always be false?
> >
> > eg
> > [...]
> > if (get() != referent) {
> > [...]
> >
> > The point being that referent would need to stay alive due to
> > Java semantics to align with get() and queue assignment.
>
> Couldn't the compiler just inline get() as this.referent, see that
> this.referent was just set to referent, and simplify this.referent
> != referent to false?
>
> Cheers,
> Justin
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20151026/30197748/attachment.html>


More information about the Concurrency-interest mailing list