RFR #2 (M) 8148146: Integrate new internal Unsafe entry points, and basic intrinsic support for VarHandles

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Feb 17 11:24:58 UTC 2016


On 02/17/2016 12:29 AM, Andrew Dinn wrote:
> On 15/02/16 14:13, Andrew Dinn wrote:
>>> The changes are supposed to generate the same code for old Unsafe 
>>> methods -- the refactoring shuffles the compiler code around, but
>>> the sequence of accesses/barriers should stay the same. Eyeballing
>>> x86_64 assembly indeed shows it is the same, but I haven't looked
>>> beyond x86.
> 
> Unfortunately, the graphs are not quite the same and that affects the
> generated code on AArch64 even though it has no visible effect on x86.
> The critical difference is that for volatile puts and gets you have
> omitted to insert the MemBarRelease and MemBarAcquire nodes.

Dang. You are right, I have mistranslated the original code. Thanks for
catching this one!

New version that includes a variant of your fix, and also trims down on
Unsafe changes, as John suggested in a separate thread:
  http://cr.openjdk.java.net/~shade/8148146/webrev.hs.02/
  http://cr.openjdk.java.net/~shade/8148146/webrev.jdk.02/

This version still passes JPRT, microbenchmark results are fine. I am
respinning other tests to see if anything is broken.

Cheers,
-Aleksey

P.S. Andrew, if you have before/after builds for AArch64 and a suitable
physical rig, you might be interested to run Unsafe benchmarks (this is
a JMH runnable JAR):
  http://cr.openjdk.java.net/~shade/varhandles/unsafe-bench.jar




More information about the jdk9-dev mailing list