RFR 8158039 VarHandle float/double field/array access should support CAS/set/add atomics

Paul Sandoz paul.sandoz at oracle.com
Wed Jun 1 15:24:14 UTC 2016

(Please note this work is or will be covered with FC exception)


Please review the VarHandles/Unsafe support for atomic ops on double/float fields/arrays.

  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8158039-float-double-field-array-cas.jdk/webrev/ <http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8158039-float-double-field-array-cas.jdk/webrev/>
  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8158039-float-double-field-array-cas.hotspot/webrev/ <http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8158039-float-double-field-array-cas.hotspot/webrev/>

These patches are based on those of for sub-word CAS

  https://bugs.openjdk.java.net/browse/JDK-8157726 <https://bugs.openjdk.java.net/browse/JDK-8157726>
  http://cr.openjdk.java.net/~shade/8157726/webrev.hs.03/ <http://cr.openjdk.java.net/~shade/8157726/webrev.hs.03/>
  http://cr.openjdk.java.net/~shade/8157726/webrev.jdk.03/ <http://cr.openjdk.java.net/~shade/8157726/webrev.jdk.03/>

And the two patches combined expand the support of fields/arrays.

New float/double CAS methods are added to Unsafe that defer to int/long equivalents. Then the other atomic methods are built from weak CAS loops.

No changes are required to HotSpot, but changes are required to the Unsafe tests in the hotspot repository.

In general the changes to VHs and tests are minimal since it is triggered from changes to the generating scripts that now include float/double into the CAS category.

There are some minor specification changes and a CCC has been initiated.

JPRT tests results show no relevant failures for hotspot and core test sets.


More information about the jdk9-dev mailing list