RFR (S) 8152698: Remove obsolete Unsafe.putOrdered{X} methods, usages, runtime and compiler support

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu Mar 24 16:45:57 UTC 2016


(before you freak out about sun.misc.Unsafe, read fully)

Hi,

I would like us to sweep up Unsafe.putOrdered{X} methods in favor of new
and properly-named Unsafe.put{X}Release:
  https://bugs.openjdk.java.net/browse/JDK-8152698

Paul had already prodded the ground for this idea, now it's time to
implement it:
  http://mail.openjdk.java.net/pipermail/hotspot-dev/2015-March/017413.html

putRelease do exactly the same what putOrdered do barrier-wise. In fact,
C2 intrinsics for putOrdered and putRelease are identical. C1
intrinsifies putOrdered into putVolatile. unsafe.cpp also fallbacks to
putVolatile (actually, into a duplicate copy of it).

The only thing left would be sun.misc.Unsafe.putOrdered, which we cannot
yet remove. But, in the spirit of recent Unsafe cleanup, we can fallback
to j.i.m.Unsafe.putRelease, relieving runtime and compilers from even
knowing about putOrdered.

Webrevs:
  http://cr.openjdk.java.net/~shade/8152698/webrev.hs.01/
  http://cr.openjdk.java.net/~shade/8152698/webrev.jdk.01/

Testing: compiler/unsafe jtregs; JPRT -testset hotspot

I'd like to push through hs-comp to meet other VarHandles changes.

Thanks,
-Aleksey



More information about the jdk9-dev mailing list