> On 15 Apr 2017, at 08:51, Gil Tene <g...@azul.com> wrote:
> A few things are keeping the JDK code from evolving to properly use 
> Reference.reachabilityFence(this):
> 
> a. It didn't exist until recently. [That's a very good excuse]
> 
> b. While Reference.reachabilityFence exists now, it's implementation is 
> sub-optimal. IUUC it is modeled [currently] as an opaque method call, which 
> prohibits enough useful optimizations to significantly hurt 
> DirectByteBuffer.get() if it were actually included in the code right now.
> 

Correct, reachabilityFence is sort of bodged using @DontInline, which was a 
fine technique for getting this method in, ok for stuff that ain’t so 
performance sensitive (many of the use cases?), but not really ok for use 
within DBB (and for Panama stuff). See:

  https://bugs.openjdk.java.net/browse/JDK-8169605 (IMHO the priority should be 
higher, P4 if not P3)
  https://bugs.openjdk.java.net/browse/JDK-8149610 (more for the comment).

Paul.

Reply via email to