[concurrency-interest] jdk9 VarHandle and Fence methods

Vitaly Davidovich vitalyd at gmail.com
Mon Sep 14 19:41:22 EDT 2015


>
> The reason I asked is that in JK8, Unsafe#getAndSetObject isn't even
> declared
> native (looking at Unsafe.java) - I assume that means it isn't even
> eligible
> for intrinsics (I was surprised that it wasn't native).


Methods don't need to be native to be intrinsified.

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7023898 did the
intrinsification, which is available in java 8; just tried this on 8u40,
and getAndSetObject just emits XCHG (this is on x86_64).

On Mon, Sep 14, 2015 at 6:12 PM, thurstonn <thurston at nomagicsoftware.com>
wrote:

> The reason I asked is that in JK8, Unsafe#getAndSetObject isn't even
> declared
> native (looking at Unsafe.java) - I assume that means it isn't even
> eligible
> for intrinsics (I was surprised that it wasn't native).
>
> I came across some code (akka?) that was using some workaround because
> (according to a comment) Unsafe#getAndSetObject wasn't intrinsified;
> obviously that wasn't referring to jdk 9
>
>
>
> --
> View this message in context:
> http://jsr166-concurrency.10961.n7.nabble.com/jdk9-VarHandle-and-Fence-methods-tp12666p12754.html
> Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
> _______________________________________________
> 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/20150914/6edc76a6/attachment-0001.html>


More information about the Concurrency-interest mailing list