Merge
authoramurillo
Thu, 07 Jul 2016 18:35:29 +0000
changeset 39496 93c58a80c7f3
parent 39459 219274c0ea2e (current diff)
parent 39495 80833370f1b8 (diff)
child 39497 7701abdf2fb4
Merge
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmGlobalPool.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmModulePool.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPlugin.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPool.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPoolImpl.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPools.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/ControlFlow.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/ForNameFolding.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/ReflectionOptimizer.java
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/Utils.java
jdk/test/sun/security/tools/keytool/printssl.sh
jdk/test/tools/jlink/JLinkOptimTest.java
jdk/test/tools/jlink/asmplugin/AddForgetResourcesTest.java
jdk/test/tools/jlink/asmplugin/AsmPluginTestBase.java
jdk/test/tools/jlink/asmplugin/BasicTest.java
jdk/test/tools/jlink/asmplugin/IdentityPluginTest.java
jdk/test/tools/jlink/asmplugin/NegativeTest.java
jdk/test/tools/jlink/asmplugin/PackageMappingTest.java
jdk/test/tools/jlink/asmplugin/SortingTest.java
jdk/test/tools/jlink/asmplugin/VisitorTest.java
--- a/jdk/make/gensrc/GensrcVarHandles.gmk	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/make/gensrc/GensrcVarHandles.gmk	Thu Jul 07 18:35:29 2016 +0000
@@ -38,12 +38,14 @@
 
   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java
 
-  ifneq ($$(findstring $$($1_Type), Object Int Long), )
-    $1_ARGS += -KCAS
+  $1_ARGS += -KCAS
+
+  ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), )
+    $1_ARGS += -KAtomicAdd
   endif
 
-  ifneq ($$(findstring $$($1_Type), Int Long), )
-    $1_ARGS += -KAtomicAdd
+  ifneq ($$(findstring $$($1_Type), Byte Short Char), )
+    $1_ARGS += -KShorterThanInt
   endif
 
   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
--- a/jdk/src/java.base/share/classes/java/lang/ThreadGroup.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/ThreadGroup.java	Thu Jul 07 18:35:29 2016 +0000
@@ -60,7 +60,6 @@
     int maxPriority;
     boolean destroyed;
     boolean daemon;
-    boolean vmAllowSuspension;
 
     int nUnstartedThreads = 0;
     int nthreads;
@@ -121,7 +120,6 @@
         this.name = name;
         this.maxPriority = parent.maxPriority;
         this.daemon = parent.daemon;
-        this.vmAllowSuspension = parent.vmAllowSuspension;
         this.parent = parent;
         parent.add(this);
     }
@@ -1075,10 +1073,6 @@
      */
     @Deprecated(since="1.2")
     public boolean allowThreadSuspension(boolean b) {
-        this.vmAllowSuspension = b;
-        if (!b) {
-            VM.unsuspendSomeThreads();
-        }
         return true;
     }
 
--- a/jdk/src/java.base/share/classes/java/lang/annotation/AnnotationTypeMismatchException.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/annotation/AnnotationTypeMismatchException.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
     /**
      * The {@code Method} object for the annotation element.
      */
-    private final Method element;
+    private final transient Method element;
 
     /**
      * The (erroneous) type of data found in the annotation.  This string
@@ -57,10 +57,12 @@
      * Constructs an AnnotationTypeMismatchException for the specified
      * annotation type element and found data type.
      *
-     * @param element the {@code Method} object for the annotation element
+     * @param element the {@code Method} object for the annotation
+     * element, may be {@code null}
      * @param foundType the (erroneous) type of data found in the annotation.
      *        This string may, but is not required to, contain the value
-     *        as well.  The exact format of the string is unspecified.
+     *        as well.  The exact format of the string is unspecified,
+     *        may be {@code null}.
      */
     public AnnotationTypeMismatchException(Method element, String foundType) {
         super("Incorrectly typed data found for annotation element " + element
@@ -71,8 +73,11 @@
 
     /**
      * Returns the {@code Method} object for the incorrectly typed element.
+     * The value may be unavailable if this exception has been
+     * serialized and then read back in.
      *
-     * @return the {@code Method} object for the incorrectly typed element
+     * @return the {@code Method} object for the incorrectly typed
+     * element, or {@code null} if unavailable
      */
     public Method element() {
         return this.element;
@@ -81,7 +86,8 @@
     /**
      * Returns the type of data found in the incorrectly typed element.
      * The returned string may, but is not required to, contain the value
-     * as well.  The exact format of the string is unspecified.
+     * as well.  The exact format of the string is unspecified and the string
+     * may be {@code null}.
      *
      * @return the type of data found in the incorrectly typed element
      */
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Jul 07 18:35:29 2016 +0000
@@ -751,11 +751,25 @@
         classFileEpilogue();
         bogusMethod(lambdaForm);
 
-        final byte[] classFile = cw.toByteArray();
+        final byte[] classFile;
+        try {
+            classFile = cw.toByteArray();
+        } catch (RuntimeException e) {
+            // ASM throws RuntimeException if something goes wrong - capture these and wrap them in a meaningful
+            // exception to support falling back to LambdaForm interpretation
+            throw new BytecodeGenerationException(e);
+        }
         maybeDump(className, classFile);
         return classFile;
     }
 
+    @SuppressWarnings("serial")
+    static final class BytecodeGenerationException extends RuntimeException {
+        BytecodeGenerationException(Exception cause) {
+            super(cause);
+        }
+    }
+
     void emitArrayLoad(Name name)   { emitArrayOp(name, Opcodes.AALOAD);      }
     void emitArrayStore(Name name)  { emitArrayOp(name, Opcodes.AASTORE);     }
     void emitArrayLength(Name name) { emitArrayOp(name, Opcodes.ARRAYLENGTH); }
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Thu Jul 07 18:35:29 2016 +0000
@@ -25,6 +25,7 @@
 
 package java.lang.invoke;
 
+import jdk.internal.perf.PerfCounter;
 import jdk.internal.vm.annotation.DontInline;
 import jdk.internal.vm.annotation.Stable;
 import sun.invoke.util.Wrapper;
@@ -39,8 +40,7 @@
 
 import static java.lang.invoke.LambdaForm.BasicType.*;
 import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic;
-import static java.lang.invoke.MethodHandleStatics.debugEnabled;
-import static java.lang.invoke.MethodHandleStatics.newInternalError;
+import static java.lang.invoke.MethodHandleStatics.*;
 
 /**
  * The symbolic, non-executable form of a method handle's invocation semantics.
@@ -396,7 +396,7 @@
     /** Customize LambdaForm for a particular MethodHandle */
     LambdaForm customize(MethodHandle mh) {
         LambdaForm customForm = new LambdaForm(debugName, arity, names, result, forceInline, mh);
-        if (COMPILE_THRESHOLD > 0 && isCompiled) {
+        if (COMPILE_THRESHOLD >= 0 && isCompiled) {
             // If shared LambdaForm has been compiled, compile customized version as well.
             customForm.compileToBytecode();
         }
@@ -411,7 +411,7 @@
         }
         assert(transformCache != null); // Customized LambdaForm should always has a link to uncustomized version.
         LambdaForm uncustomizedForm = (LambdaForm)transformCache;
-        if (COMPILE_THRESHOLD > 0 && isCompiled) {
+        if (COMPILE_THRESHOLD >= 0 && isCompiled) {
             // If customized LambdaForm has been compiled, compile uncustomized version as well.
             uncustomizedForm.compileToBytecode();
         }
@@ -717,7 +717,7 @@
      * as a sort of pre-invocation linkage step.)
      */
     public void prepare() {
-        if (COMPILE_THRESHOLD == 0 && !isCompiled) {
+        if (COMPILE_THRESHOLD == 0 && !forceInterpretation() && !isCompiled) {
             compileToBytecode();
         }
         if (this.vmentry != null) {
@@ -736,10 +736,22 @@
         // TO DO: Maybe add invokeGeneric, invokeWithArguments
     }
 
+    private static @Stable PerfCounter LF_FAILED;
+
+    private static PerfCounter failedCompilationCounter() {
+        if (LF_FAILED == null) {
+            LF_FAILED = PerfCounter.newPerfCounter("java.lang.invoke.failedLambdaFormCompilations");
+        }
+        return LF_FAILED;
+    }
+
     /** Generate optimizable bytecode for this form. */
-    MemberName compileToBytecode() {
+    void compileToBytecode() {
+        if (forceInterpretation()) {
+            return; // this should not be compiled
+        }
         if (vmentry != null && isCompiled) {
-            return vmentry;  // already compiled somehow
+            return;  // already compiled somehow
         }
         MethodType invokerType = methodType();
         assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
@@ -748,9 +760,16 @@
             if (TRACE_INTERPRETER)
                 traceInterpreter("compileToBytecode", this);
             isCompiled = true;
-            return vmentry;
-        } catch (Error | Exception ex) {
-            throw newInternalError(this.toString(), ex);
+        } catch (InvokerBytecodeGenerator.BytecodeGenerationException bge) {
+            // bytecode generation failed - mark this LambdaForm as to be run in interpretation mode only
+            invocationCounter = -1;
+            failedCompilationCounter().increment();
+            if (LOG_LF_COMPILATION_FAILURE) {
+                System.out.println("LambdaForm compilation failed: " + this);
+                bge.printStackTrace(System.out);
+            }
+        } catch (Error | Exception e) {
+            throw newInternalError(this.toString(), e);
         }
     }
 
@@ -856,7 +875,11 @@
     static {
         COMPILE_THRESHOLD = Math.max(-1, MethodHandleStatics.COMPILE_THRESHOLD);
     }
-    private int invocationCounter = 0;
+    private int invocationCounter = 0; // a value of -1 indicates LambdaForm interpretation mode forever
+
+    private boolean forceInterpretation() {
+        return invocationCounter == -1;
+    }
 
     @Hidden
     @DontInline
@@ -896,7 +919,7 @@
 
     private void checkInvocationCounter() {
         if (COMPILE_THRESHOLD != 0 &&
-            invocationCounter < COMPILE_THRESHOLD) {
+            !forceInterpretation() && invocationCounter < COMPILE_THRESHOLD) {
             invocationCounter++;  // benign race
             if (invocationCounter >= COMPILE_THRESHOLD) {
                 // Replace vmentry with a bytecode version of this LF.
@@ -906,7 +929,7 @@
     }
     Object interpretWithArgumentsTracing(Object... argumentValues) throws Throwable {
         traceInterpreter("[ interpretWithArguments", this, argumentValues);
-        if (invocationCounter < COMPILE_THRESHOLD) {
+        if (!forceInterpretation() && invocationCounter < COMPILE_THRESHOLD) {
             int ctr = invocationCounter++;  // benign race
             traceInterpreter("| invocationCounter", ctr);
             if (invocationCounter >= COMPILE_THRESHOLD) {
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,11 @@
 
 package java.lang.invoke;
 
-import java.util.Properties;
 import jdk.internal.misc.Unsafe;
 import sun.security.action.GetPropertyAction;
 
+import java.util.Properties;
+
 /**
  * This class consists exclusively of static names internal to the
  * method handle implementation.
@@ -46,6 +47,7 @@
     static final boolean TRACE_INTERPRETER;
     static final boolean TRACE_METHOD_LINKAGE;
     static final int COMPILE_THRESHOLD;
+    static final boolean LOG_LF_COMPILATION_FAILURE;
     static final int DONT_INLINE_THRESHOLD;
     static final int PROFILE_LEVEL;
     static final boolean PROFILE_GWT;
@@ -64,6 +66,8 @@
                 props.getProperty("java.lang.invoke.MethodHandle.TRACE_METHOD_LINKAGE"));
         COMPILE_THRESHOLD = Integer.parseInt(
                 props.getProperty("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", "0"));
+        LOG_LF_COMPILATION_FAILURE = Boolean.parseBoolean(
+                props.getProperty("java.lang.invoke.MethodHandle.LOG_LF_COMPILATION_FAILURE", "false"));
         DONT_INLINE_THRESHOLD = Integer.parseInt(
                 props.getProperty("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", "30"));
         PROFILE_LEVEL = Integer.parseInt(
@@ -87,7 +91,8 @@
         return (DEBUG_METHOD_HANDLE_NAMES |
                 DUMP_CLASS_FILES |
                 TRACE_INTERPRETER |
-                TRACE_METHOD_LINKAGE);
+                TRACE_METHOD_LINKAGE |
+                LOG_LF_COMPILATION_FAILURE);
     }
 
     // handy shared exception makers (they simplify the common case code)
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1208,22 +1208,43 @@
          * <ul>
          * <li>if the field is declared {@code final}, then the write, atomic
          *     update, and numeric atomic update access modes are unsupported.
-         * <li>if the field type is anything other than {@code int},
-         *     {@code long} or a reference type, then atomic update access modes
-         *     are unsupported.  (Future major platform releases of the JDK may
-         *     support additional types for certain currently unsupported access
-         *     modes.)
-         * <li>if the field type is anything other than {@code int} or
-         *     {@code long}, then numeric atomic update access modes are
-         *     unsupported.  (Future major platform releases of the JDK may
-         *     support additional numeric types for certain currently
-         *     unsupported access modes.)
+         * <li>if the field type is anything other than {@code byte},
+         *     {@code short}, {@code char}, {@code int} or {@code long},
+         *     {@code float}, or {@code double} then numeric atomic update
+         *     access modes are unsupported.
          * </ul>
          * <p>
          * If the field is declared {@code volatile} then the returned VarHandle
          * will override access to the field (effectively ignore the
          * {@code volatile} declaration) in accordance to it's specified
          * access modes.
+         * <p>
+         * If the field type is {@code float} or {@code double} then numeric
+         * and atomic update access modes compare values using their bitwise
+         * representation (see {@link Float#floatToRawIntBits} and
+         * {@link Double#doubleToRawLongBits}, respectively).
+         * @apiNote
+         * Bitwise comparison of {@code float} values or {@code double} values,
+         * as performed by the numeric and atomic update access modes, differ
+         * from the primitive {@code ==} operator and the {@link Float#equals}
+         * and {@link Double#equals} methods, specifically with respect to
+         * comparing NaN values or comparing {@code -0.0} with {@code +0.0}.
+         * Care should be taken when performing a compare and set or a compare
+         * and exchange operation with such values since the operation may
+         * unexpectedly fail.
+         * There are many possible NaN values that are considered to be
+         * {@code NaN} in Java, although no IEEE 754 floating-point operation
+         * provided by Java can distinguish between them.  Operation failure can
+         * occur if the expected or witness value is a NaN value and it is
+         * transformed (perhaps in a platform specific manner) into another NaN
+         * value, and thus has a different bitwise representation (see
+         * {@link Float#intBitsToFloat} or {@link Double#longBitsToDouble} for more
+         * details).
+         * The values {@code -0.0} and {@code +0.0} have different bitwise
+         * representations but are considered equal when using the primitive
+         * {@code ==} operator.  Operation failure can occur if, for example, a
+         * numeric algorithm computes an expected value to be say {@code -0.0}
+         * and previously computed the witness value to be say {@code +0.0}.
          * @param recv the receiver class, of type {@code R}, that declares the
          * non-static field
          * @param name the field's name
@@ -1306,22 +1327,43 @@
          * <ul>
          * <li>if the field is declared {@code final}, then the write, atomic
          *     update, and numeric atomic update access modes are unsupported.
-         * <li>if the field type is anything other than {@code int},
-         *     {@code long} or a reference type, then atomic update access modes
-         *     are unsupported.  (Future major platform releases of the JDK may
-         *     support additional types for certain currently unsupported access
-         *     modes.)
-         * <li>if the field type is anything other than {@code int} or
-         *     {@code long}, then numeric atomic update access modes are
-         *     unsupported.  (Future major platform releases of the JDK may
-         *     support additional numeric types for certain currently
-         *     unsupported access modes.)
+         * <li>if the field type is anything other than {@code byte},
+         *     {@code short}, {@code char}, {@code int} or {@code long},
+         *     {@code float}, or {@code double}, then numeric atomic update
+         *     access modes are unsupported.
          * </ul>
          * <p>
          * If the field is declared {@code volatile} then the returned VarHandle
          * will override access to the field (effectively ignore the
          * {@code volatile} declaration) in accordance to it's specified
          * access modes.
+         * <p>
+         * If the field type is {@code float} or {@code double} then numeric
+         * and atomic update access modes compare values using their bitwise
+         * representation (see {@link Float#floatToRawIntBits} and
+         * {@link Double#doubleToRawLongBits}, respectively).
+         * @apiNote
+         * Bitwise comparison of {@code float} values or {@code double} values,
+         * as performed by the numeric and atomic update access modes, differ
+         * from the primitive {@code ==} operator and the {@link Float#equals}
+         * and {@link Double#equals} methods, specifically with respect to
+         * comparing NaN values or comparing {@code -0.0} with {@code +0.0}.
+         * Care should be taken when performing a compare and set or a compare
+         * and exchange operation with such values since the operation may
+         * unexpectedly fail.
+         * There are many possible NaN values that are considered to be
+         * {@code NaN} in Java, although no IEEE 754 floating-point operation
+         * provided by Java can distinguish between them.  Operation failure can
+         * occur if the expected or witness value is a NaN value and it is
+         * transformed (perhaps in a platform specific manner) into another NaN
+         * value, and thus has a different bitwise representation (see
+         * {@link Float#intBitsToFloat} or {@link Double#longBitsToDouble} for more
+         * details).
+         * The values {@code -0.0} and {@code +0.0} have different bitwise
+         * representations but are considered equal when using the primitive
+         * {@code ==} operator.  Operation failure can occur if, for example, a
+         * numeric algorithm computes an expected value to be say {@code -0.0}
+         * and previously computed the witness value to be say {@code +0.0}.
          * @param decl the class that declares the static field
          * @param name the field's name
          * @param type the field's type, of type {@code T}
@@ -1590,22 +1632,43 @@
          * <ul>
          * <li>if the field is declared {@code final}, then the write, atomic
          *     update, and numeric atomic update access modes are unsupported.
-         * <li>if the field type is anything other than {@code int},
-         *     {@code long} or a reference type, then atomic update access modes
-         *     are unsupported.  (Future major platform releases of the JDK may
-         *     support additional types for certain currently unsupported access
-         *     modes.)
-         * <li>if the field type is anything other than {@code int} or
-         *     {@code long}, then numeric atomic update access modes are
-         *     unsupported.  (Future major platform releases of the JDK may
-         *     support additional numeric types for certain currently
-         *     unsupported access modes.)
+         * <li>if the field type is anything other than {@code byte},
+         *     {@code short}, {@code char}, {@code int} or {@code long},
+         *     {@code float}, or {@code double} then numeric atomic update
+         *     access modes are unsupported.
          * </ul>
          * <p>
          * If the field is declared {@code volatile} then the returned VarHandle
          * will override access to the field (effectively ignore the
          * {@code volatile} declaration) in accordance to it's specified
          * access modes.
+         * <p>
+         * If the field type is {@code float} or {@code double} then numeric
+         * and atomic update access modes compare values using their bitwise
+         * representation (see {@link Float#floatToRawIntBits} and
+         * {@link Double#doubleToRawLongBits}, respectively).
+         * @apiNote
+         * Bitwise comparison of {@code float} values or {@code double} values,
+         * as performed by the numeric and atomic update access modes, differ
+         * from the primitive {@code ==} operator and the {@link Float#equals}
+         * and {@link Double#equals} methods, specifically with respect to
+         * comparing NaN values or comparing {@code -0.0} with {@code +0.0}.
+         * Care should be taken when performing a compare and set or a compare
+         * and exchange operation with such values since the operation may
+         * unexpectedly fail.
+         * There are many possible NaN values that are considered to be
+         * {@code NaN} in Java, although no IEEE 754 floating-point operation
+         * provided by Java can distinguish between them.  Operation failure can
+         * occur if the expected or witness value is a NaN value and it is
+         * transformed (perhaps in a platform specific manner) into another NaN
+         * value, and thus has a different bitwise representation (see
+         * {@link Float#intBitsToFloat} or {@link Double#longBitsToDouble} for more
+         * details).
+         * The values {@code -0.0} and {@code +0.0} have different bitwise
+         * representations but are considered equal when using the primitive
+         * {@code ==} operator.  Operation failure can occur if, for example, a
+         * numeric algorithm computes an expected value to be say {@code -0.0}
+         * and previously computed the witness value to be say {@code +0.0}.
          * @param f the reflected field, with a field of type {@code T}, and
          * a declaring class of type {@code R}
          * @return a VarHandle giving access to non-static fields or a static
@@ -2289,17 +2352,38 @@
      * Certain access modes of the returned VarHandle are unsupported under
      * the following conditions:
      * <ul>
-     * <li>if the component type is anything other than {@code int},
-     *     {@code long} or a reference type, then atomic update access modes
-     *     are unsupported.  (Future major platform releases of the JDK may
-     *     support additional types for certain currently unsupported access
-     *     modes.)
-     * <li>if the component type is anything other than {@code int} or
-     *     {@code long}, then numeric atomic update access modes are
-     *     unsupported.  (Future major platform releases of the JDK may
-     *     support additional numeric types for certain currently
-     *     unsupported access modes.)
+     * <li>if the component type is anything other than {@code byte},
+     *     {@code short}, {@code char}, {@code int} or {@code long},
+     *     {@code float}, or {@code double} then numeric atomic update access
+     *     modes are unsupported.
      * </ul>
+     * <p>
+     * If the component type is {@code float} or {@code double} then numeric
+     * and atomic update access modes compare values using their bitwise
+     * representation (see {@link Float#floatToRawIntBits} and
+     * {@link Double#doubleToRawLongBits}, respectively).
+     * @apiNote
+     * Bitwise comparison of {@code float} values or {@code double} values,
+     * as performed by the numeric and atomic update access modes, differ
+     * from the primitive {@code ==} operator and the {@link Float#equals}
+     * and {@link Double#equals} methods, specifically with respect to
+     * comparing NaN values or comparing {@code -0.0} with {@code +0.0}.
+     * Care should be taken when performing a compare and set or a compare
+     * and exchange operation with such values since the operation may
+     * unexpectedly fail.
+     * There are many possible NaN values that are considered to be
+     * {@code NaN} in Java, although no IEEE 754 floating-point operation
+     * provided by Java can distinguish between them.  Operation failure can
+     * occur if the expected or witness value is a NaN value and it is
+     * transformed (perhaps in a platform specific manner) into another NaN
+     * value, and thus has a different bitwise representation (see
+     * {@link Float#intBitsToFloat} or {@link Double#longBitsToDouble} for more
+     * details).
+     * The values {@code -0.0} and {@code +0.0} have different bitwise
+     * representations but are considered equal when using the primitive
+     * {@code ==} operator.  Operation failure can occur if, for example, a
+     * numeric algorithm computes an expected value to be say {@code -0.0}
+     * and previously computed the witness value to be say {@code +0.0}.
      * @param arrayClass the class of an array, of type {@code T[]}
      * @return a VarHandle giving access to elements of an array
      * @throws NullPointerException if the arrayClass is null
@@ -2363,16 +2447,11 @@
      * int misalignedAtIndex = (misalignedAtZeroIndex + index) % sizeOfT;
      * boolean isMisaligned = misalignedAtIndex != 0;
      * }</pre>
-     *
-     * @implNote
-     * The variable types {@code float} and {@code double} are supported as if
-     * by transformation to and access with the variable types {@code int} and
-     * {@code long} respectively.  For example, the transformation of a
-     * {@code double} value to a long value is performed as if using
-     * {@link Double#doubleToRawLongBits(double)}, and the reverse
-     * transformation is performed as if using
-     * {@link Double#longBitsToDouble(long)}.
-     *
+     * <p>
+     * If the variable type is {@code float} or {@code double} then atomic
+     * update access modes compare values using their bitwise representation
+     * (see {@link Float#floatToRawIntBits} and
+     * {@link Double#doubleToRawLongBits}, respectively).
      * @param viewArrayClass the view array class, with a component type of
      * type {@code T}
      * @param byteOrder the endianness of the view array elements, as
@@ -2449,16 +2528,11 @@
      * int misalignedAtIndex = bb.alignmentOffset(index, sizeOfT);
      * boolean isMisaligned = misalignedAtIndex != 0;
      * }</pre>
-     *
-     * @implNote
-     * The variable types {@code float} and {@code double} are supported as if
-     * by transformation to and access with the variable types {@code int} and
-     * {@code long} respectively.  For example, the transformation of a
-     * {@code double} value to a long value is performed as if using
-     * {@link Double#doubleToRawLongBits(double)}, and the reverse
-     * transformation is performed as if using
-     * {@link Double#longBitsToDouble(long)}.
-     *
+     * <p>
+     * If the variable type is {@code float} or {@code double} then atomic
+     * update access modes compare values using their bitwise representation
+     * (see {@link Float#floatToRawIntBits} and
+     * {@link Double#doubleToRawLongBits}, respectively).
      * @param viewArrayClass the view array class, with a component type of
      * type {@code T}
      * @param byteOrder the endianness of the view array elements, as
@@ -3353,7 +3427,8 @@
      * @return a possibly adapted method handle
      * @throws NullPointerException if either argument is null
      * @throws IllegalArgumentException if any element of {@code newTypes} is {@code void.class},
-     *         or if either index is out of range in its corresponding list,
+     *         or if {@code skip} is negative or greater than the arity of the target,
+     *         or if {@code pos} is negative or greater than the newTypes list size,
      *         or if the non-skipped target parameter types match the new types at {@code pos}
      * @since 9
      */
--- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Thu Jul 07 18:35:29 2016 +0000
@@ -139,7 +139,7 @@
  * {@link #weakCompareAndSetAcquire weakCompareAndSetAcquire},
  * {@link #weakCompareAndSetRelease weakCompareAndSetRelease},
  * {@link #compareAndExchangeAcquire compareAndExchangeAcquire},
- * {@link #compareAndExchangeVolatile compareAndExchangeVolatile},
+ * {@link #compareAndExchange compareAndExchange},
  * {@link #compareAndExchangeRelease compareAndExchangeRelease},
  * {@link #getAndSet getAndSet}.
  * <li>numeric atomic update access modes that, for example, atomically get and
@@ -706,9 +706,9 @@
      * <p>The method signature is of the form {@code (CT, T expectedValue, T newValue)T}.
      *
      * <p>The symbolic type descriptor at the call site of {@code
-     * compareAndExchangeVolatile}
+     * compareAndExchange}
      * must match the access mode type that is the result of calling
-     * {@code accessModeType(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE)}
+     * {@code accessModeType(VarHandle.AccessMode.COMPARE_AND_EXCHANGE)}
      * on this VarHandle.
      *
      * @param args the signature-polymorphic parameter list of the form
@@ -729,7 +729,7 @@
     public final native
     @MethodHandle.PolymorphicSignature
     @HotSpotIntrinsicCandidate
-    Object compareAndExchangeVolatile(Object... args);
+    Object compareAndExchange(Object... args);
 
     /**
      * Atomically sets the value of a variable to the {@code newValue} with the
@@ -1199,9 +1199,9 @@
         /**
          * The access mode whose access is specified by the corresponding
          * method
-         * {@link VarHandle#compareAndExchangeVolatile VarHandle.compareAndExchangeVolatile}
+         * {@link VarHandle#compareAndExchange VarHandle.compareAndExchange}
          */
-        COMPARE_AND_EXCHANGE_VOLATILE("compareAndExchangeVolatile", AccessType.COMPARE_AND_EXCHANGE),
+        COMPARE_AND_EXCHANGE("compareAndExchange", AccessType.COMPARE_AND_EXCHANGE),
         /**
          * The access mode whose access is specified by the corresponding
          * method
--- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template	Thu Jul 07 18:35:29 2016 +0000
@@ -132,7 +132,7 @@
         }
 
         @ForceInline
-        static $type$ compareAndExchangeVolatile(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) {
+        static $type$ compareAndExchange(FieldInstanceReadWrite handle, Object holder, $type$ expected, $type$ value) {
             return UNSAFE.compareAndExchange$Type$Volatile(Objects.requireNonNull(handle.receiverType.cast(holder)),
                                                handle.fieldOffset,
                                                {#if[Object]?handle.fieldType.cast(expected):expected},
@@ -205,9 +205,9 @@
 
         @ForceInline
         static $type$ addAndGet(FieldInstanceReadWrite handle, Object holder, $type$ value) {
-            return UNSAFE.getAndAdd$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)),
+            return {#if[ShorterThanInt]?($type$)}(UNSAFE.getAndAdd$Type$(Objects.requireNonNull(handle.receiverType.cast(holder)),
                                        handle.fieldOffset,
-                                       value) + value;
+                                       value) + value);
         }
 #end[AtomicAdd]
 
@@ -313,7 +313,7 @@
 
 
         @ForceInline
-        static $type$ compareAndExchangeVolatile(FieldStaticReadWrite handle, $type$ expected, $type$ value) {
+        static $type$ compareAndExchange(FieldStaticReadWrite handle, $type$ expected, $type$ value) {
             return UNSAFE.compareAndExchange$Type$Volatile(handle.base,
                                                handle.fieldOffset,
                                                {#if[Object]?handle.fieldType.cast(expected):expected},
@@ -386,9 +386,9 @@
 
         @ForceInline
         static $type$ addAndGet(FieldStaticReadWrite handle, $type$ value) {
-            return UNSAFE.getAndAdd$Type$(handle.base,
+            return {#if[ShorterThanInt]?($type$)}(UNSAFE.getAndAdd$Type$(handle.base,
                                        handle.fieldOffset,
-                                       value) + value;
+                                       value) + value);
         }
 #end[AtomicAdd]
 
@@ -523,7 +523,7 @@
         }
 
         @ForceInline
-        static $type$ compareAndExchangeVolatile(Array handle, Object oarray, int index, $type$ expected, $type$ value) {
+        static $type$ compareAndExchange(Array handle, Object oarray, int index, $type$ expected, $type$ value) {
 #if[Object]
             Object[] array = (Object[]) handle.arrayType.cast(oarray);
 #else[Object]
@@ -646,9 +646,9 @@
 #else[Object]
             $type$[] array = ($type$[]) oarray;
 #end[Object]
-            return UNSAFE.getAndAdd$Type$(array,
+            return {#if[ShorterThanInt]?($type$)}(UNSAFE.getAndAdd$Type$(array,
                     (((long) Preconditions.checkIndex(index, array.length, AIOOBE_SUPPLIER)) << handle.ashift) + handle.abase,
-                    value) + value;
+                    value) + value);
         }
 #end[AtomicAdd]
 
--- a/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template	Thu Jul 07 18:35:29 2016 +0000
@@ -193,7 +193,7 @@
         }
 
         @ForceInline
-        static $type$ compareAndExchangeVolatile(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
+        static $type$ compareAndExchange(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
             byte[] ba = (byte[]) oba;
             return convEndian(handle.be,
                               UNSAFE.compareAndExchange$RawType$Volatile(
@@ -436,7 +436,7 @@
         }
 
         @ForceInline
-        static $type$ compareAndExchangeVolatile(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
+        static $type$ compareAndExchange(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
             ByteBuffer bb = (ByteBuffer) obb;
             return convEndian(handle.be,
                               UNSAFE.compareAndExchange$RawType$Volatile(
--- a/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/text/DateFormatSymbols.java	Thu Jul 07 18:35:29 2016 +0000
@@ -418,7 +418,7 @@
      * Gets short month strings. For example: "Jan", "Feb", etc.
      *
      * <p>If the language requires different forms for formatting and
-     * stand-alone usages, This method returns short month names in
+     * stand-alone usages, this method returns short month names in
      * the formatting form. For example, the preferred abbreviation
      * for January in the Catalan language is <em>de gen.</em> in the
      * formatting form, while it is <em>gen.</em> in the stand-alone
--- a/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/text/SimpleDateFormat.java	Thu Jul 07 18:35:29 2016 +0000
@@ -276,9 +276,16 @@
  *     it is interpreted as a <a href="#number">number</a>.<br>
  *     <ul>
  *     <li>Letter <em>M</em> produces context-sensitive month names, such as the
- *         embedded form of names. If a {@code DateFormatSymbols} has been set
- *         explicitly with constructor {@link #SimpleDateFormat(String,
- *         DateFormatSymbols)} or method {@link
+ *         embedded form of names. Letter <em>M</em> is context-sensitive in the
+ *         sense that when it is used in the standalone pattern, for example,
+ *         "MMMM", it gives the standalone form of a month name and when it is
+ *         used in the pattern containing other field(s), for example, "d MMMM",
+ *         it gives the format form of a month name. For example, January in the
+ *         Catalan language is "de gener" in the format form while it is "gener"
+ *         in the standalone form. In this case, "MMMM" will produce "gener" and
+ *         the month part of the "d MMMM" will produce "de gener". If a
+ *         {@code DateFormatSymbols} has been set explicitly with constructor
+ *         {@link #SimpleDateFormat(String,DateFormatSymbols)} or method {@link
  *         #setDateFormatSymbols(DateFormatSymbols)}, the month names given by
  *         the {@code DateFormatSymbols} are used.</li>
  *     <li>Letter <em>L</em> produces the standalone form of month names.</li>
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu Jul 07 18:35:29 2016 +0000
@@ -25,15 +25,13 @@
 
 package jdk.internal.misc;
 
-import java.lang.reflect.Field;
-import java.security.ProtectionDomain;
-
+import jdk.internal.HotSpotIntrinsicCandidate;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
-import jdk.internal.misc.VM;
+import jdk.internal.vm.annotation.ForceInline;
 
-import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.vm.annotation.ForceInline;
+import java.lang.reflect.Field;
+import java.security.ProtectionDomain;
 
 
 /**
@@ -1400,6 +1398,453 @@
         return compareAndSwapInt(o, offset, expected, x);
     }
 
+    @HotSpotIntrinsicCandidate
+    public final byte compareAndExchangeByteVolatile(Object o, long offset,
+                                                     byte expected,
+                                                     byte x) {
+        long wordOffset = offset & ~3;
+        int shift = (int) (offset & 3) << 3;
+        if (BE) {
+            shift = 24 - shift;
+        }
+        int mask           = 0xFF << shift;
+        int maskedExpected = (expected & 0xFF) << shift;
+        int maskedX        = (x & 0xFF) << shift;
+        int fullWord;
+        do {
+            fullWord = getIntVolatile(o, wordOffset);
+            if ((fullWord & mask) != maskedExpected)
+                return (byte) ((fullWord & mask) >> shift);
+        } while (!weakCompareAndSwapIntVolatile(o, wordOffset,
+                                                fullWord, (fullWord & ~mask) | maskedX));
+        return expected;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean compareAndSwapByte(Object o, long offset,
+                                            byte expected,
+                                            byte x) {
+        return compareAndExchangeByteVolatile(o, offset, expected, x) == expected;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapByteVolatile(Object o, long offset,
+                                                        byte expected,
+                                                        byte x) {
+        return compareAndSwapByte(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapByteAcquire(Object o, long offset,
+                                                       byte expected,
+                                                       byte x) {
+        return weakCompareAndSwapByteVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapByteRelease(Object o, long offset,
+                                                       byte expected,
+                                                       byte x) {
+        return weakCompareAndSwapByteVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapByte(Object o, long offset,
+                                                        byte expected,
+                                                        byte x) {
+        return weakCompareAndSwapByteVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final byte compareAndExchangeByteAcquire(Object o, long offset,
+                                                    byte expected,
+                                                    byte x) {
+        return compareAndExchangeByteVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final byte compareAndExchangeByteRelease(Object o, long offset,
+                                                    byte expected,
+                                                    byte x) {
+        return compareAndExchangeByteVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final short compareAndExchangeShortVolatile(Object o, long offset,
+                                             short expected,
+                                             short x) {
+        if ((offset & 3) == 3) {
+            throw new IllegalArgumentException("Update spans the word, not supported");
+        }
+        long wordOffset = offset & ~3;
+        int shift = (int) (offset & 3) << 3;
+        if (BE) {
+            shift = 16 - shift;
+        }
+        int mask           = 0xFFFF << shift;
+        int maskedExpected = (expected & 0xFFFF) << shift;
+        int maskedX        = (x & 0xFFFF) << shift;
+        int fullWord;
+        do {
+            fullWord = getIntVolatile(o, wordOffset);
+            if ((fullWord & mask) != maskedExpected) {
+                return (short) ((fullWord & mask) >> shift);
+            }
+        } while (!weakCompareAndSwapIntVolatile(o, wordOffset,
+                                                fullWord, (fullWord & ~mask) | maskedX));
+        return expected;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean compareAndSwapShort(Object o, long offset,
+                                             short expected,
+                                             short x) {
+        return compareAndExchangeShortVolatile(o, offset, expected, x) == expected;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapShortVolatile(Object o, long offset,
+                                                         short expected,
+                                                         short x) {
+        return compareAndSwapShort(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapShortAcquire(Object o, long offset,
+                                                        short expected,
+                                                        short x) {
+        return weakCompareAndSwapShortVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapShortRelease(Object o, long offset,
+                                                        short expected,
+                                                        short x) {
+        return weakCompareAndSwapShortVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSwapShort(Object o, long offset,
+                                                 short expected,
+                                                 short x) {
+        return weakCompareAndSwapShortVolatile(o, offset, expected, x);
+    }
+
+
+    @HotSpotIntrinsicCandidate
+    public final short compareAndExchangeShortAcquire(Object o, long offset,
+                                                     short expected,
+                                                     short x) {
+        return compareAndExchangeShortVolatile(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final short compareAndExchangeShortRelease(Object o, long offset,
+                                                    short expected,
+                                                    short x) {
+        return compareAndExchangeShortVolatile(o, offset, expected, x);
+    }
+
+    @ForceInline
+    private char s2c(short s) {
+        return (char) s;
+    }
+
+    @ForceInline
+    private short c2s(char s) {
+        return (short) s;
+    }
+
+    @ForceInline
+    public final boolean compareAndSwapChar(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return compareAndSwapShort(o, offset, c2s(expected), c2s(x));
+    }
+
+    @ForceInline
+    public final char compareAndExchangeCharVolatile(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return s2c(compareAndExchangeShortVolatile(o, offset, c2s(expected), c2s(x)));
+    }
+
+    @ForceInline
+    public final char compareAndExchangeCharAcquire(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return s2c(compareAndExchangeShortAcquire(o, offset, c2s(expected), c2s(x)));
+    }
+
+    @ForceInline
+    public final char compareAndExchangeCharRelease(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return s2c(compareAndExchangeShortRelease(o, offset, c2s(expected), c2s(x)));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapCharVolatile(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return weakCompareAndSwapShortVolatile(o, offset, c2s(expected), c2s(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapCharAcquire(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return weakCompareAndSwapShortAcquire(o, offset, c2s(expected), c2s(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapCharRelease(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return weakCompareAndSwapShortRelease(o, offset, c2s(expected), c2s(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapChar(Object o, long offset,
+                                            char expected,
+                                            char x) {
+        return weakCompareAndSwapShort(o, offset, c2s(expected), c2s(x));
+    }
+
+    @ForceInline
+    private boolean byte2bool(byte b) {
+        return b > 0;
+    }
+
+    @ForceInline
+    private byte bool2byte(boolean b) {
+        return b ? (byte)1 : (byte)0;
+    }
+
+    @ForceInline
+    public final boolean compareAndSwapBoolean(Object o, long offset,
+                                               boolean expected,
+                                               boolean x) {
+        return compareAndSwapByte(o, offset, bool2byte(expected), bool2byte(x));
+    }
+
+    @ForceInline
+    public final boolean compareAndExchangeBooleanVolatile(Object o, long offset,
+                                                        boolean expected,
+                                                        boolean x) {
+        return byte2bool(compareAndExchangeByteVolatile(o, offset, bool2byte(expected), bool2byte(x)));
+    }
+
+    @ForceInline
+    public final boolean compareAndExchangeBooleanAcquire(Object o, long offset,
+                                                    boolean expected,
+                                                    boolean x) {
+        return byte2bool(compareAndExchangeByteAcquire(o, offset, bool2byte(expected), bool2byte(x)));
+    }
+
+    @ForceInline
+    public final boolean compareAndExchangeBooleanRelease(Object o, long offset,
+                                                       boolean expected,
+                                                       boolean x) {
+        return byte2bool(compareAndExchangeByteRelease(o, offset, bool2byte(expected), bool2byte(x)));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapBooleanVolatile(Object o, long offset,
+                                                           boolean expected,
+                                                           boolean x) {
+        return weakCompareAndSwapByteVolatile(o, offset, bool2byte(expected), bool2byte(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapBooleanAcquire(Object o, long offset,
+                                                          boolean expected,
+                                                          boolean x) {
+        return weakCompareAndSwapByteAcquire(o, offset, bool2byte(expected), bool2byte(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapBooleanRelease(Object o, long offset,
+                                                          boolean expected,
+                                                          boolean x) {
+        return weakCompareAndSwapByteRelease(o, offset, bool2byte(expected), bool2byte(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapBoolean(Object o, long offset,
+                                                   boolean expected,
+                                                   boolean x) {
+        return weakCompareAndSwapByte(o, offset, bool2byte(expected), bool2byte(x));
+    }
+
+    /**
+     * Atomically updates Java variable to {@code x} if it is currently
+     * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
+     * @return {@code true} if successful
+     */
+    @ForceInline
+    public final boolean compareAndSwapFloat(Object o, long offset,
+                                             float expected,
+                                             float x) {
+        return compareAndSwapInt(o, offset,
+                                 Float.floatToRawIntBits(expected),
+                                 Float.floatToRawIntBits(x));
+    }
+
+    @ForceInline
+    public final float compareAndExchangeFloatVolatile(Object o, long offset,
+                                                       float expected,
+                                                       float x) {
+        int w = compareAndExchangeIntVolatile(o, offset,
+                                              Float.floatToRawIntBits(expected),
+                                              Float.floatToRawIntBits(x));
+        return Float.intBitsToFloat(w);
+    }
+
+    @ForceInline
+    public final float compareAndExchangeFloatAcquire(Object o, long offset,
+                                                  float expected,
+                                                  float x) {
+        int w = compareAndExchangeIntAcquire(o, offset,
+                                             Float.floatToRawIntBits(expected),
+                                             Float.floatToRawIntBits(x));
+        return Float.intBitsToFloat(w);
+    }
+
+    @ForceInline
+    public final float compareAndExchangeFloatRelease(Object o, long offset,
+                                                  float expected,
+                                                  float x) {
+        int w = compareAndExchangeIntRelease(o, offset,
+                                             Float.floatToRawIntBits(expected),
+                                             Float.floatToRawIntBits(x));
+        return Float.intBitsToFloat(w);
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapFloat(Object o, long offset,
+                                               float expected,
+                                               float x) {
+        return weakCompareAndSwapInt(o, offset,
+                                     Float.floatToRawIntBits(expected),
+                                     Float.floatToRawIntBits(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapFloatAcquire(Object o, long offset,
+                                                      float expected,
+                                                      float x) {
+        return weakCompareAndSwapIntAcquire(o, offset,
+                                            Float.floatToRawIntBits(expected),
+                                            Float.floatToRawIntBits(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapFloatRelease(Object o, long offset,
+                                                      float expected,
+                                                      float x) {
+        return weakCompareAndSwapIntRelease(o, offset,
+                                            Float.floatToRawIntBits(expected),
+                                            Float.floatToRawIntBits(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapFloatVolatile(Object o, long offset,
+                                                       float expected,
+                                                       float x) {
+        return weakCompareAndSwapIntVolatile(o, offset,
+                                             Float.floatToRawIntBits(expected),
+                                             Float.floatToRawIntBits(x));
+    }
+
+    /**
+     * Atomically updates Java variable to {@code x} if it is currently
+     * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
+     * @return {@code true} if successful
+     */
+    @ForceInline
+    public final boolean compareAndSwapDouble(Object o, long offset,
+                                              double expected,
+                                              double x) {
+        return compareAndSwapLong(o, offset,
+                                  Double.doubleToRawLongBits(expected),
+                                  Double.doubleToRawLongBits(x));
+    }
+
+    @ForceInline
+    public final double compareAndExchangeDoubleVolatile(Object o, long offset,
+                                                         double expected,
+                                                         double x) {
+        long w = compareAndExchangeLongVolatile(o, offset,
+                                                Double.doubleToRawLongBits(expected),
+                                                Double.doubleToRawLongBits(x));
+        return Double.longBitsToDouble(w);
+    }
+
+    @ForceInline
+    public final double compareAndExchangeDoubleAcquire(Object o, long offset,
+                                                        double expected,
+                                                        double x) {
+        long w = compareAndExchangeLongAcquire(o, offset,
+                                               Double.doubleToRawLongBits(expected),
+                                               Double.doubleToRawLongBits(x));
+        return Double.longBitsToDouble(w);
+    }
+
+    @ForceInline
+    public final double compareAndExchangeDoubleRelease(Object o, long offset,
+                                                        double expected,
+                                                        double x) {
+        long w = compareAndExchangeLongRelease(o, offset,
+                                               Double.doubleToRawLongBits(expected),
+                                               Double.doubleToRawLongBits(x));
+        return Double.longBitsToDouble(w);
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapDouble(Object o, long offset,
+                                                  double expected,
+                                                  double x) {
+        return weakCompareAndSwapLong(o, offset,
+                                     Double.doubleToRawLongBits(expected),
+                                     Double.doubleToRawLongBits(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapDoubleAcquire(Object o, long offset,
+                                                         double expected,
+                                                         double x) {
+        return weakCompareAndSwapLongAcquire(o, offset,
+                                             Double.doubleToRawLongBits(expected),
+                                             Double.doubleToRawLongBits(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapDoubleRelease(Object o, long offset,
+                                                         double expected,
+                                                         double x) {
+        return weakCompareAndSwapLongRelease(o, offset,
+                                             Double.doubleToRawLongBits(expected),
+                                             Double.doubleToRawLongBits(x));
+    }
+
+    @ForceInline
+    public final boolean weakCompareAndSwapDoubleVolatile(Object o, long offset,
+                                                          double expected,
+                                                          double x) {
+        return weakCompareAndSwapLongVolatile(o, offset,
+                                              Double.doubleToRawLongBits(expected),
+                                              Double.doubleToRawLongBits(x));
+    }
+
     /**
      * Atomically updates Java variable to {@code x} if it is currently
      * holding {@code expected}.
@@ -1840,7 +2285,7 @@
         int v;
         do {
             v = getIntVolatile(o, offset);
-        } while (!compareAndSwapInt(o, offset, v, v + delta));
+        } while (!weakCompareAndSwapIntVolatile(o, offset, v, v + delta));
         return v;
     }
 
@@ -1860,7 +2305,60 @@
         long v;
         do {
             v = getLongVolatile(o, offset);
-        } while (!compareAndSwapLong(o, offset, v, v + delta));
+        } while (!weakCompareAndSwapLongVolatile(o, offset, v, v + delta));
+        return v;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final byte getAndAddByte(Object o, long offset, byte delta) {
+        byte v;
+        do {
+            v = getByteVolatile(o, offset);
+        } while (!weakCompareAndSwapByteVolatile(o, offset, v, (byte) (v + delta)));
+        return v;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final short getAndAddShort(Object o, long offset, short delta) {
+        short v;
+        do {
+            v = getShortVolatile(o, offset);
+        } while (!weakCompareAndSwapShortVolatile(o, offset, v, (short) (v + delta)));
+        return v;
+    }
+
+    @ForceInline
+    public final char getAndAddChar(Object o, long offset, char delta) {
+        return (char) getAndAddShort(o, offset, (short) delta);
+    }
+
+    @ForceInline
+    public final float getAndAddFloat(Object o, long offset, float delta) {
+        int expectedBits;
+        float v;
+        do {
+            // Load and CAS with the raw bits to avoid issues with NaNs and
+            // possible bit conversion from signaling NaNs to quiet NaNs that
+            // may result in the loop not terminating.
+            expectedBits = getIntVolatile(o, offset);
+            v = Float.intBitsToFloat(expectedBits);
+        } while (!weakCompareAndSwapIntVolatile(o, offset,
+                                                expectedBits, Float.floatToRawIntBits(v + delta)));
+        return v;
+    }
+
+    @ForceInline
+    public final double getAndAddDouble(Object o, long offset, double delta) {
+        long expectedBits;
+        double v;
+        do {
+            // Load and CAS with the raw bits to avoid issues with NaNs and
+            // possible bit conversion from signaling NaNs to quiet NaNs that
+            // may result in the loop not terminating.
+            expectedBits = getLongVolatile(o, offset);
+            v = Double.longBitsToDouble(expectedBits);
+        } while (!weakCompareAndSwapLongVolatile(o, offset,
+                                                 expectedBits, Double.doubleToRawLongBits(v + delta)));
         return v;
     }
 
@@ -1880,7 +2378,7 @@
         int v;
         do {
             v = getIntVolatile(o, offset);
-        } while (!compareAndSwapInt(o, offset, v, newValue));
+        } while (!weakCompareAndSwapIntVolatile(o, offset, v, newValue));
         return v;
     }
 
@@ -1900,7 +2398,7 @@
         long v;
         do {
             v = getLongVolatile(o, offset);
-        } while (!compareAndSwapLong(o, offset, v, newValue));
+        } while (!weakCompareAndSwapLongVolatile(o, offset, v, newValue));
         return v;
     }
 
@@ -1920,10 +2418,49 @@
         Object v;
         do {
             v = getObjectVolatile(o, offset);
-        } while (!compareAndSwapObject(o, offset, v, newValue));
+        } while (!weakCompareAndSwapObjectVolatile(o, offset, v, newValue));
+        return v;
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final byte getAndSetByte(Object o, long offset, byte newValue) {
+        byte v;
+        do {
+            v = getByteVolatile(o, offset);
+        } while (!weakCompareAndSwapByteVolatile(o, offset, v, newValue));
         return v;
     }
 
+    @ForceInline
+    public final boolean getAndSetBoolean(Object o, long offset, boolean newValue) {
+        return byte2bool(getAndSetByte(o, offset, bool2byte(newValue)));
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final short getAndSetShort(Object o, long offset, short newValue) {
+        short v;
+        do {
+            v = getShortVolatile(o, offset);
+        } while (!weakCompareAndSwapShortVolatile(o, offset, v, newValue));
+        return v;
+    }
+
+    @ForceInline
+    public final char getAndSetChar(Object o, long offset, char newValue) {
+        return s2c(getAndSetShort(o, offset, c2s(newValue)));
+    }
+
+    @ForceInline
+    public final float getAndSetFloat(Object o, long offset, float newValue) {
+        int v = getAndSetInt(o, offset, Float.floatToRawIntBits(newValue));
+        return Float.intBitsToFloat(v);
+    }
+
+    @ForceInline
+    public final double getAndSetDouble(Object o, long offset, double newValue) {
+        long v = getAndSetLong(o, offset, Double.doubleToRawLongBits(newValue));
+        return Double.longBitsToDouble(v);
+    }
 
     /**
      * Ensures that loads before the fence will not be reordered with loads and
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/VM.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/VM.java	Thu Jul 07 18:35:29 2016 +0000
@@ -30,120 +30,6 @@
 
 public class VM {
 
-    /* The following methods used to be native methods that instruct
-     * the VM to selectively suspend certain threads in low-memory
-     * situations. They are inherently dangerous and not implementable
-     * on native threads. We removed them in JDK 1.2. The skeletons
-     * remain so that existing applications that use these methods
-     * will still work.
-     */
-    private static boolean suspended = false;
-
-    /** @deprecated */
-    @Deprecated
-    public static boolean threadsSuspended() {
-        return suspended;
-    }
-
-    @SuppressWarnings("deprecation")
-    public static boolean allowThreadSuspension(ThreadGroup g, boolean b) {
-        return g.allowThreadSuspension(b);
-    }
-
-    /** @deprecated */
-    @Deprecated
-    public static boolean suspendThreads() {
-        suspended = true;
-        return true;
-    }
-
-    // Causes any suspended threadgroups to be resumed.
-    /** @deprecated */
-    @Deprecated
-    public static void unsuspendThreads() {
-        suspended = false;
-    }
-
-    // Causes threadgroups no longer marked suspendable to be resumed.
-    /** @deprecated */
-    @Deprecated
-    public static void unsuspendSomeThreads() {
-    }
-
-    /* Deprecated fields and methods -- Memory advice not supported in 1.2 */
-
-    /** @deprecated */
-    @Deprecated
-    public static final int STATE_GREEN = 1;
-
-    /** @deprecated */
-    @Deprecated
-    public static final int STATE_YELLOW = 2;
-
-    /** @deprecated */
-    @Deprecated
-    public static final int STATE_RED = 3;
-
-    /** @deprecated */
-    @Deprecated
-    public static final int getState() {
-        return STATE_GREEN;
-    }
-
-    /** @deprecated */
-    @Deprecated
-    public static void registerVMNotification(VMNotification n) { }
-
-    /** @deprecated */
-    @Deprecated
-    public static void asChange(int as_old, int as_new) { }
-
-    /** @deprecated */
-    @Deprecated
-    public static void asChange_otherthread(int as_old, int as_new) { }
-
-    /*
-     * Not supported in 1.2 because these will have to be exported as
-     * JVM functions, and we are not sure we want do that. Leaving
-     * here so it can be easily resurrected -- just remove the //
-     * comments.
-     */
-
-    /**
-     * Resume Java profiling.  All profiling data is added to any
-     * earlier profiling, unless <code>resetJavaProfiler</code> is
-     * called in between.  If profiling was not started from the
-     * command line, <code>resumeJavaProfiler</code> will start it.
-     * <p>
-     *
-     * NOTE: Profiling must be enabled from the command line for a
-     * java.prof report to be automatically generated on exit; if not,
-     * writeJavaProfilerReport must be invoked to write a report.
-     *
-     * @see     resetJavaProfiler
-     * @see     writeJavaProfilerReport
-     */
-
-    // public native static void resumeJavaProfiler();
-
-    /**
-     * Suspend Java profiling.
-     */
-    // public native static void suspendJavaProfiler();
-
-    /**
-     * Initialize Java profiling.  Any accumulated profiling
-     * information is discarded.
-     */
-    // public native static void resetJavaProfiler();
-
-    /**
-     * Write the current profiling contents to the file "java.prof".
-     * If the file already exists, it will be overwritten.
-     */
-    // public native static void writeJavaProfilerReport();
-
-
     // the init level when the VM is fully initialized
     private static final int JAVA_LANG_SYSTEM_INITED     = 1;
     private static final int MODULE_SYSTEM_INITED        = 2;
--- a/jdk/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -351,11 +351,14 @@
             new LinkedHashMap<>();
         for (TypeAnnotation t : typeAnnos) {
             Annotation a = t.getAnnotation();
-            Class<? extends Annotation> klass = a.annotationType();
-            AnnotationType type = AnnotationType.getInstance(klass);
-            if (type.retention() == RetentionPolicy.RUNTIME)
-                if (result.put(klass, a) != null)
+            if (a != null) {
+                Class<? extends Annotation> klass = a.annotationType();
+                AnnotationType type = AnnotationType.getInstance(klass);
+                if (type.retention() == RetentionPolicy.RUNTIME &&
+                    result.put(klass, a) != null) {
                     throw new AnnotationFormatError("Duplicate annotation for class: "+klass+": " + a);
+                }
+            }
         }
         return result;
     }
--- a/jdk/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java	Thu Jul 07 18:35:29 2016 +0000
@@ -377,11 +377,12 @@
 
             instantiateIfNecessary(null);
 
-            // Step 7: Auto reseed
+            // Step 7: Auto reseed (reseedCounter might overflow)
             // Double checked locking, safe because reseedCounter is volatile
-            if (reseedCounter > reseedInterval || pr) {
+            if (reseedCounter < 0 || reseedCounter > reseedInterval || pr) {
                 synchronized (this) {
-                    if (reseedCounter > reseedInterval || pr) {
+                    if (reseedCounter < 0 || reseedCounter > reseedInterval
+                            || pr) {
                         reseedAlgorithm(getEntropyInput(pr), ai);
                         ai = null;
                     }
--- a/jdk/src/java.base/share/classes/sun/security/provider/AbstractHashDrbg.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/AbstractHashDrbg.java	Thu Jul 07 18:35:29 2016 +0000
@@ -27,7 +27,8 @@
 
 import sun.security.util.HexDumpEncoder;
 
-import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
 
 public abstract class AbstractHashDrbg extends AbstractDrbg {
@@ -113,16 +114,13 @@
         // 800-90Ar1 10.1.2.3: Hmac_DRBG Instantiate Process.
 
         // Step 1: entropy_input || nonce || personalization_string.
-        byte[] seed = Arrays.copyOf(entropy, entropy.length + nonce.length +
-                ((personalizationString == null) ? 0
-                        : personalizationString.length));
-        System.arraycopy(nonce, 0, seed, entropy.length, nonce.length);
+        List<byte[]> inputs = new ArrayList<>(3);
+        inputs.add(entropy);
+        inputs.add(nonce);
         if (personalizationString != null) {
-            System.arraycopy(personalizationString, 0,
-                    seed, entropy.length + nonce.length,
-                    personalizationString.length);
+            inputs.add(personalizationString);
         }
-        hashReseedInternal(seed);
+        hashReseedInternal(inputs);
     }
 
     @Override
@@ -140,13 +138,17 @@
         // 800-90Ar1 10.1.2.4: Hmac_DRBG Reseed Process.
 
         // Step 1: entropy_input || additional_input.
+        List<byte[]> inputs = new ArrayList<>(2);
+        inputs.add(ei);
         if (additionalInput != null) {
-            ei = Arrays.copyOf(ei, ei.length + additionalInput.length);
-            System.arraycopy(additionalInput, 0, ei,
-                    ei.length - additionalInput.length, additionalInput.length);
+            inputs.add(additionalInput);
         }
-        hashReseedInternal(ei);
+        hashReseedInternal(inputs);
     }
 
-    protected abstract void hashReseedInternal(byte[] seed);
+    /**
+     * Operates on multiple inputs.
+     * @param inputs not null, each element neither null
+     */
+    protected abstract void hashReseedInternal(List<byte[]> inputs);
 }
--- a/jdk/src/java.base/share/classes/sun/security/provider/CtrDrbg.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/CtrDrbg.java	Thu Jul 07 18:35:29 2016 +0000
@@ -242,6 +242,11 @@
             if (personalizationString == null) {
                 more = nonce;
             } else {
+                if (nonce.length + personalizationString.length < 0) {
+                    // Length must be represented as a 32 bit integer in df()
+                    throw new IllegalArgumentException(
+                            "nonce plus personalization string is too long");
+                }
                 more = Arrays.copyOf(
                         nonce, nonce.length + personalizationString.length);
                 System.arraycopy(personalizationString, 0, more, nonce.length,
@@ -256,50 +261,73 @@
         reseedAlgorithm(ei, more);
     }
 
+    /**
+     * Block_cipher_df in 10.3.2
+     *
+     * @param input the input string
+     * @return the output block (always of seedLen)
+     */
     private byte[] df(byte[] input) {
+        // 800-90Ar1 10.3.2
+        // 2. L = len (input_string)/8
         int l = input.length;
+        // 3. N = number_of_bits_to_return/8
         int n = seedLen;
-        int slen = 4 + 4 + l + 1;
-        byte[] s = new byte[(slen + blockLen - 1) / blockLen * blockLen];
-        s[0] = (byte)(l >> 24);
-        s[1] = (byte)(l >> 16);
-        s[2] = (byte)(l >> 8);
-        s[3] = (byte)(l);
-        s[4] = (byte)(n >> 24);
-        s[5] = (byte)(n >> 16);
-        s[6] = (byte)(n >> 8);
-        s[7] = (byte)(n);
-        System.arraycopy(input, 0, s, 8, l);
-        s[8+l] = (byte)0x80;
+        // 4. S = L || N || input_string || 0x80
+        byte[] ln = new byte[8];
+        ln[0] = (byte)(l >> 24);
+        ln[1] = (byte)(l >> 16);
+        ln[2] = (byte)(l >> 8);
+        ln[3] = (byte)(l);
+        ln[4] = (byte)(n >> 24);
+        ln[5] = (byte)(n >> 16);
+        ln[6] = (byte)(n >> 8);
+        ln[7] = (byte)(n);
 
+        // 5. Zero padding of S
+        // Not necessary, see bcc
+
+        // 8. K = leftmost (0x00010203...1D1E1F, keylen).
         byte[] k = new byte[keyLen];
         for (int i = 0; i < k.length; i++) {
             k[i] = (byte)i;
         }
 
+        // 6. temp = the Null String
         byte[] temp = new byte[seedLen];
 
+        // 7. i = 0
         for (int i = 0; i * blockLen < temp.length; i++) {
-            byte[] iv = new byte[blockLen + s.length];
+            // 9.1 IV = i || 0^(outlen - len (i)). outLen is blockLen
+            byte[] iv = new byte[blockLen];
             iv[0] = (byte)(i >> 24);
             iv[1] = (byte)(i >> 16);
             iv[2] = (byte)(i >> 8);
             iv[3] = (byte)(i);
-            System.arraycopy(s, 0, iv, blockLen, s.length);
+
             int tailLen = temp.length - blockLen*i;
             if (tailLen > blockLen) {
                 tailLen = blockLen;
             }
-            System.arraycopy(bcc(k, iv), 0, temp, blockLen*i, tailLen);
+            // 9.2 temp = temp || BCC (K, (IV || S)).
+            System.arraycopy(bcc(k, iv, ln, input, new byte[]{(byte)0x80}),
+                    0, temp, blockLen*i, tailLen);
         }
 
+        // 10. K = leftmost(temp, keylen)
         k = Arrays.copyOf(temp, keyLen);
+
+        // 11. x = select(temp, keylen+1, keylen+outlen)
         byte[] x = Arrays.copyOfRange(temp, keyLen, temp.length);
 
+        // 12. temp = the Null string
+        // No need to clean up, temp will be overwritten
+
         for (int i = 0; i * blockLen < seedLen; i++) {
             try {
                 cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(k, keyAlg));
                 int tailLen = temp.length - blockLen*i;
+                // 14. requested_bits = leftmost(temp, nuumber_of_bits_to_return)
                 if (tailLen > blockLen) {
                     tailLen = blockLen;
                 }
@@ -309,21 +337,45 @@
                 throw new InternalError(e);
             }
         }
+
+        // 15. Return
         return temp;
     }
 
-    private byte[] bcc(byte[] k, byte[] data) {
+    /**
+     * Block_Encrypt in 10.3.3
+     *
+     * @param k the key
+     * @param data after concatenated, the data to be operated upon. This is
+     *             a series of byte[], each with an arbitrary length. Note
+     *             that the full length is not necessarily a multiple of
+     *             outlen. XOR with zero is no-op.
+     * @return the result
+     */
+    private byte[] bcc(byte[] k, byte[]... data) {
         byte[] chain = new byte[blockLen];
-        int n = data.length / blockLen;
-        for (int i = 0; i < n; i++) {
-            byte[] inputBlock = Arrays.copyOfRange(
-                    data, i * blockLen, i * blockLen + blockLen);
-            for (int j = 0; j < blockLen; j++) {
-                inputBlock[j] ^= chain[j];
+        int n1 = 0; // index in data
+        int n2 = 0; // index in data[n1]
+        // pack blockLen of bytes into chain from data[][], again and again
+        while (n1 < data.length) {
+            int j;
+            out: for (j = 0; j < blockLen; j++) {
+                while (n2 >= data[n1].length) {
+                    n1++;
+                    if (n1 >= data.length) {
+                        break out;
+                    }
+                    n2 = 0;
+                }
+                chain[j] ^= data[n1][n2];
+                n2++;
+            }
+            if (j == 0) { // all data happens to be consumed in the last loop
+                break;
             }
             try {
                 cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(k, keyAlg));
-                chain = cipher.doFinal(inputBlock);
+                chain = cipher.doFinal(chain);
             } catch (GeneralSecurityException e) {
                 throw new InternalError(e);
             }
@@ -341,6 +393,11 @@
 
             // Step 1: cat bytes
             if (additionalInput != null) {
+                if (ei.length + additionalInput.length < 0) {
+                    // Length must be represented as a 32 bit integer in df()
+                    throw new IllegalArgumentException(
+                            "entropy plus additional input is too long");
+                }
                 byte[] temp = Arrays.copyOf(
                         ei, ei.length + additionalInput.length);
                 System.arraycopy(additionalInput, 0, temp, ei.length,
@@ -430,10 +487,10 @@
 
         // Step 3. temp = Null
         int pos = 0;
+        int len = result.length;
 
         // Step 4. Loop
-        while (pos < result.length) {
-            int tailLen = result.length - pos;
+        while (len > 0) {
             // Step 4.1. Increment
             addOne(v, ctrLen);
             try {
@@ -443,10 +500,15 @@
 
                 // Step 4.3 and 5. Cat bytes and leftmost
                 System.arraycopy(out, 0, result, pos,
-                        (tailLen > blockLen) ? blockLen : tailLen);
+                        (len > blockLen) ? blockLen : len);
             } catch (GeneralSecurityException e) {
                 throw new InternalError(e);
             }
+            len -= blockLen;
+            if (len <= 0) {
+                // shortcut, so that pos needn't be updated
+                break;
+            }
             pos += blockLen;
         }
 
--- a/jdk/src/java.base/share/classes/sun/security/provider/HashDrbg.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/HashDrbg.java	Thu Jul 07 18:35:29 2016 +0000
@@ -31,7 +31,9 @@
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
 import java.security.SecureRandomParameters;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
 public class HashDrbg extends AbstractHashDrbg {
 
@@ -70,7 +72,7 @@
         }
     }
 
-    private byte[] hashDf(int requested, byte[]... inputs) {
+    private byte[] hashDf(int requested, List<byte[]> inputs) {
         return hashDf(digest, outLen, requested, inputs);
     }
 
@@ -79,6 +81,9 @@
      * The function is used inside Hash_DRBG, and can also be used as an
      * approved conditioning function as described in 800-90B 6.4.2.2.
      *
+     * Note: In each current call, requested is seedLen, therefore small,
+     * no need to worry about overflow.
+     *
      * @param digest a {@code MessageDigest} object in reset state
      * @param outLen {@link MessageDigest#getDigestLength} of {@code digest}
      * @param requested requested output length, in bytes
@@ -86,12 +91,18 @@
      * @return the condensed/expanded output
      */
     public static byte[] hashDf(MessageDigest digest, int outLen,
-                                int requested, byte[]... inputs) {
+                                int requested, List<byte[]> inputs) {
+        // 1. temp = the Null string.
+        // 2. len = upper_int(no_of_bits_to_return / outLen)
         int len = (requested + outLen - 1) / outLen;
         byte[] temp = new byte[len * outLen];
+        // 3. counter = 0x01
         int counter = 1;
 
+        // 4. For i = 1 to len do
         for (int i=0; i<len; i++) {
+            // 4.1 temp = temp
+            //      || Hash (counter || no_of_bits_to_return || input_string).
             digest.update((byte) counter);
             digest.update((byte)(requested >> 21)); // requested*8 as int32
             digest.update((byte)(requested >> 13));
@@ -105,14 +116,17 @@
             } catch (DigestException e) {
                 throw new AssertionError("will not happen", e);
             }
+            // 4.2 counter = counter + 1
             counter++;
         }
+        // 5. requested_bits = leftmost (temp, no_of_bits_to_return).
         return temp.length == requested? temp: Arrays.copyOf(temp, requested);
+        // 6. Return
     }
 
     // This method is used by both instantiation and reseeding.
     @Override
-    protected final synchronized void hashReseedInternal(byte[] input) {
+    protected final synchronized void hashReseedInternal(List<byte[]> inputs) {
 
         // 800-90Ar1 10.1.1.2: Instantiate Process.
         // 800-90Ar1 10.1.1.3: Reseed Process.
@@ -121,16 +135,21 @@
         // Step 2: seed = Hash_df (seed_material, seedlen).
         if (v != null) {
             // Step 1 of 10.1.1.3: Prepend 0x01 || V
-            seed = hashDf(seedLen, ONE, v, input);
+            inputs.add(0, ONE);
+            inputs.add(1, v);
+            seed = hashDf(seedLen, inputs);
         } else {
-            seed = hashDf(seedLen, input);
+            seed = hashDf(seedLen, inputs);
         }
 
         // Step 3. V = seed.
         v = seed;
 
         // Step 4. C = Hash_df ((0x00 || V), seedlen).
-        c = hashDf(seedLen, ZERO, v);
+        inputs = new ArrayList<>(2);
+        inputs.add(ZERO);
+        inputs.add(v);
+        c = hashDf(seedLen, inputs);
 
         // Step 5. reseed_counter = 1.
         reseedCounter = 1;
@@ -197,7 +216,7 @@
         }
 
         // Step 3. Hashgen (requested_number_of_bits, V).
-        hashGen(result, result.length, v);
+        hashGen(result, v);
 
         // Step 4. H = Hash (0x03 || V).
         digest.update((byte)3);
@@ -222,10 +241,7 @@
     }
 
     // 800-90Ar1 10.1.1.4: Hashgen
-    private void hashGen(byte[] output, int len, byte[] v) {
-
-        // Step 1. m
-        int m = (len + outLen - 1) / outLen;
+    private void hashGen(byte[] output, byte[] v) {
 
         // Step 2. data = V
         byte[] data = v;
@@ -233,32 +249,36 @@
         // Step 3: W is output not filled
 
         // Step 4: For i = 1 to m
-        for (int i = 0; i < m; i++) {
-            int tailLen = len - i * outLen;
-            if (tailLen < outLen) {
+        int pos = 0;
+        int len = output.length;
+
+        while (len > 0) {
+            if (len < outLen) {
                 // Step 4.1 w = Hash (data).
                 // Step 4.2 W = W || w.
-                System.arraycopy(digest.digest(data), 0, output, i * outLen,
-                        tailLen);
+                System.arraycopy(digest.digest(data), 0, output, pos,
+                        len);
             } else {
                 try {
                     // Step 4.1 w = Hash (data).
                     digest.update(data);
                     // Step 4.2 digest into right position, no need to cat
-                    digest.digest(output, i*outLen, outLen);
+                    digest.digest(output, pos, outLen);
                 } catch (DigestException e) {
                     throw new AssertionError("will not happen", e);
                 }
             }
-            // Unless this is the last around, we will need to increment data.
-            // but we cannot change v, so a copy is made.
-            if (i != m - 1) {
-                if (data == v) {
-                    data = Arrays.copyOf(v, v.length);
-                }
-                // Step 4.3 data = (data + 1) mod 2^seedlen.
-                addBytes(data, seedLen, ONE);
+            len -= outLen;
+            if (len <= 0) {
+                // shortcut, so that data and pos needn't be updated
+                break;
             }
+            // Step 4.3 data = (data + 1) mod 2^seedlen.
+            if (data == v) {
+                data = Arrays.copyOf(v, v.length);
+            }
+            addBytes(data, seedLen, ONE);
+            pos += outLen;
         }
 
         // Step 5: No need to truncate
--- a/jdk/src/java.base/share/classes/sun/security/provider/HmacDrbg.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/HmacDrbg.java	Thu Jul 07 18:35:29 2016 +0000
@@ -32,6 +32,8 @@
 import java.security.NoSuchProviderException;
 import java.security.SecureRandomParameters;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
 public class HmacDrbg extends AbstractHashDrbg {
 
@@ -56,7 +58,7 @@
     }
 
     // 800-90Ar1 10.1.2.2: HMAC_DRBG Update Process
-    private void update(byte[]... inputs) {
+    private void update(List<byte[]> inputs) {
         try {
             // Step 1. K = HMAC (K, V || 0x00 || provided_data).
             mac.init(new SecretKeySpec(k, macAlg));
@@ -71,7 +73,7 @@
             mac.init(new SecretKeySpec(k, macAlg));
             v = mac.doFinal(v);
 
-            if (inputs.length != 0) {
+            if (!inputs.isEmpty()) {
                 // Step 4. K = HMAC (K, V || 0x01 || provided_data).
                 mac.update(v);
                 mac.update((byte) 1);
@@ -116,7 +118,7 @@
 
     // This method is used by both instantiation and reseeding.
     @Override
-    protected final synchronized void hashReseedInternal(byte[] input) {
+    protected final synchronized void hashReseedInternal(List<byte[]> input) {
 
         // 800-90Ar1 10.1.2.3: Instantiate Process.
         // 800-90Ar1 10.1.2.4: Reseed Process.
@@ -156,16 +158,15 @@
 
         // Step 2. HMAC_DRBG_Update
         if (additionalInput != null) {
-            update(additionalInput);
+            update(Collections.singletonList(additionalInput));
         }
 
         // Step 3. temp = Null.
         int pos = 0;
+        int len = result.length;
 
         // Step 4. Loop
-        while (pos < result.length) {
-            int tailLen = result.length - pos;
-
+        while (len > 0) {
             // Step 4.1 V = HMAC (Key, V).
             try {
                 mac.init(new SecretKeySpec(k, macAlg));
@@ -175,7 +176,13 @@
             v = mac.doFinal(v);
             // Step 4.2 temp = temp || V.
             System.arraycopy(v, 0, result, pos,
-                    tailLen > outLen ? outLen : tailLen);
+                    len > outLen ? outLen : len);
+
+            len -= outLen;
+            if (len <= 0) {
+                // shortcut, so that pos needn't be updated
+                break;
+            }
             pos += outLen;
         }
 
@@ -183,9 +190,9 @@
 
         // Step 6. HMAC_DRBG_Update (additional_input, Key, V).
         if (additionalInput != null) {
-            update(additionalInput);
+            update(Collections.singletonList(additionalInput));
         } else {
-            update();
+            update(Collections.emptyList());
         }
 
         // Step 7. reseed_counter = reseed_counter + 1.
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java	Thu Jul 07 18:35:29 2016 +0000
@@ -27,6 +27,7 @@
 
 import java.security.AlgorithmConstraints;
 import java.security.CryptoPrimitive;
+import java.security.Timestamp;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -77,6 +78,7 @@
     private final PublicKey trustedPubKey;
     private final Date pkixdate;
     private PublicKey prevPubKey;
+    private final Timestamp jarTimestamp;
 
     private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET =
         Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE));
@@ -142,6 +144,29 @@
         this.trustedPubKey = null;
         this.constraints = constraints;
         this.pkixdate = null;
+        this.jarTimestamp = null;
+    }
+
+    /**
+     * Create a new {@code AlgorithmChecker} with the given
+     * {@code Timestamp}.
+     * <p>
+     * Note that this constructor will be used to check a certification
+     * path for signed JAR files that are timestamped.
+     *
+     * @param jarTimestamp Timestamp passed for JAR timestamp constraint
+     *                     checking. Set to null if not applicable.
+     */
+    public AlgorithmChecker(Timestamp jarTimestamp) {
+        this.prevPubKey = null;
+        this.trustedPubKey = null;
+        this.constraints = certPathDefaultConstraints;
+        if (jarTimestamp == null) {
+            throw new IllegalArgumentException(
+                    "Timestamp cannot be null");
+        }
+        this.pkixdate = jarTimestamp.getTimestamp();
+        this.jarTimestamp = jarTimestamp;
     }
 
     /**
@@ -162,7 +187,7 @@
 
         if (anchor == null) {
             throw new IllegalArgumentException(
-                        "The trust anchor cannot be null");
+                    "The trust anchor cannot be null");
         }
 
         if (anchor.getTrustedCert() != null) {
@@ -179,6 +204,7 @@
         this.prevPubKey = trustedPubKey;
         this.constraints = constraints;
         this.pkixdate = pkixdate;
+        this.jarTimestamp = null;
     }
 
     /**
@@ -209,6 +235,10 @@
         return AnchorCertificates.contains(cert);
     }
 
+    Timestamp getJarTimestamp() {
+        return jarTimestamp;
+    }
+
     @Override
     public void init(boolean forward) throws CertPathValidatorException {
         //  Note that this class does not support forward mode.
@@ -296,8 +326,7 @@
         // permits() will throw exception on failure.
         certPathDefaultConstraints.permits(primitives,
                 new CertConstraintParameters((X509Certificate)cert,
-                        trustedMatch, pkixdate));
-                // new CertConstraintParameters(x509Cert, trustedMatch));
+                        trustedMatch, pkixdate, jarTimestamp));
         // If there is no previous key, set one and exit
         if (prevPubKey == null) {
             prevPubKey = currPubKey;
@@ -442,7 +471,7 @@
      * Check the signature algorithm with the specified public key.
      *
      * @param key the public key to verify the CRL signature
-     * @param crl the target CRL
+     * @param algorithmId signature algorithm Algorithm ID
      */
     static void check(PublicKey key, AlgorithmId algorithmId)
                         throws CertPathValidatorException {
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIX.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 
 import java.security.InvalidAlgorithmParameterException;
 import java.security.PublicKey;
+import java.security.Timestamp;
 import java.security.cert.*;
 import java.security.interfaces.DSAPublicKey;
 import java.util.*;
@@ -85,6 +86,7 @@
         private CertSelector constraints;
         private Set<TrustAnchor> anchors;
         private List<X509Certificate> certs;
+        private Timestamp timestamp;
 
         ValidatorParams(CertPath cp, PKIXParameters params)
             throws InvalidAlgorithmParameterException
@@ -100,6 +102,10 @@
         ValidatorParams(PKIXParameters params)
             throws InvalidAlgorithmParameterException
         {
+            if (params instanceof PKIXTimestampParameters) {
+                timestamp = ((PKIXTimestampParameters) params).getTimestamp();
+            }
+
             this.anchors = params.getTrustAnchors();
             // Make sure that none of the trust anchors include name constraints
             // (not supported).
@@ -189,6 +195,10 @@
         PKIXParameters getPKIXParameters() {
             return params;
         }
+
+        Timestamp timestamp() {
+            return timestamp;
+        }
     }
 
     static class BuilderParams extends ValidatorParams {
--- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -172,7 +172,11 @@
         List<PKIXCertPathChecker> certPathCheckers = new ArrayList<>();
         // add standard checkers that we will be using
         certPathCheckers.add(untrustedChecker);
-        certPathCheckers.add(new AlgorithmChecker(anchor, params.date()));
+        if (params.timestamp() == null) {
+            certPathCheckers.add(new AlgorithmChecker(anchor, params.date()));
+        } else {
+            certPathCheckers.add(new AlgorithmChecker(params.timestamp()));
+        }
         certPathCheckers.add(new KeyChecker(certPathLen,
                                             params.targetCertConstraints()));
         certPathCheckers.add(new ConstraintsChecker(certPathLen));
@@ -189,8 +193,14 @@
                                              rootNode);
         certPathCheckers.add(pc);
         // default value for date is current time
-        BasicChecker bc = new BasicChecker(anchor, params.date(),
-                                           params.sigProvider(), false);
+        BasicChecker bc;
+        if (params.timestamp() == null) {
+            bc = new BasicChecker(anchor, params.date(), params.sigProvider(),
+                    false);
+        } else {
+            bc = new BasicChecker(anchor, params.timestamp().getTimestamp(),
+                    params.sigProvider(), false);
+        }
         certPathCheckers.add(bc);
 
         boolean revCheckerAdded = false;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXTimestampParameters.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package sun.security.provider.certpath;
+
+import java.security.InvalidAlgorithmParameterException;
+import java.security.Timestamp;
+import java.security.cert.CertSelector;
+import java.security.cert.CertStore;
+import java.security.cert.PKIXBuilderParameters;
+import java.security.cert.PKIXCertPathChecker;
+import java.security.cert.TrustAnchor;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This class is a wrapper for PKIXBuilderParameters so that a Timestamp object
+ * can be passed alone when PKIXCertPath is checking signed jar files.
+ */
+
+public class PKIXTimestampParameters extends PKIXBuilderParameters {
+
+    private final PKIXBuilderParameters p;
+    private Timestamp jarTimestamp;
+
+    public PKIXTimestampParameters(PKIXBuilderParameters params,
+            Timestamp timestamp) throws InvalidAlgorithmParameterException {
+        super(params.getTrustAnchors(), null);
+        p = params;
+        jarTimestamp = timestamp;
+    }
+
+    public Timestamp getTimestamp() {
+        return jarTimestamp;
+    }
+    public void setTimestamp(Timestamp t) {
+        jarTimestamp = t;
+    }
+
+    @Override
+    public void setDate(Date d) {
+        p.setDate(d);
+    }
+
+    @Override
+    public void addCertPathChecker(PKIXCertPathChecker c) {
+        p.addCertPathChecker(c);
+    }
+
+    @Override
+    public void setMaxPathLength(int maxPathLength) {
+        p.setMaxPathLength(maxPathLength);
+    }
+
+    @Override
+    public int getMaxPathLength() {
+        return p.getMaxPathLength();
+    }
+
+    @Override
+    public String toString() {
+        return p.toString();
+    }
+
+    @Override
+    public Set<TrustAnchor> getTrustAnchors() {
+        return p.getTrustAnchors();
+    }
+
+    @Override
+    public void setTrustAnchors(Set<TrustAnchor> trustAnchors)
+            throws InvalidAlgorithmParameterException {
+        // To avoid problems with PKIXBuilderParameter's constructors
+        if (p == null) {
+            return;
+        }
+        p.setTrustAnchors(trustAnchors);
+    }
+
+    @Override
+    public Set<String> getInitialPolicies() {
+        return p.getInitialPolicies();
+    }
+
+    @Override
+    public void setInitialPolicies(Set<String> initialPolicies) {
+        p.setInitialPolicies(initialPolicies);
+    }
+
+    @Override
+    public void setCertStores(List<CertStore> stores) {
+        p.setCertStores(stores);
+    }
+
+    @Override
+    public void addCertStore(CertStore store) {
+        p.addCertStore(store);
+    }
+
+    @Override
+    public List<CertStore> getCertStores() {
+        return p.getCertStores();
+    }
+
+    @Override
+    public void setRevocationEnabled(boolean val) {
+        p.setRevocationEnabled(val);
+    }
+
+    @Override
+    public boolean isRevocationEnabled() {
+        return p.isRevocationEnabled();
+    }
+
+    @Override
+    public void setExplicitPolicyRequired(boolean val) {
+        p.setExplicitPolicyRequired(val);
+    }
+
+    @Override
+    public boolean isExplicitPolicyRequired() {
+        return p.isExplicitPolicyRequired();
+    }
+
+    @Override
+    public void setPolicyMappingInhibited(boolean val) {
+        p.setPolicyMappingInhibited(val);
+    }
+
+    @Override
+    public boolean isPolicyMappingInhibited() {
+        return p.isPolicyMappingInhibited();
+    }
+
+    @Override
+    public void setAnyPolicyInhibited(boolean val) {
+        p.setAnyPolicyInhibited(val);
+    }
+
+    @Override
+    public boolean isAnyPolicyInhibited() {
+        return p.isAnyPolicyInhibited();
+    }
+
+    @Override
+    public void setPolicyQualifiersRejected(boolean qualifiersRejected) {
+        p.setPolicyQualifiersRejected(qualifiersRejected);
+    }
+
+    @Override
+    public boolean getPolicyQualifiersRejected() {
+        return p.getPolicyQualifiersRejected();
+    }
+
+    @Override
+    public Date getDate() {
+        return p.getDate();
+    }
+
+    @Override
+    public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
+        p.setCertPathCheckers(checkers);
+    }
+
+    @Override
+    public List<PKIXCertPathChecker> getCertPathCheckers() {
+        return p.getCertPathCheckers();
+    }
+
+    @Override
+    public String getSigProvider() {
+        return p.getSigProvider();
+    }
+
+    @Override
+    public void setSigProvider(String sigProvider) {
+        p.setSigProvider(sigProvider);
+    }
+
+    @Override
+    public CertSelector getTargetCertConstraints() {
+        return p.getTargetCertConstraints();
+    }
+
+    @Override
+    public void setTargetCertConstraints(CertSelector selector) {
+        // To avoid problems with PKIXBuilderParameter's constructors
+        if (p == null) {
+            return;
+        }
+        p.setTargetCertConstraints(selector);
+    }
+
+}
--- a/jdk/src/java.base/share/classes/sun/security/util/CertConstraintParameters.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/util/CertConstraintParameters.java	Thu Jul 07 18:35:29 2016 +0000
@@ -25,6 +25,7 @@
 
 package sun.security.util;
 
+import java.security.Timestamp;
 import java.security.cert.X509Certificate;
 import java.util.Date;
 
@@ -40,16 +41,19 @@
     private final boolean trustedMatch;
     // PKIXParameter date
     private final Date pkixDate;
+    // Timestamp of the signed JAR file
+    private final Timestamp jarTimestamp;
 
     public CertConstraintParameters(X509Certificate c, boolean match,
-            Date pkixdate) {
+            Date pkixdate, Timestamp jarTime) {
         cert = c;
         trustedMatch = match;
         pkixDate = pkixdate;
+        jarTimestamp = jarTime;
     }
 
     public CertConstraintParameters(X509Certificate c) {
-        this(c, false, null);
+        this(c, false, null, null);
     }
 
     // Returns if the trust anchor has a match if anchor checking is enabled.
@@ -65,4 +69,8 @@
         return pkixDate;
     }
 
+    public Timestamp getJARTimestamp() {
+        return jarTimestamp;
+    }
+
 }
--- a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Thu Jul 07 18:35:29 2016 +0000
@@ -594,7 +594,9 @@
                  throws CertPathValidatorException {
              Date currentDate;
 
-             if (cp.getPKIXParamDate() != null) {
+             if (cp.getJARTimestamp() != null) {
+                 currentDate = cp.getJARTimestamp().getTimestamp();
+             } else if (cp.getPKIXParamDate() != null) {
                  currentDate = cp.getPKIXParamDate();
              } else {
                  currentDate = new Date();
--- a/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import javax.security.auth.x500.X500Principal;
 import sun.security.action.GetBooleanAction;
 import sun.security.provider.certpath.AlgorithmChecker;
+import sun.security.provider.certpath.PKIXTimestampParameters;
 
 /**
  * Validator implementation built on the PKIX CertPath API. This
@@ -194,13 +195,23 @@
                 ("null or zero-length certificate chain");
         }
 
+        // Check if 'parameter' affects 'pkixParameters'
+        PKIXBuilderParameters pkixParameters = null;
+        if (parameter instanceof Timestamp && plugin) {
+            try {
+                pkixParameters = new PKIXTimestampParameters(
+                        (PKIXBuilderParameters) parameterTemplate.clone(),
+                        (Timestamp) parameter);
+            } catch (InvalidAlgorithmParameterException e) {
+                // ignore exception
+            }
+        } else {
+            pkixParameters = (PKIXBuilderParameters) parameterTemplate.clone();
+        }
+
         // add new algorithm constraints checker
-        PKIXBuilderParameters pkixParameters =
-                    (PKIXBuilderParameters) parameterTemplate.clone();
-        AlgorithmChecker algorithmChecker = null;
         if (constraints != null) {
-            algorithmChecker = new AlgorithmChecker(constraints);
-            pkixParameters.addCertPathChecker(algorithmChecker);
+            pkixParameters.addCertPathChecker(new AlgorithmChecker(constraints));
         }
 
         // attach it to the PKIXBuilderParameters.
--- a/jdk/src/java.base/share/classes/sun/security/validator/Validator.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/java.base/share/classes/sun/security/validator/Validator.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -221,13 +221,6 @@
      * Validate the given certificate chain. If otherCerts is non-null, it is
      * a Collection of additional X509Certificates that could be helpful for
      * path building.
-     * <p>
-     * Parameter is an additional parameter with variant specific meaning.
-     * Currently, it is only defined for TLS_SERVER variant validators, where
-     * it must be non null and the name of the TLS key exchange algorithm being
-     * used (see JSSE X509TrustManager specification). In the future, it
-     * could be used to pass in a PKCS#7 object for code signing to check time
-     * stamps.
      *
      * @return a non-empty chain that was used to validate the path. The
      * end entity cert is at index 0, the trust anchor at index n-1.
@@ -254,12 +247,12 @@
      *        represented with a zero-length byte array.
      * @param constraints algorithm constraints for certification path
      *        processing
-     * @param parameter an additional parameter with variant specific meaning.
-     *        Currently, it is only defined for TLS_SERVER variant validators,
-     *        where it must be non null and the name of the TLS key exchange
-     *        algorithm being used (see JSSE X509TrustManager specification).
-     *        In the future, it could be used to pass in a PKCS#7 object for
-     *        code signing to check time stamps.
+     * @param parameter an additional parameter object to pass specific data.
+     *        This parameter object maybe one of the two below:
+     *        1) TLS_SERVER variant validators, where it must be non null and
+     *        the name of the TLS key exchange algorithm being used
+     *        (see JSSE X509TrustManager specification).
+     *        2) {@code Timestamp} object from a signed JAR file.
      * @return a non-empty chain that was used to validate the path. The
      *        end entity cert is at index 0, the trust anchor at index n-1.
      */
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -870,8 +870,9 @@
  "onuncaught=y|n                   debug on any uncaught?            n\n"
  "timeout=<timeout value>          for listen/attach in milliseconds n\n"
  "mutf8=y|n                        output modified utf-8             n\n"
- "quiet=y|n                        control over terminal messages    n\n"
- "\n"
+ "quiet=y|n                        control over terminal messages    n\n"));
+
+    TTY_MESSAGE((
  "Obsolete Options\n"
  "----------------\n"
  "strict=y|n\n"
@@ -914,7 +915,9 @@
  "                               locations     = 0x020\n"
  "                               callbacks     = 0x040\n"
  "                               errors        = 0x080\n"
- "                               everything    = 0xfff\n"
+ "                               everything    = 0xfff"));
+
+    TTY_MESSAGE((
  "debugflags=flags             debug flags (bitmask)           none\n"
  "                               USE_ITERATE_THROUGH_HEAP 0x01\n"
  "\n"
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/error_messages.c	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/error_messages.c	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,8 +50,12 @@
 #include "utf_util.h"
 #include "proc_md.h"
 
-/* Maximim length of a message */
-#define MAX_MESSAGE_LEN MAXPATHLEN*2+512
+/* Maximum number of bytes in a message, including the trailing zero.
+ * Do not print very long messages as they could be truncated.
+ * Use at most one pathname per message. NOTE, we use MAXPATHLEN*2
+ * in case each character in the pathname takes 2 bytes.
+ */
+#define MAX_MESSAGE_BUF MAXPATHLEN*2+512
 
 /* Print message in platform encoding (assume all input is UTF-8 safe)
  *    NOTE: This function is at the lowest level of the call tree.
@@ -61,17 +65,16 @@
 vprint_message(FILE *fp, const char *prefix, const char *suffix,
                const char *format, va_list ap)
 {
-    jbyte  utf8buf[MAX_MESSAGE_LEN+1];
+    jbyte  utf8buf[MAX_MESSAGE_BUF];
     int    len;
-    char   pbuf[MAX_MESSAGE_LEN+1];
+    char   pbuf[MAX_MESSAGE_BUF];
 
     /* Fill buffer with single UTF-8 string */
-    (void)vsnprintf((char*)utf8buf, MAX_MESSAGE_LEN, format, ap);
-    utf8buf[MAX_MESSAGE_LEN] = 0;
+    (void)vsnprintf((char*)utf8buf, sizeof(utf8buf), format, ap);
     len = (int)strlen((char*)utf8buf);
 
     /* Convert to platform encoding (ignore errors, dangerous area) */
-    (void)utf8ToPlatform(utf8buf, len, pbuf, MAX_MESSAGE_LEN);
+    (void)utf8ToPlatform(utf8buf, len, pbuf, (int)sizeof(pbuf));
 
     (void)fprintf(fp, "%s%s%s", prefix, pbuf, suffix);
 }
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/transport.c	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/transport.c	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,8 +67,7 @@
         maxlen = len+len/2+2; /* Should allow for plenty of room */
         utf8msg = (jbyte*)jvmtiAllocate(maxlen+1);
         if (utf8msg != NULL) {
-           (void)utf8FromPlatform(msg, len, utf8msg, maxlen);
-           utf8msg[maxlen] = 0;
+           (void)utf8FromPlatform(msg, len, utf8msg, maxlen+1);
         }
     }
     if (rv == JDWPTRANSPORT_ERROR_NONE) {
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/utf_util.c	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/utf_util.c	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -350,16 +350,20 @@
 
 /*
  * Convert UTF-8 to a platform string
+ * NOTE: outputBufSize includes the space for the trailing 0.
  */
-int JNICALL utf8ToPlatform(jbyte *utf8, int len, char* output, int outputMaxLen) {
+int JNICALL utf8ToPlatform(jbyte *utf8, int len, char* output, int outputBufSize) {
     int wlen;
     int plen;
     WCHAR* wstr;
     UINT codepage;
+    int outputMaxLen;
 
     UTF_ASSERT(utf8);
     UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen > len);
+    UTF_ASSERT(len >= 0);
+    UTF_ASSERT(outputBufSize > len);
+    outputMaxLen = outputBufSize - 1; // leave space for trailing 0
 
     /* Zero length is ok, but we don't need to do much */
     if ( len == 0 ) {
@@ -394,16 +398,20 @@
 
 /*
  * Convert Platform Encoding to UTF-8.
+ * NOTE: outputBufSize includes the space for the trailing 0.
  */
-int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputMaxLen) {
+int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputBufSize) {
     int wlen;
     int plen;
     WCHAR* wstr;
     UINT codepage;
+    int outputMaxLen;
 
     UTF_ASSERT(str);
     UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen > len);
+    UTF_ASSERT(len >= 0);
+    UTF_ASSERT(outputBufSize > len);
+    outputMaxLen = outputBufSize - 1; // leave space for trailing 0
 
     /* Zero length is ok, but we don't need to do much */
     if ( len == 0 ) {
@@ -449,18 +457,21 @@
 /*
  * Do iconv() conversion.
  *    Returns length or -1 if output overflows.
+ * NOTE: outputBufSize includes the space for the trailing 0.
  */
-static int iconvConvert(conv_direction drn, char *bytes, size_t len, char *output, size_t outputMaxLen) {
+static int iconvConvert(conv_direction drn, char *bytes, size_t len, char *output, size_t outputBufSize) {
 
     static char *codeset = 0;
     iconv_t func;
     size_t bytes_converted;
     size_t inLeft, outLeft;
     char *inbuf, *outbuf;
+    int outputMaxLen;
 
     UTF_ASSERT(bytes);
     UTF_ASSERT(output);
-    UTF_ASSERT(outputMaxLen > len);
+    UTF_ASSERT(outputBufSize > len);
+    outputMaxLen = outputBufSize - 1; // leave space for trailing 0
 
     /* Zero length is ok, but we don't need to do much */
     if ( len == 0 ) {
@@ -524,17 +535,19 @@
 /*
  * Convert UTF-8 to Platform Encoding.
  *    Returns length or -1 if output overflows.
+ * NOTE: outputBufSize includes the space for the trailing 0.
  */
-int JNICALL utf8ToPlatform(jbyte *utf8, int len, char *output, int outputMaxLen) {
-    return iconvConvert(FROM_UTF8, (char*)utf8, len, output, outputMaxLen);
+int JNICALL utf8ToPlatform(jbyte *utf8, int len, char *output, int outputBufSize) {
+    return iconvConvert(FROM_UTF8, (char*)utf8, len, output, outputBufSize);
 }
 
 /*
  * Convert Platform Encoding to UTF-8.
  *    Returns length or -1 if output overflows.
+ * NOTE: outputBufSize includes the space for the trailing 0.
  */
-int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputMaxLen) {
-    return iconvConvert(TO_UTF8, str, len, (char*) output, outputMaxLen);
+int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputBufSize) {
+    return iconvConvert(TO_UTF8, str, len, (char*) output, outputBufSize);
 }
 
 #endif
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/utf_util.h	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/utf_util.h	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@
 int JNICALL utf8mToUtf8sLength(jbyte *string, int length);
 void JNICALL utf8mToUtf8s(jbyte *string, int length, jbyte *newString, int newLength);
 
-int JNICALL utf8ToPlatform(jbyte *utf8, int len, char* output, int outputMaxLen);
-int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputMaxLen);
+int JNICALL utf8ToPlatform(jbyte *utf8, int len, char* output, int outputBufSize);
+int JNICALL utf8FromPlatform(char *str, int len, jbyte *output, int outputBufSize);
 
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ClassForNamePlugin.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.tools.jlink.internal.plugins;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import jdk.tools.jlink.plugin.ModulePool;
+import jdk.tools.jlink.plugin.Plugin.Category;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import static jdk.internal.org.objectweb.asm.ClassReader.*;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Opcodes;
+import jdk.internal.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
+import jdk.internal.org.objectweb.asm.tree.ClassNode;
+import jdk.internal.org.objectweb.asm.tree.InsnList;
+import jdk.internal.org.objectweb.asm.tree.LabelNode;
+import jdk.internal.org.objectweb.asm.tree.LdcInsnNode;
+import jdk.internal.org.objectweb.asm.tree.LineNumberNode;
+import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
+import jdk.internal.org.objectweb.asm.tree.MethodNode;
+import jdk.tools.jlink.plugin.ModuleEntry;
+import jdk.tools.jlink.plugin.Plugin;
+
+public final class ClassForNamePlugin implements Plugin {
+    public static final String NAME = "class-for-name";
+
+    private static String binaryClassName(String path) {
+        return path.substring(path.indexOf('/', 1) + 1,
+                              path.length() - ".class".length());
+    }
+
+    private static int getAccess(ModuleEntry resource) {
+        ClassReader cr = new ClassReader(resource.getBytes());
+
+        return cr.getAccess();
+    }
+
+    private static String getPackage(String binaryName) {
+        int index = binaryName.lastIndexOf("/");
+
+        return index == -1 ? "" : binaryName.substring(0, index);
+    }
+
+    private ModuleEntry transform(ModuleEntry resource, Map<String, ModuleEntry> classes) {
+        byte[] inBytes = resource.getBytes();
+        ClassReader cr = new ClassReader(inBytes);
+        ClassNode cn = new ClassNode();
+        cr.accept(cn, EXPAND_FRAMES);
+        List<MethodNode> ms = cn.methods;
+        boolean modified = false;
+        LdcInsnNode ldc = null;
+
+        String thisPackage = getPackage(binaryClassName(resource.getPath()));
+
+        for (MethodNode mn : ms) {
+            InsnList il = mn.instructions;
+            Iterator<AbstractInsnNode> it = il.iterator();
+
+            while (it.hasNext()) {
+                AbstractInsnNode insn = it.next();
+
+                if (insn instanceof LdcInsnNode) {
+                    ldc = (LdcInsnNode)insn;
+                } else if (insn instanceof MethodInsnNode && ldc != null) {
+                    MethodInsnNode min = (MethodInsnNode)insn;
+
+                    if (min.getOpcode() == Opcodes.INVOKESTATIC &&
+                        min.name.equals("forName") &&
+                        min.owner.equals("java/lang/Class") &&
+                        min.desc.equals("(Ljava/lang/String;)Ljava/lang/Class;")) {
+                        String ldcClassName = ldc.cst.toString();
+                        String thatClassName = ldcClassName.replaceAll("\\.", "/");
+                        ModuleEntry thatClass = classes.get(thatClassName);
+
+                        if (thatClass != null) {
+                            int thatAccess = getAccess(thatClass);
+                            String thatPackage = getPackage(thatClassName);
+
+                            if ((thatAccess & Opcodes.ACC_PRIVATE) != Opcodes.ACC_PRIVATE &&
+                                ((thatAccess & Opcodes.ACC_PUBLIC) == Opcodes.ACC_PUBLIC ||
+                                  thisPackage.equals(thatPackage))) {
+                                Type type = Type.getObjectType(thatClassName);
+                                il.remove(ldc);
+                                il.set(min, new LdcInsnNode(type));
+                                modified = true;
+                            }
+                        }
+                    }
+
+                    ldc = null;
+                } else if (!(insn instanceof LabelNode) &&
+                           !(insn instanceof LineNumberNode)) {
+                    ldc = null;
+                }
+
+            }
+        }
+
+        if (modified) {
+            ClassWriter cw = new ClassWriter(cr, 0);
+            cn.accept(cw);
+            byte[] outBytes = cw.toByteArray();
+
+            return resource.create(outBytes);
+        }
+
+        return resource;
+    }
+
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+    @Override
+    public void visit(ModulePool in, ModulePool out) {
+        Objects.requireNonNull(in);
+        Objects.requireNonNull(out);
+        Map<String, ModuleEntry> classes = in.entries()
+            .filter(resource -> resource != null &&
+                    resource.getPath().endsWith(".class") &&
+                    !resource.getPath().endsWith("/module-info.class"))
+            .collect(Collectors.toMap(resource -> binaryClassName(resource.getPath()),
+                                      resource -> resource));
+        in.entries()
+            .filter(resource -> resource != null)
+            .forEach(resource -> {
+                String path = resource.getPath();
+
+                if (path.endsWith(".class") && !path.endsWith("/module-info.class")) {
+                    out.add(transform(resource, classes));
+                } else {
+                    out.add(resource);
+                }
+            });
+    }
+
+    @Override
+    public Category getType() {
+        return Category.TRANSFORMER;
+    }
+
+    @Override
+    public boolean hasArguments() {
+        return false;
+    }
+
+    @Override
+    public String getDescription() {
+        return PluginsResourceBundle.getDescription(NAME);
+    }
+
+    @Override
+    public String getArgumentsDescription() {
+       return PluginsResourceBundle.getArgument(NAME);
+    }
+
+    @Override
+    public void configure(Map<String, String> config) {
+
+    }
+}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/OptimizationPlugin.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,285 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UncheckedIOException;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.function.Consumer;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.tools.jlink.internal.plugins.asm.AsmPlugin;
-import jdk.internal.org.objectweb.asm.tree.ClassNode;
-import jdk.internal.org.objectweb.asm.tree.MethodNode;
-import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.optim.ForNameFolding;
-import jdk.tools.jlink.internal.plugins.optim.ReflectionOptimizer.TypeResolver;
-import jdk.tools.jlink.plugin.PluginException;
-
-/**
- *
- * Optimize Classes following various strategies. Strategies are implementation
- * of <code>ClassOptimizer</code> and <code>MethodOptimizer</code>.
- */
-public final class OptimizationPlugin extends AsmPlugin {
-
-    public static final String NAME = "class-optim";
-    public static final String LOG  = "log";
-    public static final String ALL = "all";
-    public static final String FORNAME_REMOVAL = "forName-folding";
-
-    /**
-     * Default resolver. A resolver that retrieve types that are in an
-     * accessible package, are public or are located in the same package as the
-     * caller.
-     */
-    private static final class DefaultTypeResolver implements TypeResolver {
-
-        private final Set<String> packages;
-        private final AsmPools pools;
-
-        DefaultTypeResolver(AsmPools pools, AsmModulePool modulePool) {
-            Objects.requireNonNull(pools);
-            Objects.requireNonNull(modulePool);
-            this.pools = pools;
-            packages = pools.getGlobalPool().getAccessiblePackages(modulePool.getModuleName());
-        }
-
-        @Override
-        public ClassReader resolve(ClassNode cn, MethodNode mn, String type) {
-            int classIndex = cn.name.lastIndexOf("/");
-            String callerPkg = classIndex == -1 ? ""
-                    : cn.name.substring(0, classIndex);
-            int typeClassIndex = type.lastIndexOf("/");
-            String pkg = typeClassIndex == - 1 ? ""
-                    : type.substring(0, typeClassIndex);
-            ClassReader reader = null;
-            if (packages.contains(pkg) || pkg.equals(callerPkg)) {
-                ClassReader r = pools.getGlobalPool().getClassReader(type);
-                if (r != null) {
-                    // if not private
-                    if ((r.getAccess() & Opcodes.ACC_PRIVATE)
-                            != Opcodes.ACC_PRIVATE) {
-                        // public
-                        if (((r.getAccess() & Opcodes.ACC_PUBLIC)
-                                == Opcodes.ACC_PUBLIC)) {
-                            reader = r;
-                        } else if (pkg.equals(callerPkg)) {
-                            reader = r;
-                        }
-                    }
-                }
-            }
-            return reader;
-        }
-    }
-
-    public interface Optimizer {
-
-        void close() throws IOException;
-    }
-
-    public interface ClassOptimizer extends Optimizer {
-
-        boolean optimize(Consumer<String> logger, AsmPools pools,
-                AsmModulePool modulePool,
-                ClassNode cn) throws Exception;
-    }
-
-    public interface MethodOptimizer extends Optimizer {
-
-        boolean optimize(Consumer<String> logger, AsmPools pools,
-                AsmModulePool modulePool,
-                ClassNode cn, MethodNode m, TypeResolver resolver) throws Exception;
-    }
-
-    private List<Optimizer> optimizers = new ArrayList<>();
-
-    private OutputStream stream;
-    private int numMethods;
-
-    private void log(String content) {
-        if (stream != null) {
-            try {
-                content = content + "\n";
-                stream.write(content.getBytes(StandardCharsets.UTF_8));
-            } catch (IOException ex) {
-                System.err.println(ex);
-            }
-        }
-    }
-
-    private void close() throws IOException {
-        log("Num analyzed methods " + numMethods);
-
-        for (Optimizer optimizer : optimizers) {
-            try {
-                optimizer.close();
-            } catch (IOException ex) {
-                System.err.println("Error closing optimizer " + ex);
-            }
-        }
-        if (stream != null) {
-            stream.close();
-        }
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public void visit(AsmPools pools) {
-        try {
-            for (AsmModulePool p : pools.getModulePools()) {
-                DefaultTypeResolver resolver = new DefaultTypeResolver(pools, p);
-                p.visitClassReaders((reader) -> {
-                    ClassWriter w = null;
-                    try {
-                        w = optimize(pools, p, reader, resolver);
-                    } catch (IOException ex) {
-                        throw new PluginException("Problem optimizing "
-                                + reader.getClassName(), ex);
-                    }
-                    return w;
-                });
-            }
-        } finally {
-            try {
-                close();
-            } catch (IOException ex) {
-                throw new UncheckedIOException(ex);
-            }
-        }
-    }
-
-    private ClassWriter optimize(AsmPools pools, AsmModulePool modulePool,
-            ClassReader reader, TypeResolver resolver)
-            throws IOException {
-        ClassNode cn = new ClassNode();
-        ClassWriter writer = null;
-        if ((reader.getAccess() & Opcodes.ACC_INTERFACE) == 0) {
-            reader.accept(cn, ClassReader.EXPAND_FRAMES);
-            boolean optimized = false;
-            for (Optimizer optimizer : optimizers) {
-                if (optimizer instanceof ClassOptimizer) {
-                    try {
-                        boolean optim = ((ClassOptimizer) optimizer).
-                                optimize(this::log, pools, modulePool, cn);
-                        if (optim) {
-                            optimized = true;
-                        }
-                    } catch (Throwable ex) {
-                        throw new PluginException("Exception optimizing "
-                                + reader.getClassName(), ex);
-                    }
-                } else {
-                    MethodOptimizer moptimizer = (MethodOptimizer) optimizer;
-                    for (MethodNode m : cn.methods) {
-                        if ((m.access & Opcodes.ACC_ABSTRACT) == 0
-                                && (m.access & Opcodes.ACC_NATIVE) == 0) {
-                            numMethods += 1;
-                            try {
-                                boolean optim = moptimizer.
-                                        optimize(this::log, pools, modulePool, cn,
-                                                m, resolver);
-                                if (optim) {
-                                    optimized = true;
-                                }
-                            } catch (Throwable ex) {
-                                throw new PluginException("Exception optimizing "
-                                        + reader.getClassName() + "." + m.name, ex);
-                            }
-
-                        }
-                    }
-                }
-            }
-
-            if (optimized) {
-                writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
-                try {
-                    // add a validation layer in between to check for class vallidity
-                    CheckClassAdapter ca = new CheckClassAdapter(writer);
-                    cn.accept(ca);
-                } catch (Exception ex) {
-                    throw new PluginException("Exception optimizing class " + cn.name, ex);
-                }
-            }
-        }
-        return writer;
-    }
-
-    @Override
-    public String getDescription() {
-        return PluginsResourceBundle.getDescription(NAME);
-    }
-
-    @Override
-    public boolean hasArguments() {
-        return true;
-    }
-
-    @Override
-    public String getArgumentsDescription() {
-       return PluginsResourceBundle.getArgument(NAME);
-    }
-
-    @Override
-    public void configure(Map<String, String> config) {
-        String strategies = config.get(NAME);
-        String[] arr = strategies.split(",");
-        for (String s : arr) {
-            if (s.equals(ALL)) {
-                optimizers.clear();
-                optimizers.add(new ForNameFolding());
-                break;
-            } else if (s.equals(FORNAME_REMOVAL)) {
-                optimizers.add(new ForNameFolding());
-            } else {
-                throw new IllegalArgumentException("Unknown optimization: " + s);
-            }
-        }
-        String f = config.get(LOG);
-        if (f != null) {
-            try {
-                stream = new FileOutputStream(f);
-            } catch (IOException ex) {
-                throw new UncheckedIOException(ex);
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmGlobalPool.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.asm;
-
-import java.util.Set;
-
-/**
- * A pool containing all class and resource files.
- */
-public interface AsmGlobalPool extends AsmPool {
-
-    /**
-     * Associate a package to a module, useful when adding new classes in new
-     * packages. WARNING: In order to properly handle new package and/or new
-     * module, module-info class must be added and/or updated.
-     *
-     * @param pkg The new package, following java binary syntax (/-separated
-     * path name).
-     * @param module An existing or new module.
-     * @throws jdk.tools.jlink.plugins.PluginException If a mapping already
-     * exist for this package.
-     */
-    public void addPackageModuleMapping(String pkg, String module);
-
-    /**
-     * Return the set of accessible packages for a given module.
-     *
-     * @param module The module from which packages are accessible.
-     * @return Set of packages or null if the module is not found.
-     */
-    public Set<String> getAccessiblePackages(String module);
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmModulePool.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.asm;
-
-import java.lang.module.ModuleDescriptor;
-import java.util.Set;
-import jdk.internal.org.objectweb.asm.ClassReader;
-
-/**
- * A pool for a given module
- */
-public interface AsmModulePool extends AsmPool {
-
-    /**
-     * Associate a package to this module, useful when adding new classes in new
-     * packages. WARNING: In order to properly handle new package and/or new
-     * module, module-info class must be added and/or updated.
-     *
-     * @param pkg The new package, following java binary syntax (/-separated
-     * path name).
-     * @throws jdk.tools.jlink.plugins.PluginException If a mapping already
-     * exist for this package.
-     */
-    public void addPackage(String pkg);
-
-    /**
-     * The module name of this pool.
-     * @return The module name;
-     */
-    public String getModuleName();
-
-    /**
-     * Lookup the class in this pool and the required pools. NB: static module
-     * readability can be different at execution time.
-     *
-     * @param binaryName The class to lookup.
-     * @return The reader or null if not found
-     * @throws jdk.tools.jlink.plugins.PluginException
-     */
-    public ClassReader getClassReaderInDependencies(String binaryName);
-
-    /**
-     * Lookup the class in the exported packages of this module. "public
-     * requires" modules are looked up. NB: static module readability can be
-     * different at execution time.
-     *
-     * @param callerModule Name of calling module.
-     * @param binaryName The class to lookup.
-     * @return The reader or null if not found
-     * @throws jdk.tools.jlink.plugins.PluginException
-     */
-    public ClassReader getExportedClassReader(String callerModule,
-            String binaryName);
-
-    /**
-     * The module descriptor.
-     *
-     * @return The module descriptor;
-     */
-    public ModuleDescriptor getDescriptor();
-
-    /**
-     * Retrieve the internal and exported packages.
-     *
-     * @return
-     */
-    public Set<String> getAllPackages();
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPlugin.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.asm;
-
-import java.util.Objects;
-import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-import jdk.tools.jlink.internal.ModulePoolImpl;
-
-/**
- * Extend this class to develop your own plugin in order to transform jimage
- * resources.
- *
- */
-public abstract class AsmPlugin implements Plugin {
-
-    public AsmPlugin() {
-    }
-
-    @Override
-    public void visit(ModulePool allContent, ModulePool outResources) {
-        Objects.requireNonNull(allContent);
-        Objects.requireNonNull(outResources);
-        ModulePoolImpl resources = new ModulePoolImpl(allContent.getByteOrder());
-        allContent.entries().forEach(md -> {
-            if(md.getType().equals(ModuleEntry.Type.CLASS_OR_RESOURCE)) {
-                resources.add(md);
-            } else {
-                outResources.add(md);
-            }
-        });
-        AsmPools pools = new AsmPools(resources);
-        visit(pools);
-        pools.fillOutputResources(outResources);
-    }
-
-    /**
-     * This is the method to implement in order to
-     * apply Asm transformation to jimage contained classes.
-     * @param pools The pool of Asm classes and other resource files.
-     * @param strings To add a string to the jimage strings table.
-     * @throws jdk.tools.jlink.plugin.PluginException
-     */
-    public abstract void visit(AsmPools pools);
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPool.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.asm;
-
-import java.util.Collection;
-import java.util.List;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-/**
- * A pool of ClassReader and other resource files.
- * This class allows to transform and sort classes and resource files.
- * <p>
- * Classes in the class pool are named following java binary name specification.
- * For example, java.lang.Object class is named java/lang/Object
- * <p>
- * Module information has been stripped out from class and other resource files
- * (.properties, binary files, ...).</p>
- */
-public interface AsmPool {
-
-    /**
-     * A resource that is not a class file.
-     * <p>
-     * The path of a resource is a /-separated path name that identifies the
-     * resource. For example com.foo.bar.Bundle.properties resource name is
-     * com/foo/bar/Bundle.properties </p>
-     * <p>
-     */
-    public class ResourceFile {
-
-        private final String path;
-        private final byte[] content;
-
-        public ResourceFile(String path, byte[] content) {
-            this.path = path;
-            this.content = content;
-        }
-
-        public String getPath() {
-            return path;
-        }
-
-        public byte[] getContent() {
-            return content;
-        }
-    }
-
-    /**
-     * To visit each Class contained in the pool
-     */
-    public interface ClassReaderVisitor {
-
-        /**
-         * Called for each ClassReader located in the pool.
-         *
-         * @param reader A class reader.
-         * @return A writer or null if the class has not been transformed.
-         */
-        public ClassWriter visit(ClassReader reader);
-    }
-
-    /**
-     * To visit each Resource contained in the pool
-     */
-    public interface ResourceFileVisitor {
-
-        /**
-         * Called for each Resource file located in the pool.
-         *
-         * @param reader A resource file.
-         * @return A resource file or null if the resource has not been
-         * transformed.
-         */
-        public ResourceFile visit(ResourceFile reader);
-    }
-
-    /**
-     * Contains the transformed classes. When the jimage file is generated,
-     * transformed classes take precedence on unmodified ones.
-     */
-    public interface WritableClassPool {
-
-        /**
-         * Add a class to the pool, if a class already exists, it is replaced.
-         *
-         * @param writer The class writer.
-         * @throws jdk.tools.jlink.plugin.PluginException
-         */
-        public void addClass(ClassWriter writer);
-
-        /**
-         * The class will be not added to the jimage file.
-         *
-         * @param className The class name to forget.
-         * @throws jdk.tools.jlink.plugin.PluginException
-         */
-        public void forgetClass(String className);
-
-        /**
-         * Get a transformed class.
-         *
-         * @param binaryName The java class binary name
-         * @return The ClassReader or null if the class is not found.
-         * @throws jdk.tools.jlink.plugin.PluginException
-         */
-        public ClassReader getClassReader(String binaryName);
-
-        /**
-         * Get a transformed class.
-         *
-         * @param res A class resource.
-         * @return The ClassReader or null if the class is not found.
-         * @throws jdk.tools.jlink.plugin.PluginException
-         */
-        public ClassReader getClassReader(ModuleEntry res);
-
-        /**
-         * Returns all the classes contained in the writable pool.
-         *
-         * @return The collection of classes.
-         */
-        public Collection<ModuleEntry> getClasses();
-    }
-
-    /**
-     * Contains the transformed resources. When the jimage file is generated,
-     * transformed resources take precedence on unmodified ones.
-     */
-    public interface WritableResourcePool {
-
-        /**
-         * Add a resource, if the resource exists, it is replaced.
-         *
-         * @param resFile The resource file to add.
-         * @throws jdk.tools.jlink.plugin.PluginException
-         */
-        public void addResourceFile(ResourceFile resFile);
-
-        /**
-         * The resource will be not added to the jimage file.
-         *
-         * @param resourceName
-         * @throws jdk.tools.jlink.plugin.PluginException If the resource to
-         * forget doesn't exist or is null.
-         */
-        public void forgetResourceFile(String resourceName);
-
-        /**
-         * Get a transformed resource.
-         *
-         * @param name The java resource name
-         * @return The Resource or null if the resource is not found.
-         */
-        public ResourceFile getResourceFile(String name);
-
-        /**
-         * Get a transformed resource.
-         *
-         * @param res The java resource
-         * @return The Resource or null if the resource is not found.
-         */
-        public ResourceFile getResourceFile(ModuleEntry res);
-
-        /**
-         * Returns all the resources contained in the writable pool.
-         *
-         * @return The array of resources.
-         */
-        public Collection<ModuleEntry> getResourceFiles();
-    }
-
-    /**
-     * To order the classes and resources within a jimage file.
-     */
-    public interface Sorter {
-
-        /**
-         * @param resources The resources will be added to the jimage following
-         * the order of this ResourcePool.
-         * @return The resource paths ordered in the way to use for storage in the jimage.
-         * @throws jdk.tools.jlink.plugin.PluginException
-         */
-        public List<String> sort(ModulePool resources);
-    }
-
-    /**
-     * The writable pool used to store transformed resources.
-     *
-     * @return The writable pool.
-     */
-    public WritableClassPool getTransformedClasses();
-
-    /**
-     * The writable pool used to store transformed resource files.
-     *
-     * @return The writable pool.
-     */
-    public WritableResourcePool getTransformedResourceFiles();
-
-    /**
-     * Set a sorter instance to sort all files. If no sorter is set, then input
-     * Resources will be added in the order they have been received followed by
-     * newly added resources.
-     *
-     * @param sorter
-     */
-    public void setSorter(Sorter sorter);
-
-    /**
-     * Returns the classes contained in the pool.
-     *
-     * @return The classes.
-     */
-    public Collection<ModuleEntry> getClasses();
-
-    /**
-     * Returns the resources contained in the pool. Resources are all the file
-     * that are not classes (eg: properties file, binary files, ...)
-     *
-     * @return The array of resource files.
-     */
-    public Collection<ModuleEntry> getResourceFiles();
-
-    /**
-     * Retrieves a resource based on the binary name. This name doesn't contain
-     * the module name.
-     * <b>NB:</b> When dealing with resources that have the same name in various
-     * modules (eg: META-INFO/*), you should use the <code>ResourcePool</code>
-     * referenced from this <code>AsmClassPool</code>.
-     *
-     * @param binaryName Name of a Java resource or null if the resource doesn't
-     * exist.
-     * @return
-     */
-    public ResourceFile getResourceFile(String binaryName);
-
-    /**
-     * Retrieves a resource for the passed resource.
-     *
-     * @param res The resource
-     * @return The resource file or null if it doesn't exist.
-     */
-    public ResourceFile getResourceFile(ModuleEntry res);
-
-    /**
-     * Retrieve a ClassReader from the pool.
-     *
-     * @param binaryName Class binary name
-     * @return A reader or null if the class is unknown
-     * @throws jdk.tools.jlink.plugin.PluginException
-     */
-    public ClassReader getClassReader(String binaryName);
-
-    /**
-     * Retrieve a ClassReader from the pool.
-     *
-     * @param res A resource.
-     * @return A reader or null if the class is unknown
-     * @throws jdk.tools.jlink.plugin.PluginException
-     */
-    public ClassReader getClassReader(ModuleEntry res);
-
-    /**
-     * To visit the set of ClassReaders.
-     *
-     * @param visitor The visitor.
-     * @throws jdk.tools.jlink.plugin.PluginException
-     */
-    public void visitClassReaders(ClassReaderVisitor visitor);
-
-    /**
-     * To visit the set of ClassReaders.
-     *
-     * @param visitor The visitor.
-     * @throws jdk.tools.jlink.plugin.PluginException
-     */
-    public void visitResourceFiles(ResourceFileVisitor visitor);
-
-    /**
-     * Returns the pool of all the resources (transformed and unmodified).
-     * The input resources are replaced by the transformed ones.
-     * If a sorter has been set, it is used to sort the returned resources.
-     *
-     * @param output The pool used to fill the jimage.
-     * @throws jdk.tools.jlink.plugin.PluginException
-     */
-    public void fillOutputResources(ModulePool output);
-
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPoolImpl.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,698 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.asm;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Requires;
-import java.lang.module.ModuleDescriptor.Requires.Modifier;
-import java.lang.module.ModuleDescriptor.Exports;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Set;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.tools.jlink.internal.ImageFileCreator;
-import jdk.tools.jlink.internal.ModulePoolImpl;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.ModulePool;
-
-/**
- * A pool of ClassReader and other resource files. This class allows to
- * transform and sort classes and resource files.
- * <p>
- * Classes in the class pool are named following java binary name specification.
- * For example, java.lang.Object class is named java/lang/Object
- * <p>
- * Module information has been stripped out from class and other resource files
- * (.properties, binary files, ...).</p>
- */
-final class AsmPoolImpl implements AsmModulePool {
-
-    /**
-     * Contains the transformed classes. When the jimage file is generated,
-     * transformed classes take precedence on unmodified ones.
-     */
-    public final class WritableClassPoolImpl implements WritableClassPool {
-
-        private WritableClassPoolImpl() {
-        }
-
-        /**
-         * Add a class to the pool, if a class already exists, it is replaced.
-         *
-         * @param writer The class writer.
-         * @throws java.io.IOException
-         */
-        @Override
-        public void addClass(ClassWriter writer) {
-            Objects.requireNonNull(writer);
-            // Retrieve the className
-            ClassReader reader = newClassReader(writer.toByteArray());
-            String className = reader.getClassName();
-            String path;
-            if (className.endsWith("module-info")) {
-                // remove the module name contained in the class name
-                className = className.substring(className.indexOf("/") + 1);
-                path = "/" + moduleName + "/" + className;
-            } else {
-                path = toClassNamePath(className);
-            }
-
-            byte[] content = writer.toByteArray();
-            ModuleEntry res = ModuleEntry.create(path, content);
-            transformedClasses.put(className, res);
-        }
-
-        /**
-         * The class will be not added to the jimage file.
-         *
-         * @param className The class name to forget.
-         */
-        @Override
-        public void forgetClass(String className) {
-            Objects.requireNonNull(className);
-            // do we have a resource?
-            ModuleEntry res = transformedClasses.get(className);
-            if (res == null) {
-                res = inputClasses.get(className);
-                if (res == null) {
-                    throw new PluginException("Unknown class " + className);
-                }
-            }
-            String path = toClassNamePath(className);
-            forgetResources.add(path);
-            // Just in case it has been added.
-            transformedClasses.remove(className);
-        }
-
-        /**
-         * Get a transformed class.
-         *
-         * @param binaryName The java class binary name
-         * @return The ClassReader or null if the class is not found.
-         */
-        @Override
-        public ClassReader getClassReader(String binaryName) {
-            Objects.requireNonNull(binaryName);
-            ModuleEntry res = transformedClasses.get(binaryName);
-            ClassReader reader = null;
-            if (res != null) {
-                reader = getClassReader(res);
-            }
-            return reader;
-        }
-
-        /**
-         * Returns all the classes contained in the writable pool.
-         *
-         * @return The array of transformed classes.
-         */
-        @Override
-        public Collection<ModuleEntry> getClasses() {
-            List<ModuleEntry> classes = new ArrayList<>();
-            for (Entry<String, ModuleEntry> entry : transformedClasses.entrySet()) {
-                classes.add(entry.getValue());
-            }
-            return classes;
-        }
-
-        @Override
-        public ClassReader getClassReader(ModuleEntry res) {
-            return newClassReader(res.getBytes());
-        }
-    }
-
-    /**
-     * Contains the transformed resources. When the jimage file is generated,
-     * transformed resources take precedence on unmodified ones.
-     */
-    public final class WritableResourcePoolImpl implements WritableResourcePool {
-
-        private WritableResourcePoolImpl() {
-        }
-
-        /**
-         * Add a resource, if the resource exists, it is replaced.
-         *
-         * @param resFile The resource file to add.
-         */
-        @Override
-        public void addResourceFile(ResourceFile resFile) {
-            Objects.requireNonNull(resFile);
-            String path = toResourceNamePath(resFile.getPath());
-            ModuleEntry res = ModuleEntry.create(path, resFile.getContent());
-            transformedResources.put(resFile.getPath(), res);
-        }
-
-        /**
-         * The resource will be not added to the jimage file.
-         *
-         * @param resourceName
-         * @throws java.io.IOException
-         */
-        @Override
-        public void forgetResourceFile(String resourceName) {
-            Objects.requireNonNull(resourceName);
-            String path = toResourceNamePath(resourceName);
-            // do we have a resource?
-            ModuleEntry res = transformedResources.get(resourceName);
-            if (res == null) {
-                res = inputResources.get(resourceName);
-                if (res == null) {
-                    throw new PluginException("Unknown resource " + resourceName);
-                }
-            }
-            forgetResources.add(path);
-            // Just in case it has been added.
-            transformedResources.remove(resourceName);
-        }
-
-        /**
-         * Get a transformed resource.
-         *
-         * @param name The java resource name
-         * @return The Resource or null if the resource is not found.
-         */
-        @Override
-        public ResourceFile getResourceFile(String name) {
-            Objects.requireNonNull(name);
-            ModuleEntry res = transformedResources.get(name);
-            ResourceFile resFile = null;
-            if (res != null) {
-                resFile = getResourceFile(res);
-            }
-            return resFile;
-        }
-
-        /**
-         * Returns all the resources contained in the writable pool.
-         *
-         * @return The array of transformed classes.
-         */
-        @Override
-        public Collection<ModuleEntry> getResourceFiles() {
-            List<ModuleEntry> resources = new ArrayList<>();
-            for (Entry<String, ModuleEntry> entry : transformedResources.entrySet()) {
-                resources.add(entry.getValue());
-            }
-            return resources;
-        }
-
-        @Override
-        public ResourceFile getResourceFile(ModuleEntry res) {
-            return new ResourceFile(toJavaBinaryResourceName(res.getPath()),
-                    res.getBytes());
-        }
-    }
-
-    private final ModulePool jimageResources;
-    private final Map<String, ModuleEntry> inputClasses;
-    private final Map<String, ModuleEntry> inputResources;
-    private final Map<String, String> inputClassPackageMapping;
-    private final Map<String, String> inputOtherPackageMapping;
-
-    private final WritableClassPool transClassesPool
-            = new WritableClassPoolImpl();
-    private final WritableResourcePool transResourcesPool
-            = new WritableResourcePoolImpl();
-
-    private Sorter sorter;
-
-    private final Map<String, ModuleEntry> transformedClasses
-            =            new LinkedHashMap<>();
-    private final Map<String, ModuleEntry> transformedResources
-            =            new LinkedHashMap<>();
-    private final List<String> forgetResources = new ArrayList<>();
-    private final Map<String, String> newPackageMapping = new HashMap<>();
-
-    private final String moduleName;
-
-    private final ModuleDescriptor descriptor;
-    private final AsmPools pools;
-
-    /**
-     * A new Asm pool.
-     *
-     * @param inputResources The raw resources to build the pool from.
-     * @param moduleName The name of a module.
-     * @param pools The resource pools.
-     * @param descriptor The module descriptor.
-     */
-    AsmPoolImpl(ModulePool inputResources, String moduleName,
-            AsmPools pools,
-            ModuleDescriptor descriptor) {
-        Objects.requireNonNull(inputResources);
-        Objects.requireNonNull(moduleName);
-        Objects.requireNonNull(pools);
-        Objects.requireNonNull(descriptor);
-        this.jimageResources = inputResources;
-        this.moduleName = moduleName;
-        this.pools = pools;
-        this.descriptor = descriptor;
-        Map<String, ModuleEntry> classes = new LinkedHashMap<>();
-        Map<String, ModuleEntry> resources = new LinkedHashMap<>();
-        Map<String, String> packageClassToModule = new HashMap<>();
-        Map<String, String> packageOtherToModule = new HashMap<>();
-        inputResources.entries().forEach(res -> {
-            if (res.getPath().endsWith(".class")) {
-                classes.put(toJavaBinaryClassName(res.getPath()), res);
-            } else {
-                resources.put(toJavaBinaryResourceName(res.getPath()), res);
-            }
-            String[] split = ImageFileCreator.splitPath(res.getPath());
-            if (ImageFileCreator.isClassPackage(res.getPath())) {
-                packageClassToModule.put(split[1], res.getModule());
-            } else {
-                // Keep a map of other resources
-                // Same resource names such as META-INF/* should be handled with full path name.
-                if (!split[1].isEmpty()) {
-                    packageOtherToModule.put(split[1], res.getModule());
-                }
-            }
-        });
-        this.inputClasses = Collections.unmodifiableMap(classes);
-        this.inputResources = Collections.unmodifiableMap(resources);
-
-        this.inputClassPackageMapping = Collections.unmodifiableMap(packageClassToModule);
-        this.inputOtherPackageMapping = Collections.unmodifiableMap(packageOtherToModule);
-    }
-
-    @Override
-    public String getModuleName() {
-        return moduleName;
-    }
-
-    /**
-     * The writable pool used to store transformed resources.
-     *
-     * @return The writable pool.
-     */
-    @Override
-    public WritableClassPool getTransformedClasses() {
-        return transClassesPool;
-    }
-
-    /**
-     * The writable pool used to store transformed resource files.
-     *
-     * @return The writable pool.
-     */
-    @Override
-    public WritableResourcePool getTransformedResourceFiles() {
-        return transResourcesPool;
-    }
-
-    /**
-     * Set a sorter instance to sort all files. If no sorter is set, then input
-     * Resources will be added in the order they have been received followed by
-     * newly added resources.
-     *
-     * @param sorter
-     */
-    @Override
-    public void setSorter(Sorter sorter) {
-        this.sorter = sorter;
-    }
-
-    /**
-     * Returns the classes contained in the pool.
-     *
-     * @return The array of classes.
-     */
-    @Override
-    public Collection<ModuleEntry> getClasses() {
-        return inputClasses.values();
-    }
-
-    /**
-     * Returns the resources contained in the pool. Resources are all the file
-     * that are not classes (eg: properties file, binary files, ...)
-     *
-     * @return The array of classes.
-     */
-    @Override
-    public Collection<ModuleEntry> getResourceFiles() {
-        return inputResources.values();
-    }
-
-    /**
-     * Retrieves a resource based on the binary name. This name doesn't contain
-     * the module name.
-     * <b>NB:</b> When dealing with resources that have the same name in various
-     * modules (eg: META-INFO/*), you should use the <code>ResourcePool</code>
-     * referenced from this <code>AsmClassPool</code>.
-     *
-     * @param binaryName Name of a Java resource or null if the resource doesn't
-     * exist.
-     * @return
-     */
-    @Override
-    public ResourceFile getResourceFile(String binaryName) {
-        Objects.requireNonNull(binaryName);
-        ModuleEntry res = inputResources.get(binaryName);
-        ResourceFile resFile = null;
-        if (res != null) {
-            resFile = getResourceFile(res);
-        }
-        return resFile;
-    }
-
-    /**
-     * Retrieve a ClassReader from the pool.
-     *
-     * @param binaryName Class binary name
-     * @return A reader or null if the class is unknown
-     */
-    @Override
-    public ClassReader getClassReader(String binaryName) {
-        Objects.requireNonNull(binaryName);
-        ModuleEntry res = inputClasses.get(binaryName);
-        ClassReader reader = null;
-        if (res != null) {
-            reader = getClassReader(res);
-        }
-        return reader;
-    }
-
-    @Override
-    public ResourceFile getResourceFile(ModuleEntry res) {
-        return new ResourceFile(toJavaBinaryResourceName(res.getPath()),
-                res.getBytes());
-    }
-
-    @Override
-    public ClassReader getClassReader(ModuleEntry res) {
-        return newClassReader(res.getBytes());
-    }
-
-    /**
-     * Lookup the class in this pool and the required pools. NB: static module
-     * readability can be different at execution time.
-     *
-     * @param binaryName The class to lookup.
-     * @return The reader or null if not found
-     */
-    @Override
-    public ClassReader getClassReaderInDependencies(String binaryName) {
-        Objects.requireNonNull(binaryName);
-        ClassReader reader = getClassReader(binaryName);
-        if (reader == null) {
-            for (Requires requires : descriptor.requires()) {
-                AsmModulePool pool = pools.getModulePool(requires.name());
-                reader = pool.getExportedClassReader(moduleName, binaryName);
-                if (reader != null) {
-                    break;
-                }
-            }
-        }
-        return reader;
-    }
-
-    /**
-     * Lookup the class in the exported packages of this module. "public
-     * requires" modules are looked up. NB: static module readability can be
-     * different at execution time.
-     *
-     * @param callerModule Name of calling module.
-     * @param binaryName The class to lookup.
-     * @return The reader or null if not found
-     */
-    @Override
-    public ClassReader getExportedClassReader(String callerModule, String binaryName) {
-        Objects.requireNonNull(callerModule);
-        Objects.requireNonNull(binaryName);
-        boolean exported = false;
-        ClassReader clazz = null;
-        for (Exports e : descriptor.exports()) {
-            String pkg = e.source();
-            Set<String> targets = e.targets();
-            System.out.println("PKG " + pkg);
-            if (targets.isEmpty() || targets.contains(callerModule)) {
-                if (binaryName.startsWith(pkg)) {
-                    String className = binaryName.substring(pkg.length());
-                    System.out.println("CLASS " + className);
-                    exported = !className.contains(".");
-                }
-                if (exported) {
-                    break;
-                }
-            }
-        }
-        // public requires (re-export)
-        if (!exported) {
-            for (Requires requires : descriptor.requires()) {
-                if (requires.modifiers().contains(Modifier.PUBLIC)) {
-                    AsmModulePool pool = pools.getModulePool(requires.name());
-                    clazz = pool.getExportedClassReader(moduleName, binaryName);
-                    if (clazz != null) {
-                        break;
-                    }
-                }
-            }
-        } else {
-            clazz = getClassReader(binaryName);
-        }
-        return clazz;
-
-    }
-
-    @Override
-    public ModuleDescriptor getDescriptor() {
-        return descriptor;
-    }
-
-    /**
-     * To visit the set of ClassReaders.
-     *
-     * @param visitor The visitor.
-     */
-    @Override
-    public void visitClassReaders(ClassReaderVisitor visitor) {
-        Objects.requireNonNull(visitor);
-        for (ModuleEntry res : getClasses()) {
-            ClassReader reader = newClassReader(res.getBytes());
-            ClassWriter writer = visitor.visit(reader);
-            if (writer != null) {
-
-                getTransformedClasses().addClass(writer);
-            }
-        }
-    }
-
-    /**
-     * To visit the set of ClassReaders.
-     *
-     * @param visitor The visitor.
-     */
-    @Override
-    public void visitResourceFiles(ResourceFileVisitor visitor) {
-        Objects.requireNonNull(visitor);
-        for (ModuleEntry resource : getResourceFiles()) {
-            ResourceFile resFile
-                    = new ResourceFile(toJavaBinaryResourceName(resource.getPath()),
-                            resource.getBytes());
-            ResourceFile res = visitor.visit(resFile);
-            if (res != null) {
-                getTransformedResourceFiles().addResourceFile(res);
-            }
-        }
-    }
-
-    /**
-     * Returns the pool of all the resources (transformed and unmodified). The
-     * input resources are replaced by the transformed ones. If a sorter has
-     * been set, it is used to sort the returned resources.     *
-     */
-    @Override
-    public void fillOutputResources(ModulePool outputResources) {
-        List<String> added = new ArrayList<>();
-        // If the sorter is null, use the input order.
-        // New resources are added at the end
-        // First input classes that have not been removed
-        ModulePool output = new ModulePoolImpl(outputResources.getByteOrder(),
-                ((ModulePoolImpl)outputResources).getStringTable());
-        jimageResources.entries().forEach(inResource -> {
-            if (!forgetResources.contains(inResource.getPath())) {
-                ModuleEntry resource = inResource;
-                // Do we have a transformed class with the same name?
-                ModuleEntry res = transformedResources.
-                        get(toJavaBinaryResourceName(inResource.getPath()));
-                if (res != null) {
-                    resource = res;
-                } else {
-                    res = transformedClasses.
-                            get(toJavaBinaryClassName(inResource.getPath()));
-                    if (res != null) {
-                        resource = res;
-                    }
-                }
-                output.add(resource);
-                added.add(resource.getPath());
-            }
-        });
-        // Then new resources
-        for (Map.Entry<String, ModuleEntry> entry : transformedResources.entrySet()) {
-            ModuleEntry resource = entry.getValue();
-            if (!forgetResources.contains(resource.getPath())) {
-                if (!added.contains(resource.getPath())) {
-                    output.add(resource);
-                }
-            }
-        }
-        // And new classes
-        for (Map.Entry<String, ModuleEntry> entry : transformedClasses.entrySet()) {
-            ModuleEntry resource = entry.getValue();
-            if (!forgetResources.contains(resource.getPath())) {
-                if (!added.contains(resource.getPath())) {
-                    output.add(resource);
-                }
-            }
-        }
-
-        AsmPools.sort(outputResources, output, sorter);
-    }
-
-    /**
-     * Associate a package to this module, useful when adding new classes in new
-     * packages. WARNING: In order to properly handle new package and/or new
-     * module, module-info class must be added and/or updated.
-     *
-     * @param pkg The new package, following java binary syntax (/-separated
-     * path name).
-     * @throws PluginException If a mapping already exist for this package.
-     */
-    @Override
-    public void addPackage(String pkg) {
-        Objects.requireNonNull(pkg);
-        Objects.requireNonNull(moduleName);
-        pkg = pkg.replaceAll("/", ".");
-        String mod = newPackageMapping.get(pkg);
-        if (mod != null) {
-            throw new PluginException(mod + " module already contains package " + pkg);
-        }
-        newPackageMapping.put(pkg, moduleName);
-    }
-
-    @Override
-    public Set<String> getAllPackages() {
-        ModuleDescriptor desc = getDescriptor();
-        Set<String> packages = new HashSet<>();
-        for (String p : desc.conceals()) {
-            packages.add(p.replaceAll("\\.", "/"));
-        }
-        for (String p : newPackageMapping.keySet()) {
-            packages.add(p.replaceAll("\\.", "/"));
-        }
-        for (Exports ex : desc.exports()) {
-            packages.add(ex.source().replaceAll("\\.", "/"));
-        }
-        return packages;
-    }
-
-    private static ClassReader newClassReader(byte[] bytes) {
-        try {
-            ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
-            ClassReader reader = new ClassReader(stream);
-            return reader;
-        } catch (IOException ex) {
-            throw new UncheckedIOException(ex);
-        }
-    }
-
-    private static String toJavaBinaryClassName(String path) {
-        if (path.endsWith("module-info.class")) {
-            path = removeClassExtension(path);
-        } else {
-            path = removeModuleName(path);
-            path = removeClassExtension(path);
-        }
-        return path;
-    }
-
-    private static String toJavaBinaryResourceName(String path) {
-        if (!path.endsWith("module-info.class")) {
-            path = removeModuleName(path);
-        }
-        return path;
-    }
-
-    private static String removeClassExtension(String path) {
-        return path.substring(0, path.length() - ".class".length());
-    }
-
-    private static String removeModuleName(String path) {
-        path = path.substring(1);
-        return path.substring(path.indexOf("/") + 1, path.length());
-    }
-
-    private String toClassNamePath(String className) {
-        return toResourceNamePath(className) + ".class";
-    }
-
-    /**
-     * Entry point to manage resource<->module association.
-     */
-    private String toResourceNamePath(String resourceName) {
-        if (!resourceName.startsWith("/")) {
-            resourceName = "/" + resourceName;
-        }
-        String pkg = toPackage(resourceName);
-        String module = inputClassPackageMapping.get(pkg);
-        if (module == null) {
-            module = newPackageMapping.get(pkg);
-            if (module == null) {
-                module = inputOtherPackageMapping.get(pkg);
-                if (module == null) {
-                    throw new PluginException("No module for package" + pkg);
-                }
-            }
-        }
-        return "/" + module + resourceName;
-    }
-
-    private static String toPackage(String path) {
-        if (path.startsWith("/")) {
-            path = path.substring(1);
-        }
-        int i = path.lastIndexOf("/");
-        if (i == -1) {
-            // Default package...
-            return "";
-        }
-        return path.substring(0, i).replaceAll("/", ".");
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/asm/AsmPools.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,497 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.asm;
-
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleDescriptor.Exports;
-import java.lang.module.ModuleDescriptor.Requires;
-import static java.lang.module.ModuleDescriptor.Requires.Modifier.PUBLIC;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Set;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.tools.jlink.internal.ModulePoolImpl;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.Sorter;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.ModulePool;
-
-/**
- * A container for pools of ClassReader and other resource files. A pool of all
- * the resources or a pool for a given module can be retrieved
- */
-public final class AsmPools {
-
-    /**
-     * Sort the order in which the modules will be stored in the jimage file.
-     */
-    public interface ModuleSorter {
-
-        /**
-         * Sort the list of modules.
-         *
-         * @param modules The list of module names. The module will be stored in
-         * the jimage following this order.
-         * @return A list of module names that expresses the order in which the
-         * modules are stored in the jimage.
-         */
-        public List<String> sort(List<String> modules);
-    }
-
-    private class AsmGlobalPoolImpl implements AsmGlobalPool {
-
-        private Sorter sorter = null;
-
-        private class GlobalWritableClassPool implements WritableClassPool {
-
-            @Override
-            public void addClass(ClassWriter writer) {
-                visitFirstNonFailingPool((AsmModulePool pool) -> {
-                    pool.getTransformedClasses().addClass(writer);
-                });
-            }
-
-            @Override
-            public void forgetClass(String className) {
-                visitFirstNonFailingPool((AsmModulePool pool) -> {
-                    pool.getTransformedClasses().forgetClass(className);
-                });
-            }
-
-            @Override
-            public ClassReader getClassReader(String binaryName) {
-                return visitPools((AsmModulePool pool) -> {
-                    return pool.getTransformedClasses().getClassReader(binaryName);
-                });
-            }
-
-            @Override
-            public Collection<ModuleEntry> getClasses() {
-                List<ModuleEntry> all = new ArrayList<>();
-                visitAllPools((AsmModulePool pool) -> {
-                    for (ModuleEntry rf : pool.getTransformedClasses().getClasses()) {
-                        all.add(rf);
-                    }
-                });
-                return all;
-            }
-
-            @Override
-            public ClassReader getClassReader(ModuleEntry res) {
-                return visitPools((AsmModulePool pool) -> {
-                    return pool.getTransformedClasses().getClassReader(res);
-                });
-            }
-
-        }
-
-        private class GlobalWritableResourcePool implements WritableResourcePool {
-
-            @Override
-            public void addResourceFile(ResourceFile resFile) {
-                visitFirstNonFailingPool((AsmModulePool pool) -> {
-                    pool.getTransformedResourceFiles().addResourceFile(resFile);
-                });
-            }
-
-            @Override
-            public void forgetResourceFile(String resourceName) {
-                visitFirstNonFailingPool((AsmModulePool pool) -> {
-                    pool.getTransformedResourceFiles().forgetResourceFile(resourceName);
-                });
-            }
-
-            @Override
-            public ResourceFile getResourceFile(String name) {
-                return visitPools((AsmModulePool pool) -> {
-                    return pool.getTransformedResourceFiles().getResourceFile(name);
-                });
-            }
-
-            @Override
-            public Collection<ModuleEntry> getResourceFiles() {
-                List<ModuleEntry> all = new ArrayList<>();
-                visitAllPools((AsmModulePool pool) -> {
-                    for (ModuleEntry rf : pool.getTransformedResourceFiles().getResourceFiles()) {
-                        all.add(rf);
-                    }
-                });
-                return all;
-            }
-
-            @Override
-            public ResourceFile getResourceFile(ModuleEntry res) {
-                return visitPools((AsmModulePool pool) -> {
-                    return pool.getTransformedResourceFiles().getResourceFile(res);
-                });
-            }
-
-        }
-
-        @Override
-        public AsmPool.WritableClassPool getTransformedClasses() {
-            return new GlobalWritableClassPool();
-        }
-
-        @Override
-        public AsmPool.WritableResourcePool getTransformedResourceFiles() {
-            return new GlobalWritableResourcePool();
-        }
-
-        @Override
-        public void setSorter(AsmPool.Sorter sorter) {
-            this.sorter = sorter;
-        }
-
-        @Override
-        public Collection<ModuleEntry> getClasses() {
-            List<ModuleEntry> all = new ArrayList<>();
-            visitAllPools((AsmModulePool pool) -> {
-                for (ModuleEntry rf : pool.getClasses()) {
-                    all.add(rf);
-                }
-            });
-            return all;
-        }
-
-        @Override
-        public Collection<ModuleEntry> getResourceFiles() {
-            List<ModuleEntry> all = new ArrayList<>();
-            visitAllPools((AsmModulePool pool) -> {
-                for (ModuleEntry rf : pool.getResourceFiles()) {
-                    all.add(rf);
-                }
-            });
-            return all;
-        }
-
-        @Override
-        public AsmPool.ResourceFile getResourceFile(String binaryName) {
-            return visitPools((AsmModulePool pool) -> {
-                return pool.getResourceFile(binaryName);
-            });
-        }
-
-        @Override
-        public ClassReader getClassReader(String binaryName) {
-            return visitPoolsEx((AsmModulePool pool) -> {
-                return pool.getClassReader(binaryName);
-            });
-        }
-
-        @Override
-        public ResourceFile getResourceFile(ModuleEntry res) {
-            return visitPools((AsmModulePool pool) -> {
-                return pool.getResourceFile(res);
-            });
-        }
-
-        @Override
-        public ClassReader getClassReader(ModuleEntry res) {
-            return visitPoolsEx((AsmModulePool pool) -> {
-                return pool.getClassReader(res);
-            });
-        }
-
-        @Override
-        public void visitClassReaders(AsmPool.ClassReaderVisitor visitor) {
-            visitAllPoolsEx((AsmModulePool pool) -> {
-                pool.visitClassReaders(visitor);
-            });
-        }
-
-        @Override
-        public void visitResourceFiles(AsmPool.ResourceFileVisitor visitor) {
-            visitAllPoolsEx((AsmModulePool pool) -> {
-                pool.visitResourceFiles(visitor);
-            });
-        }
-
-        @Override
-        public void fillOutputResources(ModulePool outputResources) {
-            AsmPools.this.fillOutputResources(outputResources);
-        }
-
-        @Override
-        public void addPackageModuleMapping(String pkg, String module) {
-            AsmModulePool p = pools.get(module);
-            if (p == null) {
-                throw new PluginException("Unknown module " + module);
-            }
-            p.addPackage(pkg);
-        }
-
-        @Override
-        public Set<String> getAccessiblePackages(String module) {
-            AsmModulePool p = pools.get(module);
-            if (p == null) {
-                return null;
-            }
-            ModuleDescriptor desc = p.getDescriptor();
-            Set<String> packages = new HashSet<>();
-            packages.addAll(p.getAllPackages());
-
-            // Retrieve direct dependencies and indirect ones (public)
-            Set<String> modules = new HashSet<>();
-            for (Requires req : desc.requires()) {
-                modules.add(req.name());
-                addAllRequirePublicModules(req.name(), modules);
-            }
-            // Add exported packages of readable modules
-            for (String readable : modules) {
-                AsmModulePool mp = pools.get(readable);
-                if (mp != null) {
-                    for (Exports e : mp.getDescriptor().exports()) {
-                        // exported to all or to the targeted module
-                        if (e.targets().isEmpty() || e.targets().contains(module)) {
-                            packages.add(e.source().replaceAll("\\.", "/"));
-                        }
-                    }
-
-                }
-            }
-            return packages;
-        }
-
-        private void addAllRequirePublicModules(String module, Set<String> modules) {
-            AsmModulePool p = pools.get(module);
-            if (p != null) {
-                for (Requires req : p.getDescriptor().requires()) {
-                    if (req.modifiers().contains(PUBLIC)) {
-                        modules.add(req.name());
-                        addAllRequirePublicModules(req.name(), modules);
-                    }
-                }
-            }
-        }
-
-    }
-
-    private interface VoidPoolVisitor {
-
-        void visit(AsmModulePool pool);
-    }
-
-    private interface VoidPoolVisitorEx {
-
-        void visit(AsmModulePool pool);
-    }
-
-    private interface RetPoolVisitor<P> {
-
-        P visit(AsmModulePool pool);
-    }
-
-    private final Map<String, AsmModulePool> pools = new LinkedHashMap<>();
-    private final AsmModulePool[] poolsArray;
-    private final AsmGlobalPoolImpl global;
-
-    private ModuleSorter moduleSorter;
-
-    /**
-     * A new Asm pools.
-     *
-     * @param inputResources The raw resources to build the pool from.
-     */
-    public AsmPools(ModulePool inputResources) {
-        Objects.requireNonNull(inputResources);
-        Map<String, ModulePool> resPools = new LinkedHashMap<>();
-        Map<String, ModuleDescriptor> descriptors = new HashMap<>();
-        inputResources.entries().forEach(res -> {
-            ModulePool p = resPools.get(res.getModule());
-            if (p == null) {
-                p = new ModulePoolImpl(inputResources.getByteOrder(),
-                        ((ModulePoolImpl)inputResources).getStringTable());
-                resPools.put(res.getModule(), p);
-            }
-            if (res.getPath().endsWith("module-info.class")) {
-                ByteBuffer bb = ByteBuffer.wrap(res.getBytes());
-                ModuleDescriptor descriptor = ModuleDescriptor.read(bb);
-                descriptors.put(res.getModule(), descriptor);
-            }
-            p.add(res);
-        });
-        poolsArray = new AsmModulePool[resPools.size()];
-        int i = 0;
-
-        for (Entry<String, ModulePool> entry : resPools.entrySet()) {
-            ModuleDescriptor descriptor = descriptors.get(entry.getKey());
-            if (descriptor == null) {
-                throw new PluginException("module-info.class not found for " + entry.getKey() + " module");
-            }
-            AsmModulePool p = new AsmPoolImpl(entry.getValue(),
-                    entry.getKey(), this, descriptor);
-            pools.put(entry.getKey(), p);
-            poolsArray[i] = p;
-            i += 1;
-        }
-        global = new AsmGlobalPoolImpl();
-    }
-
-    /**
-     * The pool containing all classes and other resources.
-     *
-     * @return The global pool
-     */
-    public AsmGlobalPool getGlobalPool() {
-        return global;
-    }
-
-    /**
-     * A pool for a given module
-     *
-     * @param name The module name
-     * @return The pool that contains content of the passed module or null if
-     * the module doesn't exist.
-     */
-    public AsmModulePool getModulePool(String name) {
-        Objects.requireNonNull(name);
-        return pools.get(name);
-    }
-
-    /**
-     * The array of module pools.
-     * @return The module pool array.
-     */
-    public AsmModulePool[] getModulePools() {
-        return poolsArray.clone();
-    }
-
-    /**
-     * Set a module sorter. Sorter is used when computing the output resources.
-     *
-     * @param moduleSorter The module sorter
-     */
-    public void setModuleSorter(ModuleSorter moduleSorter) {
-        Objects.requireNonNull(moduleSorter);
-        this.moduleSorter = moduleSorter;
-    }
-
-    /**
-     * Returns the pool of all the resources (transformed and unmodified). The
-     * input resources are replaced by the transformed ones. If a sorter has
-     * been set, it is used to sort in modules.
-     *
-     * @param outputResources The pool used to fill the jimage.
-     */
-    public void fillOutputResources(ModulePool outputResources) {
-        // First sort modules
-        List<String> modules = new ArrayList<>();
-        for (String k : pools.keySet()) {
-            modules.add(k);
-        }
-        if (moduleSorter != null) {
-            modules = moduleSorter.sort(modules);
-        }
-        ModulePool output = new ModulePoolImpl(outputResources.getByteOrder(),
-                ((ModulePoolImpl)outputResources).getStringTable());
-        for (String mn : modules) {
-            AsmPool pool = pools.get(mn);
-            pool.fillOutputResources(output);
-        }
-        sort(outputResources, output, global.sorter);
-    }
-
-    static void sort(ModulePool outputResources,
-            ModulePool transientOutput, Sorter sorter) {
-        if (sorter != null) {
-            List<String> order = sorter.sort(transientOutput);
-            for (String s : order) {
-                outputResources.add(transientOutput.findEntry(s).get());
-            }
-        } else {
-            transientOutput.entries().forEach(res-> {
-                outputResources.add(res);
-            });
-        }
-    }
-
-    private void visitFirstNonFailingPool(VoidPoolVisitorEx pv) {
-        boolean found = false;
-        for (Entry<String, AsmModulePool> entry : pools.entrySet()) {
-            try {
-                pv.visit(entry.getValue());
-                found = true;
-                break;
-            } catch (Exception ex) {
-                // XXX OK, try  another one.
-            }
-        }
-        if (!found) {
-            throw new PluginException("No module found");
-        }
-    }
-
-    private void visitAllPools(VoidPoolVisitor pv) {
-        for (Entry<String, AsmModulePool> entry : pools.entrySet()) {
-            pv.visit(entry.getValue());
-        }
-    }
-
-    private void visitAllPoolsEx(VoidPoolVisitorEx pv) {
-        for (Entry<String, AsmModulePool> entry : pools.entrySet()) {
-            pv.visit(entry.getValue());
-        }
-    }
-
-    private <P> P visitPoolsEx(RetPoolVisitor<P> pv) {
-        P p = null;
-        for (Entry<String, AsmModulePool> entry : pools.entrySet()) {
-            try {
-                p = pv.visit(entry.getValue());
-                if (p != null) {
-                    break;
-                }
-            } catch (Exception ex) {
-                // XXX OK, try  another one.
-            }
-        }
-        return p;
-    }
-
-    private <P> P visitPools(RetPoolVisitor<P> pv) {
-        P p = null;
-        for (Entry<String, AsmModulePool> entry : pools.entrySet()) {
-            try {
-                p = pv.visit(entry.getValue());
-                if (p != null) {
-                    break;
-                }
-            } catch (Exception ex) {
-                // XXX OK, try  another one.
-            }
-        }
-        return p;
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/ControlFlow.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,516 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.optim;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Set;
-import java.util.Stack;
-import java.util.TreeSet;
-import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
-import jdk.internal.org.objectweb.asm.tree.MethodNode;
-import jdk.internal.org.objectweb.asm.tree.analysis.Analyzer;
-import jdk.internal.org.objectweb.asm.tree.analysis.AnalyzerException;
-import jdk.internal.org.objectweb.asm.tree.analysis.BasicInterpreter;
-import jdk.internal.org.objectweb.asm.tree.analysis.BasicValue;
-
-/**
- * Split Java method onto a control flow.
- *
- */
-public final class ControlFlow {
-
-    /**
-     * A block of control
-     */
-    public static final class Block implements Comparable<Block> {
-
-        private final InstructionNode firstInstruction;
-        private final List<InstructionNode> instr = new ArrayList<>();
-        private final List<Block> reachable = new ArrayList<>();
-        private final List<Block> exceptionHandlers = new ArrayList<>();
-        private boolean isExceptionHandler;
-
-        private Block(InstructionNode firstInstruction) {
-            this.firstInstruction = firstInstruction;
-        }
-
-        @Override
-        public boolean equals(Object other) {
-            if (!(other instanceof Block)) {
-                return false;
-            }
-            Block b = (Block) other;
-            return firstInstruction.equals(b.firstInstruction);
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hashCode(this.firstInstruction);
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder builder = new StringBuilder();
-            for (InstructionNode in : instr) {
-                builder.append(in).append(" ");
-            }
-            builder.append(" reachables: ");
-            for (Block r : reachable) {
-                builder.append(r.getFirstInstruction()).append(" ");
-            }
-            builder.append(" exception handlers: ");
-            for (Block r : exceptionHandlers) {
-                builder.append(r.getFirstInstruction()).append(" ");
-            }
-
-            return "block[" + getFirstInstruction() + "],ex:"
-                    + isExceptionHandler + ",  " + builder.toString();
-        }
-
-        /**
-         * @return the firstInstruction
-         */
-        public InstructionNode getFirstInstruction() {
-            return firstInstruction;
-        }
-
-        /**
-         * @return the instr
-         */
-        public List<InstructionNode> getInstructions() {
-            return Collections.unmodifiableList(instr);
-        }
-
-        /**
-         * @return the reachable
-         */
-        public List<Block> getReachableBlocks() {
-            return Collections.unmodifiableList(reachable);
-        }
-
-        /**
-         * @return the exceptionHandlers
-         */
-        public List<Block> getExceptionHandlerBlocks() {
-            return Collections.unmodifiableList(exceptionHandlers);
-        }
-
-        @Override
-        public int compareTo(Block t) {
-            return this.firstInstruction.index - t.firstInstruction.index;
-        }
-
-        public boolean isExceptionHandler() {
-            return isExceptionHandler;
-        }
-
-    }
-
-    private class ClosureBuilder {
-
-        private final Block root;
-
-        private ClosureBuilder(Block root) {
-            Objects.requireNonNull(root);
-            this.root = root;
-        }
-
-        private Set<Block> build() {
-            Set<Block> allReachable = new TreeSet<>();
-            addAll(root, allReachable);
-            // filter out the reachable from outside this graph
-            Iterator<Block> it = allReachable.iterator();
-            Set<Block> toExclude = new HashSet<>();
-            while (it.hasNext()) {
-                Block b = it.next();
-                for (Block ref : blocks) {
-                    if (!allReachable.contains(ref) && ref.reachable.contains(b)) {
-                        addAll(b, toExclude);
-                        break;
-                    }
-                }
-            }
-            //System.err.println("TO EXCLUDE:\n " + toExclude);
-            allReachable.removeAll(toExclude);
-            //System.err.println("CLOSURE:\n " + allReachable);
-            return Collections.unmodifiableSet(allReachable);
-        }
-
-        // Compute the set of blocks reachable from the current block
-        private void addAll(Block current, Set<Block> closure) {
-            Objects.requireNonNull(current);
-            closure.add(current);
-            for (Block ex : current.exceptionHandlers) {
-                Objects.requireNonNull(ex);
-                if (!closure.contains(ex)) {
-                    addAll(ex, closure);
-                }
-            }
-            for (Block r : current.reachable) {
-                Objects.requireNonNull(r);
-                if (!closure.contains(r)) {
-                    addAll(r, closure);
-                }
-            }
-
-        }
-    }
-
-    /**
-     * An instruction
-     */
-    public static final class InstructionNode {
-
-        private final int index;
-        private final List<InstructionNode> next = new ArrayList<>();
-        private final AbstractInsnNode instr;
-
-        private InstructionNode(int index, AbstractInsnNode instr) {
-            this.index = index;
-            this.instr = instr;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof InstructionNode)) {
-                return false;
-            }
-            final InstructionNode other = (InstructionNode) obj;
-            return this.getIndex() == other.getIndex();
-        }
-
-        @Override
-        public int hashCode() {
-            return this.getIndex();
-        }
-
-        @Override
-        public String toString() {
-            return getIndex() + "(" + (getInstr().getOpcode() == - 1 ? -1
-                    : Integer.toHexString(getInstr().getOpcode())) + ")";
-        }
-
-        /**
-         * @return the index
-         */
-        public int getIndex() {
-            return index;
-        }
-
-        /**
-         * @return the instr
-         */
-        public AbstractInsnNode getInstr() {
-            return instr;
-        }
-
-    }
-
-    private final Map<Integer, Block> allBlocks;
-    private final List<Block> blocks = new ArrayList<>();
-
-    private ControlFlow(Map<Integer, Block> allBlocks) {
-        this.allBlocks = allBlocks;
-        for (Block b : allBlocks.values()) {
-            blocks.add(b);
-        }
-        Collections.sort(blocks);
-    }
-
-    public List<Block> getBlocks() {
-
-        return Collections.unmodifiableList(blocks);
-    }
-
-    public Block getBlock(int firstInstr) {
-        return allBlocks.get(firstInstr);
-    }
-
-    public static ControlFlow createControlFlow(String owner,
-            MethodNode method) throws Exception {
-
-        BlockBuilder bb = new BlockBuilder(owner, method);
-        return bb.build();
-    }
-
-    /**
-     * Return the set of blocks that are only reachable from this block For
-     * example, if b is an Exception handler, returns all the blocks reachable
-     * only from this handler
-     *
-     * @param b
-     * @return
-     */
-    public Set<Block> getClosure(Block b) {
-        return new ClosureBuilder(b).build();
-    }
-
-    private static final class BlockBuilder {
-
-        private InstructionNode root;
-        private final Map<Integer, InstructionNode> instructions = new HashMap<>();
-        private final Map<Integer, List<Integer>> handlers = new HashMap<>();
-        private final Map<Integer, Block> allBlocks = new HashMap<>();
-
-        private final String owner;
-        private final MethodNode method;
-
-        private BlockBuilder(String owner, MethodNode method) {
-            this.owner = owner;
-            this.method = method;
-        }
-
-        private void analyze() throws AnalyzerException {
-            Analyzer<BasicValue> analyzer = new Analyzer<BasicValue>(new BasicInterpreter()) {
-
-                @Override
-                protected boolean newControlFlowExceptionEdge(int insn,
-                        int successor) {
-                    List<Integer> lst = handlers.get(successor);
-                    if (lst == null) {
-                        lst = new ArrayList<>();
-                        handlers.put(successor, lst);
-                    }
-                    lst.add(insn);
-                    return true;
-                }
-
-                @Override
-                protected void newControlFlowEdge(int from,
-                        int to) {
-                    if (root == null) {
-                        root = new InstructionNode(from, method.instructions.get(from));
-                        instructions.put(from, root);
-                    }
-                    InstructionNode fromNode = instructions.get(from);
-                    if (fromNode == null) {
-                        fromNode = new InstructionNode(from, method.instructions.get(from));
-                        instructions.put(from, fromNode);
-                    }
-                    InstructionNode toNode = instructions.get(to);
-                    if (toNode == null) {
-                        toNode = new InstructionNode(to, method.instructions.get(to));
-                        instructions.put(to, toNode);
-                    }
-                    if (!fromNode.next.contains(toNode)) {
-                        fromNode.next.add(toNode);
-                    }
-
-                }
-            };
-            analyzer.analyze(owner, method);
-        }
-
-        private Block newBlock(InstructionNode firstInstruction) {
-            Objects.requireNonNull(firstInstruction);
-            Block b = new Block(firstInstruction);
-            allBlocks.put(firstInstruction.getIndex(), b);
-            return b;
-        }
-
-        private ControlFlow build() throws AnalyzerException {
-            analyze();
-            buildBlocks();
-            return new ControlFlow(allBlocks);
-        }
-
-        private void buildBlocks() {
-            List<Block> reachableBlocks = new ArrayList<>();
-            createBlocks(root, reachableBlocks);
-            List<Block> handlersBlocks = new ArrayList<>();
-            for (Entry<Integer, List<Integer>> entry : handlers.entrySet()) {
-                InstructionNode node = instructions.get(entry.getKey());
-                createBlocks(node, handlersBlocks);
-            }
-
-            // attach handler to try blocks
-            for (Entry<Integer, List<Integer>> entry : handlers.entrySet()) {
-                Block handlerBlock = allBlocks.get(entry.getKey());
-                handlerBlock.isExceptionHandler = true;
-                int startTry = entry.getValue().get(0);
-                Block tryBlock = allBlocks.get(startTry);
-                if (tryBlock == null) {
-                    // Need to find the block that contains the instruction and
-                    // make a new block
-                    Block split = null;
-                    for (Block b : allBlocks.values()) {
-                        Iterator<InstructionNode> it = b.instr.iterator();
-                        while (it.hasNext()) {
-                            InstructionNode in = it.next();
-                            if (split == null) {
-                                if (in.index == startTry) {
-                                    split = newBlock(in);
-                                    split.instr.add(in);
-                                    it.remove();
-                                }
-                            } else {
-                                split.instr.add(in);
-                                it.remove();
-                            }
-                        }
-                        if (split != null) {
-                            Iterator<Block> reachables = b.reachable.iterator();
-                            while (reachables.hasNext()) {
-                                Block r = reachables.next();
-                                split.reachable.add(r);
-                                reachables.remove();
-                            }
-                            b.reachable.add(split);
-                            break;
-                        }
-                    }
-                    if (split == null) {
-                        throw new RuntimeException("No try block for handler " + handlerBlock);
-                    }
-                    split.exceptionHandlers.add(handlerBlock);
-                } else {
-                    tryBlock.exceptionHandlers.add(handlerBlock);
-                }
-            }
-
-//            System.err.println("ALL BLOCKS FOUND");
-//            Iterator<Entry<Integer, Block>> blockIt0 = allBlocks.entrySet().iterator();
-//            while (blockIt0.hasNext()) {
-//                Block b = blockIt0.next().getValue();
-//                System.err.println(b);
-//            }
-            //compute real exception blocks, if an instruction is in another block, stop.
-            Iterator<Entry<Integer, Block>> blockIt = allBlocks.entrySet().iterator();
-            while (blockIt.hasNext()) {
-                Block b = blockIt.next().getValue();
-                Iterator<InstructionNode> in = b.instr.iterator();
-                boolean found = false;
-                while (in.hasNext()) {
-                    int i = in.next().getIndex();
-                    if (found) {
-                        in.remove();
-                    } else {
-                        if (startsWith(b, i, allBlocks.values())) {
-                            // Move it to reachable
-                            Block r = allBlocks.get(i);
-                            b.reachable.add(r);
-                            found = true;
-                            in.remove();
-                        } else {
-                        }
-                    }
-                }
-            }
-
-//            System.err.println("Reduced blocks");
-//            Iterator<Entry<Integer, Block>> blockIt1 = allBlocks.entrySet().iterator();
-//            while (blockIt1.hasNext()) {
-//                Block b = blockIt1.next().getValue();
-//                System.err.println(b);
-//            }
-        }
-
-        private boolean startsWith(Block block, int index, Collection<Block> reachableBlocks) {
-            for (Block b : reachableBlocks) {
-                if (b != block && !b.instr.isEmpty() && b.instr.get(0).getIndex() == index) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        private static final class StackItem {
-
-            private final InstructionNode instr;
-            private final Block currentBlock;
-
-            private StackItem(InstructionNode instr, Block currentBlock) {
-                Objects.requireNonNull(instr);
-                Objects.requireNonNull(currentBlock);
-                this.instr = instr;
-                this.currentBlock = currentBlock;
-            }
-        }
-
-        /**
-         * This algorithm can't be recursive, possibly too much instructions in
-         * methods.
-         */
-        private void createBlocks(InstructionNode root, List<Block> blocks) {
-            final Stack<StackItem> stack = new Stack<>();
-            stack.push(new StackItem(root, newBlock(root)));
-            while (!stack.isEmpty()) {
-                final StackItem item = stack.pop();
-                final Block currentBlock = item.currentBlock;
-                final InstructionNode current = item.instr;
-                // loop
-                if (currentBlock.instr.contains(current)) {
-                    currentBlock.reachable.add(currentBlock);
-                    continue;
-                }
-                Block existing = allBlocks.get(current.index);
-                if (existing != null && existing != currentBlock) {
-                    currentBlock.reachable.add(existing);
-                    continue;
-                }
-                int previous = currentBlock.instr.size() > 0
-                        ? currentBlock.instr.get(currentBlock.instr.size() - 1).getIndex() : -1;
-                if (previous == -1 || current.getIndex() == previous + 1) {
-                    currentBlock.instr.add(current);
-                    if (current.next.isEmpty()) {
-                        blocks.add(currentBlock);
-                    } else {
-                        if (current.next.size() > 1) {
-                            blocks.add(currentBlock);
-                            for (InstructionNode n : current.next) {
-                                Block loop = allBlocks.get(n.index);
-                                if (loop == null) {
-                                    Block newBlock = newBlock(n);
-                                    currentBlock.reachable.add(newBlock);
-                                    stack.push(new StackItem(n, newBlock));
-                                } else { // loop
-                                    currentBlock.reachable.add(loop);
-                                }
-                            }
-                        } else {
-                            stack.push(new StackItem(current.next.get(0),
-                                    currentBlock));
-                        }
-                    }
-                } else { // to a new block...
-                    // Do nothing...
-                    blocks.add(currentBlock);
-                    Block newBlock = newBlock(current);
-                    currentBlock.reachable.add(newBlock);
-                    stack.push(new StackItem(current, newBlock));
-                }
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/ForNameFolding.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.optim;
-
-import java.io.IOException;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.function.Consumer;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.internal.org.objectweb.asm.tree.ClassNode;
-import jdk.internal.org.objectweb.asm.tree.MethodNode;
-import jdk.tools.jlink.internal.plugins.OptimizationPlugin.MethodOptimizer;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.optim.ControlFlow.Block;
-import jdk.tools.jlink.internal.plugins.optim.ReflectionOptimizer.Data;
-import jdk.tools.jlink.internal.plugins.optim.ReflectionOptimizer.TypeResolver;
-
-
-/**
- * MethodOptimizer that removes Class.forName when possible.
- * WARNING: This code is experimental.
- * TODO: Need to check that the type is accessible prior to replace with a constant.
- */
-public class ForNameFolding implements MethodOptimizer {
-
-    private int numNotReplaced;
-    private int numReplacement;
-    private int numRemovedHandlers;
-    private int instructionsRemoved;
-
-    private Consumer<String> logger;
-
-    @Override
-    public boolean optimize(Consumer<String> logger, AsmPools pools,
-            AsmModulePool modulePool,
-            ClassNode cn, MethodNode m, TypeResolver resolver) throws Exception {
-        this.logger = logger;
-        Data data = ReflectionOptimizer.replaceWithClassConstant(cn, m, createResolver(resolver));
-        instructionsRemoved += data.removedInstructions();
-        numRemovedHandlers += data.removedHandlers().size();
-        for (Entry<String, Set<Block>> entry : data.removedHandlers().entrySet()) {
-            logRemoval(cn.name + "." + m.name + "removed block for " + entry.getKey()
-                    + " : " + entry.getValue());
-        }
-        return data.removedInstructions() > 0;
-    }
-
-    public TypeResolver createResolver(TypeResolver resolver) {
-        return (ClassNode cn, MethodNode mn, String type) -> {
-            ClassReader reader = resolver.resolve(cn, mn, type);
-            if (reader == null) {
-                logNotReplaced(type);
-            } else {
-                logReplaced(type);
-            }
-            return reader;
-        };
-    }
-
-    private void logReplaced(String type) {
-        numReplacement += 1;
-    }
-
-    private void logNotReplaced(String type) {
-        numNotReplaced += 1;
-        if (logger != null) {
-            logger.accept(type + " not resolved");
-        }
-    }
-
-    private void logRemoval(String content) {
-        numRemovedHandlers += 1;
-        if (logger != null) {
-            logger.accept(content);
-        }
-    }
-
-    @Override
-    public void close() throws IOException {
-        if (logger != null) {
-            logger.accept("Class.forName Folding results:\n " + numReplacement
-                    + " removed reflection. " + numRemovedHandlers
-                    + " removed exception handlers."
-                    + numNotReplaced + " types unknown. "
-                    + instructionsRemoved + " instructions removed\n");
-        }
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/ReflectionOptimizer.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.optim;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.Type;
-import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
-import jdk.internal.org.objectweb.asm.tree.ClassNode;
-import jdk.internal.org.objectweb.asm.tree.LabelNode;
-import jdk.internal.org.objectweb.asm.tree.LdcInsnNode;
-import jdk.internal.org.objectweb.asm.tree.LineNumberNode;
-import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
-import jdk.internal.org.objectweb.asm.tree.MethodNode;
-import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
-import jdk.tools.jlink.internal.plugins.optim.ControlFlow.Block;
-
-/**
- * Implement the reflection optimization.
- */
-public class ReflectionOptimizer {
-
-    public static class Data {
-
-        private int removedInstructions;
-        private final Map<String, Set<Block>> removedHandlers = new HashMap<>();
-
-        private Data() {
-        }
-
-        public int removedInstructions() {
-            return removedInstructions;
-        }
-
-        public Map<String, Set<Block>> removedHandlers() {
-            return Collections.unmodifiableMap(removedHandlers);
-        }
-    }
-
-    public interface TypeResolver {
-
-        public ClassReader resolve(ClassNode cn, MethodNode m, String type);
-    }
-
-    public static Data replaceWithClassConstant(ClassNode cn, MethodNode m,
-            TypeResolver cch)
-            throws Exception {
-        Iterator<AbstractInsnNode> it = m.instructions.iterator();
-        LdcInsnNode insNode = null;
-        Map<LdcInsnNode, LdcInsnNode> replacement = new IdentityHashMap<>();
-        Data data = new Data();
-        while (it.hasNext()) {
-            AbstractInsnNode n = it.next();
-            if (n instanceof LdcInsnNode) {
-                LdcInsnNode ldc = (LdcInsnNode) n;
-                if (ldc.cst instanceof String) {
-                    insNode = ldc;
-                }
-            } else {
-                if (n instanceof MethodInsnNode && insNode != null) {
-                    MethodInsnNode met = (MethodInsnNode) n;
-                    if (met.name.equals("forName")
-                            && met.owner.equals("java/lang/Class")
-                            && met.desc.equals("(Ljava/lang/String;)Ljava/lang/Class;")) {
-                        // Can we load the type?
-                        Type type = null;
-                        String binaryName = insNode.cst.toString().replaceAll("\\.", "/");
-                        String unaryClassName = binaryName;
-                        int arrayIndex = binaryName.lastIndexOf("[");
-                        if (arrayIndex >= 0) {
-                            int objIndex = unaryClassName.indexOf("L");
-                            if (objIndex >= 0) {
-                                unaryClassName = unaryClassName.substring(objIndex + 1);
-                                unaryClassName = unaryClassName.substring(0,
-                                        unaryClassName.length() - 1);
-                            } else {
-                                //primitive, this is just fine.
-                                type = Type.getObjectType(binaryName);
-                            }
-                        }
-                        if (type == null) {
-                            if (cch.resolve(cn, m, unaryClassName) != null) {
-                                type = Type.getObjectType(binaryName);
-                            }
-                        }
-                        if (type != null) {
-                            replacement.put(insNode, new LdcInsnNode(type));
-                            it.remove();
-                            data.removedInstructions += 1;
-                        }
-                    } else {
-                        insNode = null;
-                    }
-                    // Virtual node, not taken into account
-                } else if (!(n instanceof LabelNode) && !(n instanceof LineNumberNode)) {
-                    insNode = null;
-                }
-            }
-        }
-        for (Map.Entry<LdcInsnNode, LdcInsnNode> entry : replacement.entrySet()) {
-            m.instructions.set(entry.getKey(), entry.getValue());
-        }
-        if (!replacement.isEmpty()) {
-            String[] types = {"java/lang/ClassNotFoundException"};
-            data.removedInstructions += deleteExceptionHandlers(cch, data, cn, m, types);
-
-        }
-        return data;
-    }
-
-    private static int deleteExceptionHandlers(TypeResolver cch, Data data,
-            ClassNode cn, MethodNode m, String[] exTypes)
-            throws Exception {
-        int instructionsRemoved = 0;
-        for (String ex : exTypes) {
-            ControlFlow f = ControlFlow.createControlFlow(cn.name, m);
-            List<Integer> removed = new ArrayList<>();
-            Set<ControlFlow.Block> blocksToRemove = new TreeSet<>();
-            Iterator<TryCatchBlockNode> it = m.tryCatchBlocks.iterator();
-            List<TryCatchBlockNode> tcbToRemove = new ArrayList<>();
-            while (it.hasNext()) {
-                TryCatchBlockNode bn = it.next();
-                if (bn.type == null
-                        || !bn.type.equals(ex) // An empty block
-                        || tcbToRemove.contains(bn)) {
-                    continue;
-                }
-                // Check that the handler is still required
-                if (!Utils.canThrowCheckedException(cch, cn, m, bn)) {
-                    // try to suppress it.
-                    int block = m.instructions.indexOf(bn.handler);
-                    ControlFlow.Block blockHandler = f.getBlock(block);
-                    if (blockHandler == null) {
-                        if (removed.contains(block)) {
-                            continue;
-                        } else {
-                            throw new Exception(cn.name
-                                    + ", no block for handler " + block);
-                        }
-                    }
-                    tcbToRemove.add(bn);
-                    // Don't delete block if shared (eg: ClassNotFoundException | NoSuchMethodException |
-                    Iterator<TryCatchBlockNode> it2 = m.tryCatchBlocks.iterator();
-                    boolean cont = false;
-                    while (it2.hasNext()) {
-                        TryCatchBlockNode bn2 = it2.next();
-                        if (bn2 != bn) {
-                            if (bn2.start.equals(bn.start)) {
-                                cont = true;
-                            }
-                        }
-                    }
-                    if (cont) {
-                        continue;
-                    }
-                    // An handler is a root, blocks that are only reachable by it
-                    // can be removed.
-                    Set<ControlFlow.Block> blocks = f.getClosure(blockHandler);
-                    StringBuilder sb = new StringBuilder();
-                    for (ControlFlow.Block b : blocks) {
-                        sb.append(b).append("\n");
-                        removed.add(b.getFirstInstruction().getIndex());
-                        // Remove Exception handler if the associated block has been removed
-                        for (TryCatchBlockNode tcb : m.tryCatchBlocks) {
-                            if (tcb != bn) {
-                                // An exception handler removed as a side effect.
-                                if (b.isExceptionHandler()
-                                        && b.getFirstInstruction().getInstr() == tcb.handler) {
-                                    tcbToRemove.add(tcb);
-                                }
-                            }
-                        }
-                    }
-                    blocksToRemove.addAll(blocks);
-
-                    data.removedHandlers.put(ex, blocks);
-
-                }
-            }
-
-            m.tryCatchBlocks.removeAll(tcbToRemove);
-
-            if (!blocksToRemove.isEmpty()) {
-                for (ControlFlow.Block b : blocksToRemove) {
-                    for (ControlFlow.InstructionNode ins : b.getInstructions()) {
-                        if (ins.getInstr().getOpcode() > 0) {
-                            instructionsRemoved += 1;
-                        }
-                    }
-                }
-                Utils.suppressBlocks(m, blocksToRemove);
-            }
-        }
-        return instructionsRemoved;
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/optim/Utils.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.tools.jlink.internal.plugins.optim;
-
-import java.util.Iterator;
-import java.util.Set;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
-import jdk.internal.org.objectweb.asm.tree.ClassNode;
-import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
-import jdk.internal.org.objectweb.asm.tree.MethodNode;
-import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
-
-/**
- * Optimization utility methods
- */
-public class Utils {
-
-    public static boolean canThrowCheckedException(ReflectionOptimizer.TypeResolver cch,
-            ClassNode classNode, MethodNode m, TryCatchBlockNode bn) throws Exception {
-        int istart = m.instructions.indexOf(bn.start);
-        int iend = m.instructions.indexOf(bn.end);
-        for (int i = istart; i < iend - 1; i++) {
-            AbstractInsnNode instr = m.instructions.get(i);
-            if (instr instanceof MethodInsnNode) {
-                MethodInsnNode meth = (MethodInsnNode) instr;
-                ClassReader reader = cch.resolve(classNode, m, meth.owner);
-                if (reader != null) {
-                    ClassNode cn = new ClassNode();
-                    reader.accept(cn, ClassReader.EXPAND_FRAMES);
-                    for (MethodNode method : cn.methods) {
-                        if (method.name.equals(meth.name)) {
-                            for (String e : method.exceptions) {
-                                if (e.equals(bn.type)) {
-                                    return true;
-                                }
-                            }
-                        }
-                    }
-                } else {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    public static void suppressBlocks(MethodNode m, Set<ControlFlow.Block> toRemove) throws Exception {
-        m.instructions.resetLabels();
-        Iterator<AbstractInsnNode> it = m.instructions.iterator();
-        while (it.hasNext()) {
-            AbstractInsnNode n = it.next();
-            Iterator<TryCatchBlockNode> handlers = m.tryCatchBlocks.iterator();
-            boolean cont = false;
-            // Do not delete instructions that are end of other try block.
-            while (handlers.hasNext()) {
-                TryCatchBlockNode handler = handlers.next();
-                if (handler.end == n) {
-                    cont = true;
-                }
-            }
-            if (cont) {
-                continue;
-            }
-
-            for (ControlFlow.Block b : toRemove) {
-                for (ControlFlow.InstructionNode ins : b.getInstructions()) {
-                    if (ins.getInstr() == n) {
-                        it.remove();
-                    }
-                }
-            }
-        }
-    }
-}
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties	Thu Jul 07 18:35:29 2016 +0000
@@ -31,11 +31,10 @@
 Any number of <key>=<value> pairs can be passed.\n\
 del: is to delete the list of keys in release file.
 
-class-optim.argument=<all|forName-folding>[:log=<log file>]
+class-for-name.argument=
 
-class-optim.description=\
-Class optimization. Warning: This plugin is experimental.\n\
-An optional <log file> can be specified to log applied optimizations.
+class-for-name.description=\
+Class optimization: convert Class.forName calls to constant loads.
 
 compress.argument=<0|1|2>[:filter=<pattern-list>]
 
@@ -47,7 +46,6 @@
 An optional <pattern-list> filter can be specified to list the pattern of\n\
 files to be included.
 
-
 compact-cp.argument=<resource paths>
 
 compact-cp.description=Constant Pool strings sharing.\n\
--- a/jdk/src/jdk.jlink/share/classes/module-info.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/src/jdk.jlink/share/classes/module-info.java	Thu Jul 07 18:35:29 2016 +0000
@@ -39,9 +39,9 @@
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.StripNativeCommandsPlugin;
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.OrderResourcesPlugin;
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.DefaultCompressPlugin;
-    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.OptimizationPlugin;
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ExcludeVMPlugin;
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.IncludeLocalesPlugin;
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.GenerateJLIClassesPlugin;
     provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ReleaseInfoPlugin;
-}
+    provides jdk.tools.jlink.plugin.Plugin with jdk.tools.jlink.internal.plugins.ClassForNamePlugin;
+ }
--- a/jdk/test/ProblemList.txt	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/ProblemList.txt	Thu Jul 07 18:35:29 2016 +0000
@@ -124,6 +124,10 @@
 # jdk_lang
 
 java/lang/StringCoding/CheckEncodings.sh                        7008363 generic-all
+java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java	8160690 generic-all
+java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java	8160690 generic-all
+java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java	8160690 generic-all
+java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java	8160690 generic-all
 
 ############################################################################
 
@@ -136,6 +140,9 @@
 
 java/lang/management/MemoryMXBean/LowMemoryTest.java            8130339 generic-all
 
+java/lang/management/MemoryMXBean/Pending.java                  8158837 generic-all
+java/lang/management/MemoryMXBean/PendingAllGC.sh               8158760 generic-all
+
 ############################################################################
 
 # jdk_io
@@ -278,8 +285,6 @@
 
 sun/security/tools/keytool/autotest.sh                          8130302 generic-all
 
-sun/security/x509/URICertStore/ExtensionsWithLDAP.java          8134577 generic-all
-
 ############################################################################
 
 # jdk_sound
@@ -344,8 +349,6 @@
 
 java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.java 8062512 generic-all
 
-java/util/stream/test/org/openjdk/tests/java/util/stream/IntPrimitiveOpsTests.java 8130337 generic-all
-
 java/util/Arrays/ParallelPrefix.java                            8080165,8085982 generic-all
 
 java/util/BitSet/BitSetStreamTest.java                          8079538 generic-all
--- a/jdk/test/TEST.groups	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/TEST.groups	Thu Jul 07 18:35:29 2016 +0000
@@ -27,6 +27,7 @@
 
 tier1 = \
     :jdk_lang \
+    -java/lang/ProcessBuilder/Zombies.java \
     :jdk_util \
     -java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
     -java/util/concurrent/forkjoin/FJExceptionTableLeak.java \
@@ -37,6 +38,7 @@
     tools/pack200
 
 tier2 = \
+    java/lang/ProcessBuilder/Zombies.java \
     java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
     java/util/concurrent/forkjoin/FJExceptionTableLeak.java \
     :jdk_io \
--- a/jdk/test/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/com/sun/crypto/provider/KeyAgreement/SupportedDHParamGens.java	Thu Jul 07 18:35:29 2016 +0000
@@ -29,8 +29,8 @@
  * @run main/timeout=300 SupportedDHParamGens 768
  * @run main/timeout=300 SupportedDHParamGens 832
  * @run main/timeout=300 SupportedDHParamGens 1024
- * @run main/timeout=300 SupportedDHParamGens 2048
- * @run main/timeout=450 SupportedDHParamGens 3072
+ * @run main/timeout=600 SupportedDHParamGens 2048
+ * @run main/timeout=700 SupportedDHParamGens 3072
  */
 
 import java.math.BigInteger;
--- a/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/io/Serializable/failureAtomicity/FailureAtomicity.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test
  * @bug 8071474
  * @summary Better failure atomicity for default read object.
+ * @modules jdk.compiler
  * @library /lib/testlibrary
  * @build jdk.testlibrary.FileUtils
  * @compile FailureAtomicity.java SerialRef.java
--- a/jdk/test/java/lang/ProcessBuilder/Zombies.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/ProcessBuilder/Zombies.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,6 +42,9 @@
             ! new File("/bin/ps").canExecute())
             return;
         System.out.println("Looks like a Unix system.");
+        long mypid = ProcessHandle.current().getPid();
+        System.out.printf("mypid: %d%n", mypid);
+
         final Runtime rt = Runtime.getRuntime();
 
         try {
@@ -59,7 +62,10 @@
             throw new Error("expected IOException not thrown");
         } catch (IOException expected) {/* OK */}
 
-        rt.exec(TrueCommand).waitFor();
+        Process p = rt.exec(TrueCommand);
+        ProcessHandle pp = p.toHandle().parent().orElse(null);
+        System.out.printf("pid: %d, parent: %s%n", p.getPid(), pp);
+        p.waitFor();
 
         // Count all the zombies that are children of this Java process
         final String[] zombieCounter = {
@@ -68,6 +74,13 @@
         };
 
         int zombies = rt.exec(zombieCounter).waitFor();
-        if (zombies != 0) throw new Error(zombies + " zombies!");
+        if (zombies != 0) {
+            // Log remaining processes
+            ProcessBuilder pb = new ProcessBuilder("/bin/ps", "-ef");
+            pb.inheritIO();
+            Process p2 = pb.start();
+            p2.waitFor();
+            throw new Error(zombies + " zombies!");
+        }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/AnnotationVerifier.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Create class file using ASM, slightly modified the ASMifier output
+ */
+
+import sun.reflect.annotation.AnnotationType;
+import java.lang.annotation.AnnotationFormatError;
+import org.testng.annotations.*;
+
+/*
+ * @test
+ * @bug 8158510
+ * @summary Verify valid annotation
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * @modules java.base/sun.reflect.annotation
+ * @clean AnnotationWithVoidReturn.class AnnotationWithParameter.class
+ * @compile -XDignore.symbol.file ClassFileGenerator.java
+ * @run main ClassFileGenerator
+ * @run testng AnnotationVerifier
+ */
+
+public class AnnotationVerifier {
+
+    @AnnotationWithParameter
+    @AnnotationWithVoidReturn
+    static class BadAnnotation {
+    }
+
+    @Test
+    @ExpectedExceptions(IllegalArgumentException.class)
+    public void annotationValidationIAE() {
+        AnnotationType.getInstance(AnnotationWithParameter.class);
+    }
+
+    @Test(expectedExceptions = AnnotationFormatError.class)
+    public void annotationValidationAFE() {
+        BadAnnotation.class.getAnnotation(AnnotationWithVoidReturn.class);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/ClassFileGenerator.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Create class file using ASM, slightly modified the ASMifier output
+ */
+
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import jdk.internal.org.objectweb.asm.*;
+
+
+public class ClassFileGenerator {
+
+    public static void main(String... args) throws Exception {
+        classFileWriter("AnnotationWithVoidReturn.class", AnnoationWithVoidReturnDump.dump());
+        classFileWriter("AnnotationWithParameter.class", AnnoationWithParameterDump.dump());
+    }
+
+    private static void classFileWriter(String name, byte[] contents) throws IOException {
+        try (FileOutputStream fos = new FileOutputStream(new File(System.getProperty("test.classes"),
+                name))) {
+            fos.write(contents);
+        }
+    }
+
+    /*
+    Following code create equivalent classfile,
+    which is not allowed by javac.
+
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface AnnotationWithVoidReturn {
+    void m() default 1;
+    }
+    */
+
+    private static class AnnoationWithVoidReturnDump implements Opcodes {
+        public static byte[] dump() throws Exception {
+            ClassWriter cw = new ClassWriter(0);
+            MethodVisitor mv;
+            AnnotationVisitor av0;
+
+            cw.visit(52, ACC_PUBLIC + ACC_ANNOTATION + ACC_ABSTRACT + +ACC_INTERFACE,
+                    "AnnotationWithVoidReturn", null,
+                    "java/lang/Object", new String[]{"java/lang/annotation/Annotation"});
+
+            {
+                av0 = cw.visitAnnotation("Ljava/lang/annotation/Retention;", true);
+                av0.visitEnum("value", "Ljava/lang/annotation/RetentionPolicy;",
+                        "RUNTIME");
+                av0.visitEnd();
+            }
+            {
+                mv = cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "m", "()V", null, null);
+                mv.visitEnd();
+            }
+            {
+                av0 = mv.visitAnnotationDefault();
+                av0.visit(null, new Integer(1));
+                av0.visitEnd();
+            }
+            cw.visitEnd();
+
+            return cw.toByteArray();
+
+        }
+    }
+
+    /*
+    Following code create equivalent classfile,
+    which is not allowed by javac.
+
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface AnnotationWithParameter {
+       int m(int x);
+    }
+    */
+
+    private static class AnnoationWithParameterDump implements Opcodes {
+        public static byte[] dump() throws Exception {
+
+            ClassWriter cw = new ClassWriter(0);
+            MethodVisitor mv;
+            AnnotationVisitor av0;
+
+            cw.visit(52, ACC_PUBLIC + ACC_ANNOTATION + ACC_ABSTRACT + ACC_INTERFACE,
+                    "AnnotationWithParameter", null,
+                    "java/lang/Object", new String[]{"java/lang/annotation/Annotation"});
+
+            {
+                av0 = cw.visitAnnotation("Ljava/lang/annotation/Retention;", true);
+                av0.visitEnum("value", "Ljava/lang/annotation/RetentionPolicy;",
+                        "RUNTIME");
+                av0.visitEnd();
+            }
+            {
+                mv = cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT,
+                        "badValue",
+                        "(I)I", // Bad method with a parameter
+                        null, null);
+                mv.visitEnd();
+            }
+            {
+                av0 = mv.visitAnnotationDefault();
+                av0.visit(null, new Integer(-1));
+                av0.visitEnd();
+            }
+            cw.visitEnd();
+
+            return cw.toByteArray();
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/typeAnnotations/MissingAnnotation.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE_USE)
+public @interface MissingAnnotation { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/annotation/typeAnnotations/NoNpeOnMissingAnnotation.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8152174
+ * @summary Verify that a missing class file for a type use annotation doesn't cause a NPE when attempting to read the annotation.
+ * @compile NoNpeOnMissingAnnotation.java MissingAnnotation.java
+ * @run main NoNpeOnMissingAnnotation
+ * @clean MissingAnnotation
+ * @run main NoNpeOnMissingAnnotation
+ */
+
+import java.lang.annotation.*;
+
+public class NoNpeOnMissingAnnotation {
+    public static void main(String... args) throws Exception {
+        System.out.println(NoNpeOnMissingAnnotation.class.
+                           getDeclaredMethod("foo").
+                           getAnnotatedReturnType());
+    }
+
+    @MissingAnnotation Object foo() { return null; }
+}
--- a/jdk/test/java/lang/invoke/DropArgumentsTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/DropArgumentsTest.java	Thu Jul 07 18:35:29 2016 +0000
@@ -24,6 +24,7 @@
  */
 
 /* @test
+ * @bug  8158169
  * @summary unit tests for java.lang.invoke.MethodHandles
  * @run testng test.java.lang.invoke.DropArgumentsTest
  */
@@ -32,6 +33,7 @@
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
+import java.util.Collections;
 import java.util.List;
 import static java.lang.invoke.MethodHandles.*;
 import static java.lang.invoke.MethodType.*;
@@ -78,6 +80,7 @@
             {cat, -1, bigType.parameterList(), 0},
             {cat, 0, bigType.parameterList(), -1},
             {cat, 3, bigType.parameterList(), 0},
+            {cat, 0, bigType.parameterList(), 6},
             {cat, 0, bigType.parameterList(), 2}
         };
     }
@@ -96,4 +99,30 @@
         MethodType bigTypewithVoid = cat.type().insertParameterTypes(0, void.class, String.class, int.class);
         MethodHandle handle2 = MethodHandles.dropArgumentsToMatch(cat, 0, bigTypewithVoid.parameterList(), 1);
     }
+
+    public static class MethodSet {
+
+        static void mVoid() {
+
+        }
+
+        static void mVoid(int t) {
+
+        }
+    }
+
+    @Test
+    public void dropArgumentsToMatchPosSkipRange() throws Throwable {
+        // newTypes.size() == 1, pos == 1   &&   target.paramSize() == 0, skip == 0
+        MethodHandle mh1 = MethodHandles.lookup().findStatic(MethodSet.class, "mVoid",
+                                                             MethodType.methodType(void.class));
+        MethodHandle handle1 = dropArgumentsToMatch(mh1, 0, Collections.singletonList(int.class), 1);
+        assertEquals(1, handle1.type().parameterList().size());
+
+        // newTypes.size() == 1, pos == 0   &&   target.paramSize() == 1, skip == 1
+        MethodHandle mh2 = MethodHandles.lookup().findStatic(MethodSet.class, "mVoid",
+                                                             MethodType.methodType(void.class, int.class));
+        MethodHandle handle2 = dropArgumentsToMatch(mh2, 1, Collections.singletonList(int.class), 0);
+        assertEquals(2, handle2.type().parameterList().size());
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/LoopCombinatorLongSignatureTest.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8160717
+ * @run main/othervm -ea -esa -Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=-1 test.java.lang.invoke.LoopCombinatorLongSignatureTest
+ * @run main/othervm -ea -esa test.java.lang.invoke.LoopCombinatorLongSignatureTest
+ */
+
+package test.java.lang.invoke;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.util.Arrays;
+
+/**
+ * If a loop with an excessive amount of clauses is created, so that the number of parameters to the resulting loop
+ * handle exceeds the allowed maximum, an IAE must be signalled. The test is run first in LambdaForm interpretation mode
+ * and then in default mode, wherein bytecode generation falls back to LFI mode due to excessively long methods.
+ */
+public class LoopCombinatorLongSignatureTest {
+
+    static final MethodHandle INIT = MethodHandles.constant(int.class, 0);
+    static final MethodHandle STEP = MethodHandles.identity(int.class);
+    static final MethodHandle PRED_F = MethodHandles.constant(boolean.class, false);
+    static final MethodHandle PRED_T = MethodHandles.constant(boolean.class, true);
+    static final MethodHandle FINI = MethodHandles.identity(int.class);
+
+    static final int ARG_LIMIT = 254; // for internal reasons, this is the maximum allowed number of arguments
+
+    public static void main(String[] args) {
+        for (int loopArgs = 0; loopArgs < 2; ++loopArgs) {
+            testLongSignature(loopArgs, false);
+            testLongSignature(loopArgs, true);
+        }
+    }
+
+    static void testLongSignature(int loopArgs, boolean excessive) {
+        int nClauses = ARG_LIMIT - loopArgs + (excessive ? 1 : 0);
+
+        System.out.print((excessive ? "(EXCESSIVE)" : "(LONG     )") + " arguments: " + loopArgs + ", clauses: " + nClauses + " -> ");
+
+        // extend init to denote what arguments the loop should accept
+        Class<?>[] argTypes = new Class<?>[loopArgs];
+        Arrays.fill(argTypes, int.class);
+        MethodHandle init = MethodHandles.dropArguments(INIT, 0, argTypes);
+
+        // build clauses
+        MethodHandle[][] clauses = new MethodHandle[nClauses][];
+        MethodHandle[] clause = {init, STEP, PRED_T, FINI};
+        MethodHandle[] fclause = {init, STEP, PRED_F, FINI};
+        Arrays.fill(clauses, clause);
+        clauses[nClauses - 1] = fclause; // make the last clause terminate the loop
+
+        try {
+            MethodHandle loop = MethodHandles.loop(clauses);
+            if (excessive) {
+                throw new AssertionError("loop construction should have failed");
+            } else {
+                int r;
+                if (loopArgs == 0) {
+                    r = (int) loop.invoke();
+                } else {
+                    Object[] args = new Object[loopArgs];
+                    Arrays.fill(args, 0);
+                    r = (int) loop.invokeWithArguments(args);
+                }
+                System.out.println("SUCCEEDED (OK) -> " + r);
+            }
+        } catch (IllegalArgumentException iae) {
+            if (excessive) {
+                System.out.println("FAILED    (OK)");
+            } else {
+                iae.printStackTrace(System.out);
+                throw new AssertionError("loop construction should not have failed (see above)");
+            }
+        } catch (Throwable t) {
+            t.printStackTrace(System.out);
+            throw new AssertionError("unexpected failure (see above)");
+        }
+    }
+
+}
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleBaseTest.java	Thu Jul 07 18:35:29 2016 +0000
@@ -145,7 +145,7 @@
         GET_OPAQUE(TestAccessType.GET),
         SET_OPAQUE(TestAccessType.SET),
         COMPARE_AND_SET(TestAccessType.COMPARE_AND_SET),
-        COMPARE_AND_EXCHANGE_VOLATILE(TestAccessType.COMPARE_AND_EXCHANGE),
+        COMPARE_AND_EXCHANGE(TestAccessType.COMPARE_AND_EXCHANGE),
         COMPARE_AND_EXCHANGE_ACQUIRE(TestAccessType.COMPARE_AND_EXCHANGE),
         COMPARE_AND_EXCHANGE_RELEASE(TestAccessType.COMPARE_AND_EXCHANGE),
         WEAK_COMPARE_AND_SET(TestAccessType.COMPARE_AND_SET),
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessBoolean.java	Thu Jul 07 18:35:29 2016 +0000
@@ -99,15 +99,15 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
@@ -260,41 +260,6 @@
             vh.setOpaque(recv, false);
         });
 
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeVolatile(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeAcquire(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeRelease(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.getAndSet(recv, true);
-        });
 
         checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(recv, true);
@@ -350,41 +315,6 @@
             vh.setOpaque(false);
         });
 
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeVolatile(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeAcquire(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeRelease(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.getAndSet(true);
-        });
 
         checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(true);
@@ -426,45 +356,116 @@
             assertEquals(x, false, "setOpaque boolean value");
         }
 
+        vh.set(recv, true);
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet(recv, true, false);
+            assertEquals(r, true, "success compareAndSet boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "success compareAndSet boolean value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(recv, true, false);
+            assertEquals(r, false, "failing compareAndSet boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "failing compareAndSet boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchange(recv, false, true);
+            assertEquals(r, false, "success compareAndExchange boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, true, "success compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchange(recv, false, false);
+            assertEquals(r, true, "failing compareAndExchange boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, true, "failing compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeAcquire(recv, true, false);
+            assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeAcquire(recv, true, false);
+            assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeRelease(recv, false, true);
+            assertEquals(r, false, "success compareAndExchangeRelease boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeRelease(recv, false, false);
+            assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(recv, true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSet boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "weakCompareAndSet boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(recv, false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(recv, true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "weakCompareAndSetRelease boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetVolatile(recv, false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, true, "weakCompareAndSetVolatile boolean value");
+        }
+
+        // Compare set and get
+        {
+            boolean o = (boolean) vh.getAndSet(recv, false);
+            assertEquals(o, true, "getAndSet boolean");
+            boolean x = (boolean) vh.get(recv);
+            assertEquals(x, false, "getAndSet boolean value");
+        }
 
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestAccessBoolean recv, VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeVolatile(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeAcquire(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeRelease(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.getAndSet(recv, true);
-        });
 
         checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(recv, true);
@@ -506,45 +507,116 @@
             assertEquals(x, false, "setOpaque boolean value");
         }
 
+        vh.set(true);
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet(true, false);
+            assertEquals(r, true, "success compareAndSet boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "success compareAndSet boolean value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(true, false);
+            assertEquals(r, false, "failing compareAndSet boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "failing compareAndSet boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchange(false, true);
+            assertEquals(r, false, "success compareAndExchange boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, true, "success compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchange(false, false);
+            assertEquals(r, true, "failing compareAndExchange boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, true, "failing compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeAcquire(true, false);
+            assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeAcquire(true, false);
+            assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeRelease(false, true);
+            assertEquals(r, false, "success compareAndExchangeRelease boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean r = (boolean) vh.compareAndExchangeRelease(false, false);
+            assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSet boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "weakCompareAndSet boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "weakCompareAndSetRelease boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+        }
+
+        // Compare set and get
+        {
+            boolean o = (boolean) vh.getAndSet(false);
+            assertEquals(o, true, "getAndSet boolean");
+            boolean x = (boolean) vh.get();
+            assertEquals(x, false, "getAndSet boolean value");
+        }
 
     }
 
     static void testStaticFieldUnsupported(VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeVolatile(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeAcquire(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeRelease(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.getAndSet(true);
-        });
 
         checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(true);
@@ -589,6 +661,112 @@
                 assertEquals(x, false, "setOpaque boolean value");
             }
 
+            vh.set(array, i, true);
+
+            // Compare
+            {
+                boolean r = vh.compareAndSet(array, i, true, false);
+                assertEquals(r, true, "success compareAndSet boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "success compareAndSet boolean value");
+            }
+
+            {
+                boolean r = vh.compareAndSet(array, i, true, false);
+                assertEquals(r, false, "failing compareAndSet boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "failing compareAndSet boolean value");
+            }
+
+            {
+                boolean r = (boolean) vh.compareAndExchange(array, i, false, true);
+                assertEquals(r, false, "success compareAndExchange boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, true, "success compareAndExchange boolean value");
+            }
+
+            {
+                boolean r = (boolean) vh.compareAndExchange(array, i, false, false);
+                assertEquals(r, true, "failing compareAndExchange boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, true, "failing compareAndExchange boolean value");
+            }
+
+            {
+                boolean r = (boolean) vh.compareAndExchangeAcquire(array, i, true, false);
+                assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+            }
+
+            {
+                boolean r = (boolean) vh.compareAndExchangeAcquire(array, i, true, false);
+                assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+            }
+
+            {
+                boolean r = (boolean) vh.compareAndExchangeRelease(array, i, false, true);
+                assertEquals(r, false, "success compareAndExchangeRelease boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+            }
+
+            {
+                boolean r = (boolean) vh.compareAndExchangeRelease(array, i, false, false);
+                assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSet(array, i, true, false);
+                }
+                assertEquals(success, true, "weakCompareAndSet boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "weakCompareAndSet boolean value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetAcquire(array, i, false, true);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetRelease(array, i, true, false);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "weakCompareAndSetRelease boolean");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetVolatile(array, i, false, true);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+            }
+
+            // Compare set and get
+            {
+                boolean o = (boolean) vh.getAndSet(array, i, false);
+                assertEquals(o, true, "getAndSet boolean");
+                boolean x = (boolean) vh.get(array, i);
+                assertEquals(x, false, "getAndSet boolean value");
+            }
 
         }
     }
@@ -597,41 +775,6 @@
         boolean[] array = new boolean[10];
 
         int i = 0;
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeVolatile(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeAcquire(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.compareAndExchangeRelease(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(array, i, true, false);
-        });
-
-        checkUOE(() -> {
-            boolean r = (boolean) vh.getAndSet(array, i, true);
-        });
 
         checkUOE(() -> {
             boolean o = (boolean) vh.getAndAdd(array, i, true);
@@ -680,6 +823,41 @@
                 vh.setOpaque(array, ci, true);
             });
 
+            checkIOOBE(() -> {
+                boolean r = vh.compareAndSet(array, ci, true, false);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = (boolean) vh.compareAndExchange(array, ci, false, true);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = (boolean) vh.compareAndExchangeAcquire(array, ci, false, true);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = (boolean) vh.compareAndExchangeRelease(array, ci, false, true);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSet(array, ci, true, false);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, true, false);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, true, false);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetRelease(array, ci, true, false);
+            });
+
+            checkIOOBE(() -> {
+                boolean o = (boolean) vh.getAndSet(array, ci, true);
+            });
 
         }
     }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessByte.java	Thu Jul 07 18:35:29 2016 +0000
@@ -42,11 +42,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestAccessByte extends VarHandleBaseTest {
-    static final byte static_final_v = (byte)1;
+    static final byte static_final_v = (byte)0x01;
 
     static byte static_v;
 
-    final byte final_v = (byte)1;
+    final byte final_v = (byte)0x01;
 
     byte v;
 
@@ -99,18 +99,18 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
     }
 
 
@@ -220,89 +220,47 @@
         // Plain
         {
             byte x = (byte) vh.get(recv);
-            assertEquals(x, (byte)1, "get byte value");
+            assertEquals(x, (byte)0x01, "get byte value");
         }
 
 
         // Volatile
         {
             byte x = (byte) vh.getVolatile(recv);
-            assertEquals(x, (byte)1, "getVolatile byte value");
+            assertEquals(x, (byte)0x01, "getVolatile byte value");
         }
 
         // Lazy
         {
             byte x = (byte) vh.getAcquire(recv);
-            assertEquals(x, (byte)1, "getRelease byte value");
+            assertEquals(x, (byte)0x01, "getRelease byte value");
         }
 
         // Opaque
         {
             byte x = (byte) vh.getOpaque(recv);
-            assertEquals(x, (byte)1, "getOpaque byte value");
+            assertEquals(x, (byte)0x01, "getOpaque byte value");
         }
     }
 
     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessByte recv, VarHandle vh) {
         checkUOE(() -> {
-            vh.set(recv, (byte)2);
-        });
-
-        checkUOE(() -> {
-            vh.setVolatile(recv, (byte)2);
-        });
-
-        checkUOE(() -> {
-            vh.setRelease(recv, (byte)2);
+            vh.set(recv, (byte)0x23);
         });
 
         checkUOE(() -> {
-            vh.setOpaque(recv, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeVolatile(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeAcquire(recv, (byte)1, (byte)2);
+            vh.setVolatile(recv, (byte)0x23);
         });
 
         checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeRelease(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, (byte)1, (byte)2);
+            vh.setRelease(recv, (byte)0x23);
         });
 
         checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, (byte)1, (byte)2);
+            vh.setOpaque(recv, (byte)0x23);
         });
 
-        checkUOE(() -> {
-            byte r = (byte) vh.getAndSet(recv, (byte)1);
-        });
 
-        checkUOE(() -> {
-            byte o = (byte) vh.getAndAdd(recv, (byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.addAndGet(recv, (byte)1);
-        });
     }
 
 
@@ -310,249 +268,353 @@
         // Plain
         {
             byte x = (byte) vh.get();
-            assertEquals(x, (byte)1, "get byte value");
+            assertEquals(x, (byte)0x01, "get byte value");
         }
 
 
         // Volatile
         {
             byte x = (byte) vh.getVolatile();
-            assertEquals(x, (byte)1, "getVolatile byte value");
+            assertEquals(x, (byte)0x01, "getVolatile byte value");
         }
 
         // Lazy
         {
             byte x = (byte) vh.getAcquire();
-            assertEquals(x, (byte)1, "getRelease byte value");
+            assertEquals(x, (byte)0x01, "getRelease byte value");
         }
 
         // Opaque
         {
             byte x = (byte) vh.getOpaque();
-            assertEquals(x, (byte)1, "getOpaque byte value");
+            assertEquals(x, (byte)0x01, "getOpaque byte value");
         }
     }
 
     static void testStaticFinalFieldUnsupported(VarHandle vh) {
         checkUOE(() -> {
-            vh.set((byte)2);
-        });
-
-        checkUOE(() -> {
-            vh.setVolatile((byte)2);
-        });
-
-        checkUOE(() -> {
-            vh.setRelease((byte)2);
+            vh.set((byte)0x23);
         });
 
         checkUOE(() -> {
-            vh.setOpaque((byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeVolatile((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeAcquire((byte)1, (byte)2);
+            vh.setVolatile((byte)0x23);
         });
 
         checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeRelease((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile((byte)1, (byte)2);
+            vh.setRelease((byte)0x23);
         });
 
         checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease((byte)1, (byte)2);
+            vh.setOpaque((byte)0x23);
         });
 
-        checkUOE(() -> {
-            byte r = (byte) vh.getAndSet((byte)1);
-        });
 
-        checkUOE(() -> {
-            byte o = (byte) vh.getAndAdd((byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.addAndGet((byte)1);
-        });
     }
 
 
     static void testInstanceField(VarHandleTestAccessByte recv, VarHandle vh) {
         // Plain
         {
-            vh.set(recv, (byte)1);
+            vh.set(recv, (byte)0x01);
             byte x = (byte) vh.get(recv);
-            assertEquals(x, (byte)1, "set byte value");
+            assertEquals(x, (byte)0x01, "set byte value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(recv, (byte)2);
+            vh.setVolatile(recv, (byte)0x23);
             byte x = (byte) vh.getVolatile(recv);
-            assertEquals(x, (byte)2, "setVolatile byte value");
+            assertEquals(x, (byte)0x23, "setVolatile byte value");
         }
 
         // Lazy
         {
-            vh.setRelease(recv, (byte)1);
+            vh.setRelease(recv, (byte)0x01);
             byte x = (byte) vh.getAcquire(recv);
-            assertEquals(x, (byte)1, "setRelease byte value");
+            assertEquals(x, (byte)0x01, "setRelease byte value");
         }
 
         // Opaque
         {
-            vh.setOpaque(recv, (byte)2);
+            vh.setOpaque(recv, (byte)0x23);
             byte x = (byte) vh.getOpaque(recv);
-            assertEquals(x, (byte)2, "setOpaque byte value");
+            assertEquals(x, (byte)0x23, "setOpaque byte value");
+        }
+
+        vh.set(recv, (byte)0x01);
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet(recv, (byte)0x01, (byte)0x23);
+            assertEquals(r, true, "success compareAndSet byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "success compareAndSet byte value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(recv, (byte)0x01, (byte)0x45);
+            assertEquals(r, false, "failing compareAndSet byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "failing compareAndSet byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchange(recv, (byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchange byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchange(recv, (byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchangeAcquire(recv, (byte)0x01, (byte)0x23);
+            assertEquals(r, (byte)0x01, "success compareAndExchangeAcquire byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "success compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchangeAcquire(recv, (byte)0x01, (byte)0x45);
+            assertEquals(r, (byte)0x23, "failing compareAndExchangeAcquire byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "failing compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchangeRelease(recv, (byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchangeRelease byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x01, "success compareAndExchangeRelease byte value");
         }
 
+        {
+            byte r = (byte) vh.compareAndExchangeRelease(recv, (byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchangeRelease byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x01, "failing compareAndExchangeRelease byte value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(recv, (byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSet byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(recv, (byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(recv, (byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetVolatile(recv, (byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte value");
+        }
+
+        // Compare set and get
+        {
+            byte o = (byte) vh.getAndSet(recv, (byte)0x23);
+            assertEquals(o, (byte)0x01, "getAndSet byte");
+            byte x = (byte) vh.get(recv);
+            assertEquals(x, (byte)0x23, "getAndSet byte value");
+        }
+
+        vh.set(recv, (byte)0x01);
+
+        // get and add, add and get
+        {
+            byte o = (byte) vh.getAndAdd(recv, (byte)0x45);
+            assertEquals(o, (byte)0x01, "getAndAdd byte");
+            byte c = (byte) vh.addAndGet(recv, (byte)0x45);
+            assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestAccessByte recv, VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, (byte)1, (byte)2);
-        });
 
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeVolatile(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeAcquire(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeRelease(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.getAndSet(recv, (byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.getAndAdd(recv, (byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.addAndGet(recv, (byte)1);
-        });
     }
 
 
     static void testStaticField(VarHandle vh) {
         // Plain
         {
-            vh.set((byte)1);
+            vh.set((byte)0x01);
             byte x = (byte) vh.get();
-            assertEquals(x, (byte)1, "set byte value");
+            assertEquals(x, (byte)0x01, "set byte value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile((byte)2);
+            vh.setVolatile((byte)0x23);
             byte x = (byte) vh.getVolatile();
-            assertEquals(x, (byte)2, "setVolatile byte value");
+            assertEquals(x, (byte)0x23, "setVolatile byte value");
         }
 
         // Lazy
         {
-            vh.setRelease((byte)1);
+            vh.setRelease((byte)0x01);
             byte x = (byte) vh.getAcquire();
-            assertEquals(x, (byte)1, "setRelease byte value");
+            assertEquals(x, (byte)0x01, "setRelease byte value");
         }
 
         // Opaque
         {
-            vh.setOpaque((byte)2);
+            vh.setOpaque((byte)0x23);
             byte x = (byte) vh.getOpaque();
-            assertEquals(x, (byte)2, "setOpaque byte value");
+            assertEquals(x, (byte)0x23, "setOpaque byte value");
+        }
+
+        vh.set((byte)0x01);
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet((byte)0x01, (byte)0x23);
+            assertEquals(r, true, "success compareAndSet byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "success compareAndSet byte value");
+        }
+
+        {
+            boolean r = vh.compareAndSet((byte)0x01, (byte)0x45);
+            assertEquals(r, false, "failing compareAndSet byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "failing compareAndSet byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchange((byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchange byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchange((byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchangeAcquire((byte)0x01, (byte)0x23);
+            assertEquals(r, (byte)0x01, "success compareAndExchangeAcquire byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "success compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchangeAcquire((byte)0x01, (byte)0x45);
+            assertEquals(r, (byte)0x23, "failing compareAndExchangeAcquire byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "failing compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) vh.compareAndExchangeRelease((byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchangeRelease byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x01, "success compareAndExchangeRelease byte value");
         }
 
+        {
+            byte r = (byte) vh.compareAndExchangeRelease((byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchangeRelease byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x01, "failing compareAndExchangeRelease byte value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet((byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSet byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire((byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease((byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease((byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+        }
+
+        // Compare set and get
+        {
+            byte o = (byte) vh.getAndSet((byte)0x23);
+            assertEquals(o, (byte)0x01, "getAndSet byte");
+            byte x = (byte) vh.get();
+            assertEquals(x, (byte)0x23, "getAndSet byte value");
+        }
+
+        vh.set((byte)0x01);
+
+        // get and add, add and get
+        {
+            byte o = (byte) vh.getAndAdd( (byte)0x45);
+            assertEquals(o, (byte)0x01, "getAndAdd byte");
+            byte c = (byte) vh.addAndGet((byte)0x45);
+            assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+        }
     }
 
     static void testStaticFieldUnsupported(VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet((byte)1, (byte)2);
-        });
 
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeVolatile((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeAcquire((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeRelease((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease((byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.getAndSet((byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.getAndAdd((byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.addAndGet((byte)1);
-        });
     }
 
 
@@ -562,34 +624,149 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                vh.set(array, i, (byte)1);
+                vh.set(array, i, (byte)0x01);
                 byte x = (byte) vh.get(array, i);
-                assertEquals(x, (byte)1, "get byte value");
+                assertEquals(x, (byte)0x01, "get byte value");
             }
 
 
             // Volatile
             {
-                vh.setVolatile(array, i, (byte)2);
+                vh.setVolatile(array, i, (byte)0x23);
                 byte x = (byte) vh.getVolatile(array, i);
-                assertEquals(x, (byte)2, "setVolatile byte value");
+                assertEquals(x, (byte)0x23, "setVolatile byte value");
             }
 
             // Lazy
             {
-                vh.setRelease(array, i, (byte)1);
+                vh.setRelease(array, i, (byte)0x01);
                 byte x = (byte) vh.getAcquire(array, i);
-                assertEquals(x, (byte)1, "setRelease byte value");
+                assertEquals(x, (byte)0x01, "setRelease byte value");
             }
 
             // Opaque
             {
-                vh.setOpaque(array, i, (byte)2);
+                vh.setOpaque(array, i, (byte)0x23);
                 byte x = (byte) vh.getOpaque(array, i);
-                assertEquals(x, (byte)2, "setOpaque byte value");
+                assertEquals(x, (byte)0x23, "setOpaque byte value");
+            }
+
+            vh.set(array, i, (byte)0x01);
+
+            // Compare
+            {
+                boolean r = vh.compareAndSet(array, i, (byte)0x01, (byte)0x23);
+                assertEquals(r, true, "success compareAndSet byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "success compareAndSet byte value");
+            }
+
+            {
+                boolean r = vh.compareAndSet(array, i, (byte)0x01, (byte)0x45);
+                assertEquals(r, false, "failing compareAndSet byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "failing compareAndSet byte value");
+            }
+
+            {
+                byte r = (byte) vh.compareAndExchange(array, i, (byte)0x23, (byte)0x01);
+                assertEquals(r, (byte)0x23, "success compareAndExchange byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
+            }
+
+            {
+                byte r = (byte) vh.compareAndExchange(array, i, (byte)0x23, (byte)0x45);
+                assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
+            }
+
+            {
+                byte r = (byte) vh.compareAndExchangeAcquire(array, i, (byte)0x01, (byte)0x23);
+                assertEquals(r, (byte)0x01, "success compareAndExchangeAcquire byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "success compareAndExchangeAcquire byte value");
+            }
+
+            {
+                byte r = (byte) vh.compareAndExchangeAcquire(array, i, (byte)0x01, (byte)0x45);
+                assertEquals(r, (byte)0x23, "failing compareAndExchangeAcquire byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "failing compareAndExchangeAcquire byte value");
+            }
+
+            {
+                byte r = (byte) vh.compareAndExchangeRelease(array, i, (byte)0x23, (byte)0x01);
+                assertEquals(r, (byte)0x23, "success compareAndExchangeRelease byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x01, "success compareAndExchangeRelease byte value");
             }
 
+            {
+                byte r = (byte) vh.compareAndExchangeRelease(array, i, (byte)0x23, (byte)0x45);
+                assertEquals(r, (byte)0x01, "failing compareAndExchangeRelease byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x01, "failing compareAndExchangeRelease byte value");
+            }
 
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSet(array, i, (byte)0x01, (byte)0x23);
+                }
+                assertEquals(success, true, "weakCompareAndSet byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetAcquire(array, i, (byte)0x23, (byte)0x01);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetRelease(array, i, (byte)0x01, (byte)0x23);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetVolatile(array, i, (byte)0x23, (byte)0x01);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+            }
+
+            // Compare set and get
+            {
+                byte o = (byte) vh.getAndSet(array, i, (byte)0x23);
+                assertEquals(o, (byte)0x01, "getAndSet byte");
+                byte x = (byte) vh.get(array, i);
+                assertEquals(x, (byte)0x23, "getAndSet byte value");
+            }
+
+            vh.set(array, i, (byte)0x01);
+
+            // get and add, add and get
+            {
+                byte o = (byte) vh.getAndAdd(array, i, (byte)0x45);
+                assertEquals(o, (byte)0x01, "getAndAdd byte");
+                byte c = (byte) vh.addAndGet(array, i, (byte)0x45);
+                assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+            }
         }
     }
 
@@ -597,49 +774,7 @@
         byte[] array = new byte[10];
 
         int i = 0;
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(array, i, (byte)1, (byte)2);
-        });
 
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeVolatile(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeAcquire(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.compareAndExchangeRelease(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(array, i, (byte)1, (byte)2);
-        });
-
-        checkUOE(() -> {
-            byte r = (byte) vh.getAndSet(array, i, (byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.getAndAdd(array, i, (byte)1);
-        });
-
-        checkUOE(() -> {
-            byte o = (byte) vh.addAndGet(array, i, (byte)1);
-        });
     }
 
     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -653,7 +788,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.set(array, ci, (byte)1);
+                vh.set(array, ci, (byte)0x01);
             });
 
             checkIOOBE(() -> {
@@ -661,7 +796,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setVolatile(array, ci, (byte)1);
+                vh.setVolatile(array, ci, (byte)0x01);
             });
 
             checkIOOBE(() -> {
@@ -669,7 +804,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setRelease(array, ci, (byte)1);
+                vh.setRelease(array, ci, (byte)0x01);
             });
 
             checkIOOBE(() -> {
@@ -677,10 +812,52 @@
             });
 
             checkIOOBE(() -> {
-                vh.setOpaque(array, ci, (byte)1);
+                vh.setOpaque(array, ci, (byte)0x01);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.compareAndSet(array, ci, (byte)0x01, (byte)0x23);
+            });
+
+            checkIOOBE(() -> {
+                byte r = (byte) vh.compareAndExchange(array, ci, (byte)0x23, (byte)0x01);
+            });
+
+            checkIOOBE(() -> {
+                byte r = (byte) vh.compareAndExchangeAcquire(array, ci, (byte)0x23, (byte)0x01);
+            });
+
+            checkIOOBE(() -> {
+                byte r = (byte) vh.compareAndExchangeRelease(array, ci, (byte)0x23, (byte)0x01);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSet(array, ci, (byte)0x01, (byte)0x23);
             });
 
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, (byte)0x01, (byte)0x23);
+            });
 
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, (byte)0x01, (byte)0x23);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetRelease(array, ci, (byte)0x01, (byte)0x23);
+            });
+
+            checkIOOBE(() -> {
+                byte o = (byte) vh.getAndSet(array, ci, (byte)0x01);
+            });
+
+            checkIOOBE(() -> {
+                byte o = (byte) vh.getAndAdd(array, ci, (byte)0x45);
+            });
+
+            checkIOOBE(() -> {
+                byte o = (byte) vh.addAndGet(array, ci, (byte)0x45);
+            });
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessChar.java	Thu Jul 07 18:35:29 2016 +0000
@@ -42,11 +42,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestAccessChar extends VarHandleBaseTest {
-    static final char static_final_v = 'a';
+    static final char static_final_v = '\u0123';
 
     static char static_v;
 
-    final char final_v = 'a';
+    final char final_v = '\u0123';
 
     char v;
 
@@ -99,18 +99,18 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
     }
 
 
@@ -220,89 +220,47 @@
         // Plain
         {
             char x = (char) vh.get(recv);
-            assertEquals(x, 'a', "get char value");
+            assertEquals(x, '\u0123', "get char value");
         }
 
 
         // Volatile
         {
             char x = (char) vh.getVolatile(recv);
-            assertEquals(x, 'a', "getVolatile char value");
+            assertEquals(x, '\u0123', "getVolatile char value");
         }
 
         // Lazy
         {
             char x = (char) vh.getAcquire(recv);
-            assertEquals(x, 'a', "getRelease char value");
+            assertEquals(x, '\u0123', "getRelease char value");
         }
 
         // Opaque
         {
             char x = (char) vh.getOpaque(recv);
-            assertEquals(x, 'a', "getOpaque char value");
+            assertEquals(x, '\u0123', "getOpaque char value");
         }
     }
 
     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessChar recv, VarHandle vh) {
         checkUOE(() -> {
-            vh.set(recv, 'b');
-        });
-
-        checkUOE(() -> {
-            vh.setVolatile(recv, 'b');
-        });
-
-        checkUOE(() -> {
-            vh.setRelease(recv, 'b');
+            vh.set(recv, '\u4567');
         });
 
         checkUOE(() -> {
-            vh.setOpaque(recv, 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeVolatile(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeAcquire(recv, 'a', 'b');
+            vh.setVolatile(recv, '\u4567');
         });
 
         checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeRelease(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, 'a', 'b');
+            vh.setRelease(recv, '\u4567');
         });
 
         checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, 'a', 'b');
+            vh.setOpaque(recv, '\u4567');
         });
 
-        checkUOE(() -> {
-            char r = (char) vh.getAndSet(recv, 'a');
-        });
 
-        checkUOE(() -> {
-            char o = (char) vh.getAndAdd(recv, 'a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.addAndGet(recv, 'a');
-        });
     }
 
 
@@ -310,249 +268,353 @@
         // Plain
         {
             char x = (char) vh.get();
-            assertEquals(x, 'a', "get char value");
+            assertEquals(x, '\u0123', "get char value");
         }
 
 
         // Volatile
         {
             char x = (char) vh.getVolatile();
-            assertEquals(x, 'a', "getVolatile char value");
+            assertEquals(x, '\u0123', "getVolatile char value");
         }
 
         // Lazy
         {
             char x = (char) vh.getAcquire();
-            assertEquals(x, 'a', "getRelease char value");
+            assertEquals(x, '\u0123', "getRelease char value");
         }
 
         // Opaque
         {
             char x = (char) vh.getOpaque();
-            assertEquals(x, 'a', "getOpaque char value");
+            assertEquals(x, '\u0123', "getOpaque char value");
         }
     }
 
     static void testStaticFinalFieldUnsupported(VarHandle vh) {
         checkUOE(() -> {
-            vh.set('b');
-        });
-
-        checkUOE(() -> {
-            vh.setVolatile('b');
-        });
-
-        checkUOE(() -> {
-            vh.setRelease('b');
+            vh.set('\u4567');
         });
 
         checkUOE(() -> {
-            vh.setOpaque('b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet('a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeVolatile('a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeAcquire('a', 'b');
+            vh.setVolatile('\u4567');
         });
 
         checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeRelease('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile('a', 'b');
+            vh.setRelease('\u4567');
         });
 
         checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease('a', 'b');
+            vh.setOpaque('\u4567');
         });
 
-        checkUOE(() -> {
-            char r = (char) vh.getAndSet('a');
-        });
 
-        checkUOE(() -> {
-            char o = (char) vh.getAndAdd('a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.addAndGet('a');
-        });
     }
 
 
     static void testInstanceField(VarHandleTestAccessChar recv, VarHandle vh) {
         // Plain
         {
-            vh.set(recv, 'a');
+            vh.set(recv, '\u0123');
             char x = (char) vh.get(recv);
-            assertEquals(x, 'a', "set char value");
+            assertEquals(x, '\u0123', "set char value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(recv, 'b');
+            vh.setVolatile(recv, '\u4567');
             char x = (char) vh.getVolatile(recv);
-            assertEquals(x, 'b', "setVolatile char value");
+            assertEquals(x, '\u4567', "setVolatile char value");
         }
 
         // Lazy
         {
-            vh.setRelease(recv, 'a');
+            vh.setRelease(recv, '\u0123');
             char x = (char) vh.getAcquire(recv);
-            assertEquals(x, 'a', "setRelease char value");
+            assertEquals(x, '\u0123', "setRelease char value");
         }
 
         // Opaque
         {
-            vh.setOpaque(recv, 'b');
+            vh.setOpaque(recv, '\u4567');
             char x = (char) vh.getOpaque(recv);
-            assertEquals(x, 'b', "setOpaque char value");
+            assertEquals(x, '\u4567', "setOpaque char value");
+        }
+
+        vh.set(recv, '\u0123');
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet(recv, '\u0123', '\u4567');
+            assertEquals(r, true, "success compareAndSet char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "success compareAndSet char value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(recv, '\u0123', '\u89AB');
+            assertEquals(r, false, "failing compareAndSet char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "failing compareAndSet char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchange(recv, '\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchange char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u0123', "success compareAndExchange char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchange(recv, '\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchange char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u0123', "failing compareAndExchange char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchangeAcquire(recv, '\u0123', '\u4567');
+            assertEquals(r, '\u0123', "success compareAndExchangeAcquire char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "success compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchangeAcquire(recv, '\u0123', '\u89AB');
+            assertEquals(r, '\u4567', "failing compareAndExchangeAcquire char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "failing compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchangeRelease(recv, '\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchangeRelease char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u0123', "success compareAndExchangeRelease char value");
         }
 
+        {
+            char r = (char) vh.compareAndExchangeRelease(recv, '\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchangeRelease char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u0123', "failing compareAndExchangeRelease char value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(recv, '\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSet char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "weakCompareAndSet char value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(recv, '\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u0123', "weakCompareAndSetAcquire char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(recv, '\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "weakCompareAndSetRelease char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetVolatile(recv, '\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u0123', "weakCompareAndSetVolatile char value");
+        }
+
+        // Compare set and get
+        {
+            char o = (char) vh.getAndSet(recv, '\u4567');
+            assertEquals(o, '\u0123', "getAndSet char");
+            char x = (char) vh.get(recv);
+            assertEquals(x, '\u4567', "getAndSet char value");
+        }
+
+        vh.set(recv, '\u0123');
+
+        // get and add, add and get
+        {
+            char o = (char) vh.getAndAdd(recv, '\u89AB');
+            assertEquals(o, '\u0123', "getAndAdd char");
+            char c = (char) vh.addAndGet(recv, '\u89AB');
+            assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestAccessChar recv, VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, 'a', 'b');
-        });
 
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeVolatile(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeAcquire(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeRelease(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.getAndSet(recv, 'a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.getAndAdd(recv, 'a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.addAndGet(recv, 'a');
-        });
     }
 
 
     static void testStaticField(VarHandle vh) {
         // Plain
         {
-            vh.set('a');
+            vh.set('\u0123');
             char x = (char) vh.get();
-            assertEquals(x, 'a', "set char value");
+            assertEquals(x, '\u0123', "set char value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile('b');
+            vh.setVolatile('\u4567');
             char x = (char) vh.getVolatile();
-            assertEquals(x, 'b', "setVolatile char value");
+            assertEquals(x, '\u4567', "setVolatile char value");
         }
 
         // Lazy
         {
-            vh.setRelease('a');
+            vh.setRelease('\u0123');
             char x = (char) vh.getAcquire();
-            assertEquals(x, 'a', "setRelease char value");
+            assertEquals(x, '\u0123', "setRelease char value");
         }
 
         // Opaque
         {
-            vh.setOpaque('b');
+            vh.setOpaque('\u4567');
             char x = (char) vh.getOpaque();
-            assertEquals(x, 'b', "setOpaque char value");
+            assertEquals(x, '\u4567', "setOpaque char value");
+        }
+
+        vh.set('\u0123');
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet('\u0123', '\u4567');
+            assertEquals(r, true, "success compareAndSet char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "success compareAndSet char value");
+        }
+
+        {
+            boolean r = vh.compareAndSet('\u0123', '\u89AB');
+            assertEquals(r, false, "failing compareAndSet char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "failing compareAndSet char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchange('\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchange char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u0123', "success compareAndExchange char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchange('\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchange char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u0123', "failing compareAndExchange char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchangeAcquire('\u0123', '\u4567');
+            assertEquals(r, '\u0123', "success compareAndExchangeAcquire char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "success compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchangeAcquire('\u0123', '\u89AB');
+            assertEquals(r, '\u4567', "failing compareAndExchangeAcquire char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "failing compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) vh.compareAndExchangeRelease('\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchangeRelease char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u0123', "success compareAndExchangeRelease char value");
         }
 
+        {
+            char r = (char) vh.compareAndExchangeRelease('\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchangeRelease char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u0123', "failing compareAndExchangeRelease char value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet('\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSet char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "weakCompareAndSet char value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire('\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u0123', "weakCompareAndSetAcquire char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease('\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "weakCompareAndSetRelease char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease('\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+        }
+
+        // Compare set and get
+        {
+            char o = (char) vh.getAndSet('\u4567');
+            assertEquals(o, '\u0123', "getAndSet char");
+            char x = (char) vh.get();
+            assertEquals(x, '\u4567', "getAndSet char value");
+        }
+
+        vh.set('\u0123');
+
+        // get and add, add and get
+        {
+            char o = (char) vh.getAndAdd( '\u89AB');
+            assertEquals(o, '\u0123', "getAndAdd char");
+            char c = (char) vh.addAndGet('\u89AB');
+            assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+        }
     }
 
     static void testStaticFieldUnsupported(VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet('a', 'b');
-        });
 
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeVolatile('a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeAcquire('a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeRelease('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire('a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease('a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.getAndSet('a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.getAndAdd('a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.addAndGet('a');
-        });
     }
 
 
@@ -562,34 +624,149 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                vh.set(array, i, 'a');
+                vh.set(array, i, '\u0123');
                 char x = (char) vh.get(array, i);
-                assertEquals(x, 'a', "get char value");
+                assertEquals(x, '\u0123', "get char value");
             }
 
 
             // Volatile
             {
-                vh.setVolatile(array, i, 'b');
+                vh.setVolatile(array, i, '\u4567');
                 char x = (char) vh.getVolatile(array, i);
-                assertEquals(x, 'b', "setVolatile char value");
+                assertEquals(x, '\u4567', "setVolatile char value");
             }
 
             // Lazy
             {
-                vh.setRelease(array, i, 'a');
+                vh.setRelease(array, i, '\u0123');
                 char x = (char) vh.getAcquire(array, i);
-                assertEquals(x, 'a', "setRelease char value");
+                assertEquals(x, '\u0123', "setRelease char value");
             }
 
             // Opaque
             {
-                vh.setOpaque(array, i, 'b');
+                vh.setOpaque(array, i, '\u4567');
                 char x = (char) vh.getOpaque(array, i);
-                assertEquals(x, 'b', "setOpaque char value");
+                assertEquals(x, '\u4567', "setOpaque char value");
+            }
+
+            vh.set(array, i, '\u0123');
+
+            // Compare
+            {
+                boolean r = vh.compareAndSet(array, i, '\u0123', '\u4567');
+                assertEquals(r, true, "success compareAndSet char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "success compareAndSet char value");
+            }
+
+            {
+                boolean r = vh.compareAndSet(array, i, '\u0123', '\u89AB');
+                assertEquals(r, false, "failing compareAndSet char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "failing compareAndSet char value");
+            }
+
+            {
+                char r = (char) vh.compareAndExchange(array, i, '\u4567', '\u0123');
+                assertEquals(r, '\u4567', "success compareAndExchange char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u0123', "success compareAndExchange char value");
+            }
+
+            {
+                char r = (char) vh.compareAndExchange(array, i, '\u4567', '\u89AB');
+                assertEquals(r, '\u0123', "failing compareAndExchange char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u0123', "failing compareAndExchange char value");
+            }
+
+            {
+                char r = (char) vh.compareAndExchangeAcquire(array, i, '\u0123', '\u4567');
+                assertEquals(r, '\u0123', "success compareAndExchangeAcquire char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "success compareAndExchangeAcquire char value");
+            }
+
+            {
+                char r = (char) vh.compareAndExchangeAcquire(array, i, '\u0123', '\u89AB');
+                assertEquals(r, '\u4567', "failing compareAndExchangeAcquire char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "failing compareAndExchangeAcquire char value");
+            }
+
+            {
+                char r = (char) vh.compareAndExchangeRelease(array, i, '\u4567', '\u0123');
+                assertEquals(r, '\u4567', "success compareAndExchangeRelease char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u0123', "success compareAndExchangeRelease char value");
             }
 
+            {
+                char r = (char) vh.compareAndExchangeRelease(array, i, '\u4567', '\u89AB');
+                assertEquals(r, '\u0123', "failing compareAndExchangeRelease char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u0123', "failing compareAndExchangeRelease char value");
+            }
 
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSet(array, i, '\u0123', '\u4567');
+                }
+                assertEquals(success, true, "weakCompareAndSet char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "weakCompareAndSet char value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetAcquire(array, i, '\u4567', '\u0123');
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u0123', "weakCompareAndSetAcquire char");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetRelease(array, i, '\u0123', '\u4567');
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "weakCompareAndSetRelease char");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetVolatile(array, i, '\u4567', '\u0123');
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+            }
+
+            // Compare set and get
+            {
+                char o = (char) vh.getAndSet(array, i, '\u4567');
+                assertEquals(o, '\u0123', "getAndSet char");
+                char x = (char) vh.get(array, i);
+                assertEquals(x, '\u4567', "getAndSet char value");
+            }
+
+            vh.set(array, i, '\u0123');
+
+            // get and add, add and get
+            {
+                char o = (char) vh.getAndAdd(array, i, '\u89AB');
+                assertEquals(o, '\u0123', "getAndAdd char");
+                char c = (char) vh.addAndGet(array, i, '\u89AB');
+                assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+            }
         }
     }
 
@@ -597,49 +774,7 @@
         char[] array = new char[10];
 
         int i = 0;
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(array, i, 'a', 'b');
-        });
 
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeVolatile(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeAcquire(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeRelease(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(array, i, 'a', 'b');
-        });
-
-        checkUOE(() -> {
-            char r = (char) vh.getAndSet(array, i, 'a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.getAndAdd(array, i, 'a');
-        });
-
-        checkUOE(() -> {
-            char o = (char) vh.addAndGet(array, i, 'a');
-        });
     }
 
     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -653,7 +788,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.set(array, ci, 'a');
+                vh.set(array, ci, '\u0123');
             });
 
             checkIOOBE(() -> {
@@ -661,7 +796,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setVolatile(array, ci, 'a');
+                vh.setVolatile(array, ci, '\u0123');
             });
 
             checkIOOBE(() -> {
@@ -669,7 +804,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setRelease(array, ci, 'a');
+                vh.setRelease(array, ci, '\u0123');
             });
 
             checkIOOBE(() -> {
@@ -677,10 +812,52 @@
             });
 
             checkIOOBE(() -> {
-                vh.setOpaque(array, ci, 'a');
+                vh.setOpaque(array, ci, '\u0123');
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.compareAndSet(array, ci, '\u0123', '\u4567');
+            });
+
+            checkIOOBE(() -> {
+                char r = (char) vh.compareAndExchange(array, ci, '\u4567', '\u0123');
+            });
+
+            checkIOOBE(() -> {
+                char r = (char) vh.compareAndExchangeAcquire(array, ci, '\u4567', '\u0123');
+            });
+
+            checkIOOBE(() -> {
+                char r = (char) vh.compareAndExchangeRelease(array, ci, '\u4567', '\u0123');
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSet(array, ci, '\u0123', '\u4567');
             });
 
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, '\u0123', '\u4567');
+            });
 
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, '\u0123', '\u4567');
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetRelease(array, ci, '\u0123', '\u4567');
+            });
+
+            checkIOOBE(() -> {
+                char o = (char) vh.getAndSet(array, ci, '\u0123');
+            });
+
+            checkIOOBE(() -> {
+                char o = (char) vh.getAndAdd(array, ci, '\u89AB');
+            });
+
+            checkIOOBE(() -> {
+                char o = (char) vh.addAndGet(array, ci, '\u89AB');
+            });
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java	Thu Jul 07 18:35:29 2016 +0000
@@ -99,18 +99,18 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
     }
 
 
@@ -260,49 +260,7 @@
             vh.setOpaque(recv, 2.0d);
         });
 
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, 1.0d, 2.0d);
-        });
 
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeVolatile(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeAcquire(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeRelease(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.getAndSet(recv, 1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.getAndAdd(recv, 1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.addAndGet(recv, 1.0d);
-        });
     }
 
 
@@ -350,49 +308,7 @@
             vh.setOpaque(2.0d);
         });
 
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(1.0d, 2.0d);
-        });
 
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeVolatile(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeAcquire(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeRelease(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.getAndSet(1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.getAndAdd(1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.addAndGet(1.0d);
-        });
     }
 
 
@@ -426,53 +342,126 @@
             assertEquals(x, 2.0d, "setOpaque double value");
         }
 
+        vh.set(recv, 1.0d);
 
+        // Compare
+        {
+            boolean r = vh.compareAndSet(recv, 1.0d, 2.0d);
+            assertEquals(r, true, "success compareAndSet double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "success compareAndSet double value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(recv, 1.0d, 3.0d);
+            assertEquals(r, false, "failing compareAndSet double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "failing compareAndSet double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchange(recv, 2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchange double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 1.0d, "success compareAndExchange double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchange(recv, 2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchange double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 1.0d, "failing compareAndExchange double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeAcquire(recv, 1.0d, 2.0d);
+            assertEquals(r, 1.0d, "success compareAndExchangeAcquire double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "success compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeAcquire(recv, 1.0d, 3.0d);
+            assertEquals(r, 2.0d, "failing compareAndExchangeAcquire double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "failing compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeRelease(recv, 2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchangeRelease double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 1.0d, "success compareAndExchangeRelease double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeRelease(recv, 2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchangeRelease double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 1.0d, "failing compareAndExchangeRelease double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(recv, 1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSet double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "weakCompareAndSet double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(recv, 2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 1.0d, "weakCompareAndSetAcquire double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(recv, 1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "weakCompareAndSetRelease double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetVolatile(recv, 2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 1.0d, "weakCompareAndSetVolatile double value");
+        }
+
+        // Compare set and get
+        {
+            double o = (double) vh.getAndSet(recv, 2.0d);
+            assertEquals(o, 1.0d, "getAndSet double");
+            double x = (double) vh.get(recv);
+            assertEquals(x, 2.0d, "getAndSet double value");
+        }
+
+        vh.set(recv, 1.0d);
+
+        // get and add, add and get
+        {
+            double o = (double) vh.getAndAdd(recv, 3.0d);
+            assertEquals(o, 1.0d, "getAndAdd double");
+            double c = (double) vh.addAndGet(recv, 3.0d);
+            assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestAccessDouble recv, VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, 1.0d, 2.0d);
-        });
 
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeVolatile(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeAcquire(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeRelease(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.getAndSet(recv, 1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.getAndAdd(recv, 1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.addAndGet(recv, 1.0d);
-        });
     }
 
 
@@ -506,53 +495,126 @@
             assertEquals(x, 2.0d, "setOpaque double value");
         }
 
+        vh.set(1.0d);
 
+        // Compare
+        {
+            boolean r = vh.compareAndSet(1.0d, 2.0d);
+            assertEquals(r, true, "success compareAndSet double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "success compareAndSet double value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(1.0d, 3.0d);
+            assertEquals(r, false, "failing compareAndSet double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "failing compareAndSet double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchange(2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchange double");
+            double x = (double) vh.get();
+            assertEquals(x, 1.0d, "success compareAndExchange double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchange(2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchange double");
+            double x = (double) vh.get();
+            assertEquals(x, 1.0d, "failing compareAndExchange double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeAcquire(1.0d, 2.0d);
+            assertEquals(r, 1.0d, "success compareAndExchangeAcquire double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "success compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeAcquire(1.0d, 3.0d);
+            assertEquals(r, 2.0d, "failing compareAndExchangeAcquire double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "failing compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeRelease(2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchangeRelease double");
+            double x = (double) vh.get();
+            assertEquals(x, 1.0d, "success compareAndExchangeRelease double value");
+        }
+
+        {
+            double r = (double) vh.compareAndExchangeRelease(2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchangeRelease double");
+            double x = (double) vh.get();
+            assertEquals(x, 1.0d, "failing compareAndExchangeRelease double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSet double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "weakCompareAndSet double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire double");
+            double x = (double) vh.get();
+            assertEquals(x, 1.0d, "weakCompareAndSetAcquire double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "weakCompareAndSetRelease double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile double");
+            double x = (double) vh.get();
+            assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+        }
+
+        // Compare set and get
+        {
+            double o = (double) vh.getAndSet(2.0d);
+            assertEquals(o, 1.0d, "getAndSet double");
+            double x = (double) vh.get();
+            assertEquals(x, 2.0d, "getAndSet double value");
+        }
+
+        vh.set(1.0d);
+
+        // get and add, add and get
+        {
+            double o = (double) vh.getAndAdd( 3.0d);
+            assertEquals(o, 1.0d, "getAndAdd double");
+            double c = (double) vh.addAndGet(3.0d);
+            assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+        }
     }
 
     static void testStaticFieldUnsupported(VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(1.0d, 2.0d);
-        });
 
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeVolatile(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeAcquire(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeRelease(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.getAndSet(1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.getAndAdd(1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.addAndGet(1.0d);
-        });
     }
 
 
@@ -589,7 +651,122 @@
                 assertEquals(x, 2.0d, "setOpaque double value");
             }
 
+            vh.set(array, i, 1.0d);
 
+            // Compare
+            {
+                boolean r = vh.compareAndSet(array, i, 1.0d, 2.0d);
+                assertEquals(r, true, "success compareAndSet double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "success compareAndSet double value");
+            }
+
+            {
+                boolean r = vh.compareAndSet(array, i, 1.0d, 3.0d);
+                assertEquals(r, false, "failing compareAndSet double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "failing compareAndSet double value");
+            }
+
+            {
+                double r = (double) vh.compareAndExchange(array, i, 2.0d, 1.0d);
+                assertEquals(r, 2.0d, "success compareAndExchange double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 1.0d, "success compareAndExchange double value");
+            }
+
+            {
+                double r = (double) vh.compareAndExchange(array, i, 2.0d, 3.0d);
+                assertEquals(r, 1.0d, "failing compareAndExchange double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 1.0d, "failing compareAndExchange double value");
+            }
+
+            {
+                double r = (double) vh.compareAndExchangeAcquire(array, i, 1.0d, 2.0d);
+                assertEquals(r, 1.0d, "success compareAndExchangeAcquire double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "success compareAndExchangeAcquire double value");
+            }
+
+            {
+                double r = (double) vh.compareAndExchangeAcquire(array, i, 1.0d, 3.0d);
+                assertEquals(r, 2.0d, "failing compareAndExchangeAcquire double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "failing compareAndExchangeAcquire double value");
+            }
+
+            {
+                double r = (double) vh.compareAndExchangeRelease(array, i, 2.0d, 1.0d);
+                assertEquals(r, 2.0d, "success compareAndExchangeRelease double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 1.0d, "success compareAndExchangeRelease double value");
+            }
+
+            {
+                double r = (double) vh.compareAndExchangeRelease(array, i, 2.0d, 3.0d);
+                assertEquals(r, 1.0d, "failing compareAndExchangeRelease double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 1.0d, "failing compareAndExchangeRelease double value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSet(array, i, 1.0d, 2.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSet double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "weakCompareAndSet double value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetAcquire(array, i, 2.0d, 1.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 1.0d, "weakCompareAndSetAcquire double");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetRelease(array, i, 1.0d, 2.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "weakCompareAndSetRelease double");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetVolatile(array, i, 2.0d, 1.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+            }
+
+            // Compare set and get
+            {
+                double o = (double) vh.getAndSet(array, i, 2.0d);
+                assertEquals(o, 1.0d, "getAndSet double");
+                double x = (double) vh.get(array, i);
+                assertEquals(x, 2.0d, "getAndSet double value");
+            }
+
+            vh.set(array, i, 1.0d);
+
+            // get and add, add and get
+            {
+                double o = (double) vh.getAndAdd(array, i, 3.0d);
+                assertEquals(o, 1.0d, "getAndAdd double");
+                double c = (double) vh.addAndGet(array, i, 3.0d);
+                assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+            }
         }
     }
 
@@ -597,49 +774,7 @@
         double[] array = new double[10];
 
         int i = 0;
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(array, i, 1.0d, 2.0d);
-        });
 
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeVolatile(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeAcquire(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.compareAndExchangeRelease(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(array, i, 1.0d, 2.0d);
-        });
-
-        checkUOE(() -> {
-            double r = (double) vh.getAndSet(array, i, 1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.getAndAdd(array, i, 1.0d);
-        });
-
-        checkUOE(() -> {
-            double o = (double) vh.addAndGet(array, i, 1.0d);
-        });
     }
 
     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -680,7 +815,49 @@
                 vh.setOpaque(array, ci, 1.0d);
             });
 
+            checkIOOBE(() -> {
+                boolean r = vh.compareAndSet(array, ci, 1.0d, 2.0d);
+            });
 
+            checkIOOBE(() -> {
+                double r = (double) vh.compareAndExchange(array, ci, 2.0d, 1.0d);
+            });
+
+            checkIOOBE(() -> {
+                double r = (double) vh.compareAndExchangeAcquire(array, ci, 2.0d, 1.0d);
+            });
+
+            checkIOOBE(() -> {
+                double r = (double) vh.compareAndExchangeRelease(array, ci, 2.0d, 1.0d);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSet(array, ci, 1.0d, 2.0d);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, 1.0d, 2.0d);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, 1.0d, 2.0d);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetRelease(array, ci, 1.0d, 2.0d);
+            });
+
+            checkIOOBE(() -> {
+                double o = (double) vh.getAndSet(array, ci, 1.0d);
+            });
+
+            checkIOOBE(() -> {
+                double o = (double) vh.getAndAdd(array, ci, 3.0d);
+            });
+
+            checkIOOBE(() -> {
+                double o = (double) vh.addAndGet(array, ci, 3.0d);
+            });
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessFloat.java	Thu Jul 07 18:35:29 2016 +0000
@@ -99,18 +99,18 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
     }
 
 
@@ -260,49 +260,7 @@
             vh.setOpaque(recv, 2.0f);
         });
 
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, 1.0f, 2.0f);
-        });
 
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeVolatile(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeAcquire(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeRelease(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.getAndSet(recv, 1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.getAndAdd(recv, 1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.addAndGet(recv, 1.0f);
-        });
     }
 
 
@@ -350,49 +308,7 @@
             vh.setOpaque(2.0f);
         });
 
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(1.0f, 2.0f);
-        });
 
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeVolatile(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeAcquire(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeRelease(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.getAndSet(1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.getAndAdd(1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.addAndGet(1.0f);
-        });
     }
 
 
@@ -426,53 +342,126 @@
             assertEquals(x, 2.0f, "setOpaque float value");
         }
 
+        vh.set(recv, 1.0f);
 
+        // Compare
+        {
+            boolean r = vh.compareAndSet(recv, 1.0f, 2.0f);
+            assertEquals(r, true, "success compareAndSet float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "success compareAndSet float value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(recv, 1.0f, 3.0f);
+            assertEquals(r, false, "failing compareAndSet float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "failing compareAndSet float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchange(recv, 2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchange float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 1.0f, "success compareAndExchange float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchange(recv, 2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchange float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 1.0f, "failing compareAndExchange float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeAcquire(recv, 1.0f, 2.0f);
+            assertEquals(r, 1.0f, "success compareAndExchangeAcquire float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "success compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeAcquire(recv, 1.0f, 3.0f);
+            assertEquals(r, 2.0f, "failing compareAndExchangeAcquire float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "failing compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeRelease(recv, 2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchangeRelease float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 1.0f, "success compareAndExchangeRelease float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeRelease(recv, 2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchangeRelease float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 1.0f, "failing compareAndExchangeRelease float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(recv, 1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSet float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "weakCompareAndSet float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(recv, 2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 1.0f, "weakCompareAndSetAcquire float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(recv, 1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "weakCompareAndSetRelease float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetVolatile(recv, 2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 1.0f, "weakCompareAndSetVolatile float value");
+        }
+
+        // Compare set and get
+        {
+            float o = (float) vh.getAndSet(recv, 2.0f);
+            assertEquals(o, 1.0f, "getAndSet float");
+            float x = (float) vh.get(recv);
+            assertEquals(x, 2.0f, "getAndSet float value");
+        }
+
+        vh.set(recv, 1.0f);
+
+        // get and add, add and get
+        {
+            float o = (float) vh.getAndAdd(recv, 3.0f);
+            assertEquals(o, 1.0f, "getAndAdd float");
+            float c = (float) vh.addAndGet(recv, 3.0f);
+            assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestAccessFloat recv, VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, 1.0f, 2.0f);
-        });
 
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeVolatile(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeAcquire(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeRelease(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.getAndSet(recv, 1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.getAndAdd(recv, 1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.addAndGet(recv, 1.0f);
-        });
     }
 
 
@@ -506,53 +495,126 @@
             assertEquals(x, 2.0f, "setOpaque float value");
         }
 
+        vh.set(1.0f);
 
+        // Compare
+        {
+            boolean r = vh.compareAndSet(1.0f, 2.0f);
+            assertEquals(r, true, "success compareAndSet float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "success compareAndSet float value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(1.0f, 3.0f);
+            assertEquals(r, false, "failing compareAndSet float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "failing compareAndSet float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchange(2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchange float");
+            float x = (float) vh.get();
+            assertEquals(x, 1.0f, "success compareAndExchange float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchange(2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchange float");
+            float x = (float) vh.get();
+            assertEquals(x, 1.0f, "failing compareAndExchange float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeAcquire(1.0f, 2.0f);
+            assertEquals(r, 1.0f, "success compareAndExchangeAcquire float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "success compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeAcquire(1.0f, 3.0f);
+            assertEquals(r, 2.0f, "failing compareAndExchangeAcquire float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "failing compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeRelease(2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchangeRelease float");
+            float x = (float) vh.get();
+            assertEquals(x, 1.0f, "success compareAndExchangeRelease float value");
+        }
+
+        {
+            float r = (float) vh.compareAndExchangeRelease(2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchangeRelease float");
+            float x = (float) vh.get();
+            assertEquals(x, 1.0f, "failing compareAndExchangeRelease float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSet float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "weakCompareAndSet float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire float");
+            float x = (float) vh.get();
+            assertEquals(x, 1.0f, "weakCompareAndSetAcquire float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "weakCompareAndSetRelease float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile float");
+            float x = (float) vh.get();
+            assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+        }
+
+        // Compare set and get
+        {
+            float o = (float) vh.getAndSet(2.0f);
+            assertEquals(o, 1.0f, "getAndSet float");
+            float x = (float) vh.get();
+            assertEquals(x, 2.0f, "getAndSet float value");
+        }
+
+        vh.set(1.0f);
+
+        // get and add, add and get
+        {
+            float o = (float) vh.getAndAdd( 3.0f);
+            assertEquals(o, 1.0f, "getAndAdd float");
+            float c = (float) vh.addAndGet(3.0f);
+            assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+        }
     }
 
     static void testStaticFieldUnsupported(VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(1.0f, 2.0f);
-        });
 
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeVolatile(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeAcquire(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeRelease(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.getAndSet(1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.getAndAdd(1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.addAndGet(1.0f);
-        });
     }
 
 
@@ -589,7 +651,122 @@
                 assertEquals(x, 2.0f, "setOpaque float value");
             }
 
+            vh.set(array, i, 1.0f);
 
+            // Compare
+            {
+                boolean r = vh.compareAndSet(array, i, 1.0f, 2.0f);
+                assertEquals(r, true, "success compareAndSet float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "success compareAndSet float value");
+            }
+
+            {
+                boolean r = vh.compareAndSet(array, i, 1.0f, 3.0f);
+                assertEquals(r, false, "failing compareAndSet float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "failing compareAndSet float value");
+            }
+
+            {
+                float r = (float) vh.compareAndExchange(array, i, 2.0f, 1.0f);
+                assertEquals(r, 2.0f, "success compareAndExchange float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 1.0f, "success compareAndExchange float value");
+            }
+
+            {
+                float r = (float) vh.compareAndExchange(array, i, 2.0f, 3.0f);
+                assertEquals(r, 1.0f, "failing compareAndExchange float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 1.0f, "failing compareAndExchange float value");
+            }
+
+            {
+                float r = (float) vh.compareAndExchangeAcquire(array, i, 1.0f, 2.0f);
+                assertEquals(r, 1.0f, "success compareAndExchangeAcquire float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "success compareAndExchangeAcquire float value");
+            }
+
+            {
+                float r = (float) vh.compareAndExchangeAcquire(array, i, 1.0f, 3.0f);
+                assertEquals(r, 2.0f, "failing compareAndExchangeAcquire float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "failing compareAndExchangeAcquire float value");
+            }
+
+            {
+                float r = (float) vh.compareAndExchangeRelease(array, i, 2.0f, 1.0f);
+                assertEquals(r, 2.0f, "success compareAndExchangeRelease float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 1.0f, "success compareAndExchangeRelease float value");
+            }
+
+            {
+                float r = (float) vh.compareAndExchangeRelease(array, i, 2.0f, 3.0f);
+                assertEquals(r, 1.0f, "failing compareAndExchangeRelease float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 1.0f, "failing compareAndExchangeRelease float value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSet(array, i, 1.0f, 2.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSet float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "weakCompareAndSet float value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetAcquire(array, i, 2.0f, 1.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 1.0f, "weakCompareAndSetAcquire float");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetRelease(array, i, 1.0f, 2.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "weakCompareAndSetRelease float");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetVolatile(array, i, 2.0f, 1.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+            }
+
+            // Compare set and get
+            {
+                float o = (float) vh.getAndSet(array, i, 2.0f);
+                assertEquals(o, 1.0f, "getAndSet float");
+                float x = (float) vh.get(array, i);
+                assertEquals(x, 2.0f, "getAndSet float value");
+            }
+
+            vh.set(array, i, 1.0f);
+
+            // get and add, add and get
+            {
+                float o = (float) vh.getAndAdd(array, i, 3.0f);
+                assertEquals(o, 1.0f, "getAndAdd float");
+                float c = (float) vh.addAndGet(array, i, 3.0f);
+                assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+            }
         }
     }
 
@@ -597,49 +774,7 @@
         float[] array = new float[10];
 
         int i = 0;
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(array, i, 1.0f, 2.0f);
-        });
 
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeVolatile(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeAcquire(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.compareAndExchangeRelease(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(array, i, 1.0f, 2.0f);
-        });
-
-        checkUOE(() -> {
-            float r = (float) vh.getAndSet(array, i, 1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.getAndAdd(array, i, 1.0f);
-        });
-
-        checkUOE(() -> {
-            float o = (float) vh.addAndGet(array, i, 1.0f);
-        });
     }
 
     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -680,7 +815,49 @@
                 vh.setOpaque(array, ci, 1.0f);
             });
 
+            checkIOOBE(() -> {
+                boolean r = vh.compareAndSet(array, ci, 1.0f, 2.0f);
+            });
 
+            checkIOOBE(() -> {
+                float r = (float) vh.compareAndExchange(array, ci, 2.0f, 1.0f);
+            });
+
+            checkIOOBE(() -> {
+                float r = (float) vh.compareAndExchangeAcquire(array, ci, 2.0f, 1.0f);
+            });
+
+            checkIOOBE(() -> {
+                float r = (float) vh.compareAndExchangeRelease(array, ci, 2.0f, 1.0f);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSet(array, ci, 1.0f, 2.0f);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, 1.0f, 2.0f);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, 1.0f, 2.0f);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetRelease(array, ci, 1.0f, 2.0f);
+            });
+
+            checkIOOBE(() -> {
+                float o = (float) vh.getAndSet(array, ci, 1.0f);
+            });
+
+            checkIOOBE(() -> {
+                float o = (float) vh.getAndAdd(array, ci, 3.0f);
+            });
+
+            checkIOOBE(() -> {
+                float o = (float) vh.addAndGet(array, ci, 3.0f);
+            });
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java	Thu Jul 07 18:35:29 2016 +0000
@@ -42,11 +42,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestAccessInt extends VarHandleBaseTest {
-    static final int static_final_v = 1;
+    static final int static_final_v = 0x01234567;
 
     static int static_v;
 
-    final int final_v = 1;
+    final int final_v = 0x01234567;
 
     int v;
 
@@ -100,7 +100,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -220,44 +220,44 @@
         // Plain
         {
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "get int value");
+            assertEquals(x, 0x01234567, "get int value");
         }
 
 
         // Volatile
         {
             int x = (int) vh.getVolatile(recv);
-            assertEquals(x, 1, "getVolatile int value");
+            assertEquals(x, 0x01234567, "getVolatile int value");
         }
 
         // Lazy
         {
             int x = (int) vh.getAcquire(recv);
-            assertEquals(x, 1, "getRelease int value");
+            assertEquals(x, 0x01234567, "getRelease int value");
         }
 
         // Opaque
         {
             int x = (int) vh.getOpaque(recv);
-            assertEquals(x, 1, "getOpaque int value");
+            assertEquals(x, 0x01234567, "getOpaque int value");
         }
     }
 
     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessInt recv, VarHandle vh) {
         checkUOE(() -> {
-            vh.set(recv, 2);
+            vh.set(recv, 0x89ABCDEF);
         });
 
         checkUOE(() -> {
-            vh.setVolatile(recv, 2);
+            vh.setVolatile(recv, 0x89ABCDEF);
         });
 
         checkUOE(() -> {
-            vh.setRelease(recv, 2);
+            vh.setRelease(recv, 0x89ABCDEF);
         });
 
         checkUOE(() -> {
-            vh.setOpaque(recv, 2);
+            vh.setOpaque(recv, 0x89ABCDEF);
         });
 
 
@@ -268,44 +268,44 @@
         // Plain
         {
             int x = (int) vh.get();
-            assertEquals(x, 1, "get int value");
+            assertEquals(x, 0x01234567, "get int value");
         }
 
 
         // Volatile
         {
             int x = (int) vh.getVolatile();
-            assertEquals(x, 1, "getVolatile int value");
+            assertEquals(x, 0x01234567, "getVolatile int value");
         }
 
         // Lazy
         {
             int x = (int) vh.getAcquire();
-            assertEquals(x, 1, "getRelease int value");
+            assertEquals(x, 0x01234567, "getRelease int value");
         }
 
         // Opaque
         {
             int x = (int) vh.getOpaque();
-            assertEquals(x, 1, "getOpaque int value");
+            assertEquals(x, 0x01234567, "getOpaque int value");
         }
     }
 
     static void testStaticFinalFieldUnsupported(VarHandle vh) {
         checkUOE(() -> {
-            vh.set(2);
+            vh.set(0x89ABCDEF);
         });
 
         checkUOE(() -> {
-            vh.setVolatile(2);
+            vh.setVolatile(0x89ABCDEF);
         });
 
         checkUOE(() -> {
-            vh.setRelease(2);
+            vh.setRelease(0x89ABCDEF);
         });
 
         checkUOE(() -> {
-            vh.setOpaque(2);
+            vh.setOpaque(0x89ABCDEF);
         });
 
 
@@ -315,148 +315,148 @@
     static void testInstanceField(VarHandleTestAccessInt recv, VarHandle vh) {
         // Plain
         {
-            vh.set(recv, 1);
+            vh.set(recv, 0x01234567);
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "set int value");
+            assertEquals(x, 0x01234567, "set int value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(recv, 2);
+            vh.setVolatile(recv, 0x89ABCDEF);
             int x = (int) vh.getVolatile(recv);
-            assertEquals(x, 2, "setVolatile int value");
+            assertEquals(x, 0x89ABCDEF, "setVolatile int value");
         }
 
         // Lazy
         {
-            vh.setRelease(recv, 1);
+            vh.setRelease(recv, 0x01234567);
             int x = (int) vh.getAcquire(recv);
-            assertEquals(x, 1, "setRelease int value");
+            assertEquals(x, 0x01234567, "setRelease int value");
         }
 
         // Opaque
         {
-            vh.setOpaque(recv, 2);
+            vh.setOpaque(recv, 0x89ABCDEF);
             int x = (int) vh.getOpaque(recv);
-            assertEquals(x, 2, "setOpaque int value");
+            assertEquals(x, 0x89ABCDEF, "setOpaque int value");
         }
 
-        vh.set(recv, 1);
+        vh.set(recv, 0x01234567);
 
         // Compare
         {
-            boolean r = vh.compareAndSet(recv, 1, 2);
+            boolean r = vh.compareAndSet(recv, 0x01234567, 0x89ABCDEF);
             assertEquals(r, true, "success compareAndSet int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "success compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndSet int value");
         }
 
         {
-            boolean r = vh.compareAndSet(recv, 1, 3);
+            boolean r = vh.compareAndSet(recv, 0x01234567, 0xCAFEBABE);
             assertEquals(r, false, "failing compareAndSet int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "failing compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeVolatile(recv, 2, 1);
-            assertEquals(r, 2, "success compareAndExchangeVolatile int");
+            int r = (int) vh.compareAndExchange(recv, 0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "success compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "success compareAndExchange int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeVolatile(recv, 2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeVolatile int");
+            int r = (int) vh.compareAndExchange(recv, 0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchange int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "failing compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchange int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeAcquire(recv, 1, 2);
-            assertEquals(r, 1, "success compareAndExchangeAcquire int");
+            int r = (int) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x89ABCDEF);
+            assertEquals(r, 0x01234567, "success compareAndExchangeAcquire int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "success compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeAcquire(recv, 1, 3);
-            assertEquals(r, 2, "failing compareAndExchangeAcquire int");
+            int r = (int) vh.compareAndExchangeAcquire(recv, 0x01234567, 0xCAFEBABE);
+            assertEquals(r, 0x89ABCDEF, "failing compareAndExchangeAcquire int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "failing compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeRelease(recv, 2, 1);
-            assertEquals(r, 2, "success compareAndExchangeRelease int");
+            int r = (int) vh.compareAndExchangeRelease(recv, 0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchangeRelease int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "success compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "success compareAndExchangeRelease int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeRelease(recv, 2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeRelease int");
+            int r = (int) vh.compareAndExchangeRelease(recv, 0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchangeRelease int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "failing compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchangeRelease int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSet(recv, 1, 2);
+                success = vh.weakCompareAndSet(recv, 0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSet int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "weakCompareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetAcquire(recv, 2, 1);
+                success = vh.weakCompareAndSetAcquire(recv, 0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "weakCompareAndSetAcquire int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetRelease(recv, 1, 2);
+                success = vh.weakCompareAndSetRelease(recv, 0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSetRelease int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "weakCompareAndSetRelease int");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetVolatile(recv, 2, 1);
+                success = vh.weakCompareAndSetVolatile(recv, 0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 1, "weakCompareAndSetVolatile int value");
+            assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int value");
         }
 
         // Compare set and get
         {
-            int o = (int) vh.getAndSet(recv, 2);
-            assertEquals(o, 1, "getAndSet int");
+            int o = (int) vh.getAndSet(recv, 0x89ABCDEF);
+            assertEquals(o, 0x01234567, "getAndSet int");
             int x = (int) vh.get(recv);
-            assertEquals(x, 2, "getAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "getAndSet int value");
         }
 
-        vh.set(recv, 1);
+        vh.set(recv, 0x01234567);
 
         // get and add, add and get
         {
-            int o = (int) vh.getAndAdd(recv, 3);
-            assertEquals(o, 1, "getAndAdd int");
-            int c = (int) vh.addAndGet(recv, 3);
-            assertEquals(c, 1 + 3 + 3, "getAndAdd int value");
+            int o = (int) vh.getAndAdd(recv, 0xCAFEBABE);
+            assertEquals(o, 0x01234567, "getAndAdd int");
+            int c = (int) vh.addAndGet(recv, 0xCAFEBABE);
+            assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
         }
     }
 
@@ -468,148 +468,148 @@
     static void testStaticField(VarHandle vh) {
         // Plain
         {
-            vh.set(1);
+            vh.set(0x01234567);
             int x = (int) vh.get();
-            assertEquals(x, 1, "set int value");
+            assertEquals(x, 0x01234567, "set int value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(2);
+            vh.setVolatile(0x89ABCDEF);
             int x = (int) vh.getVolatile();
-            assertEquals(x, 2, "setVolatile int value");
+            assertEquals(x, 0x89ABCDEF, "setVolatile int value");
         }
 
         // Lazy
         {
-            vh.setRelease(1);
+            vh.setRelease(0x01234567);
             int x = (int) vh.getAcquire();
-            assertEquals(x, 1, "setRelease int value");
+            assertEquals(x, 0x01234567, "setRelease int value");
         }
 
         // Opaque
         {
-            vh.setOpaque(2);
+            vh.setOpaque(0x89ABCDEF);
             int x = (int) vh.getOpaque();
-            assertEquals(x, 2, "setOpaque int value");
+            assertEquals(x, 0x89ABCDEF, "setOpaque int value");
         }
 
-        vh.set(1);
+        vh.set(0x01234567);
 
         // Compare
         {
-            boolean r = vh.compareAndSet(1, 2);
+            boolean r = vh.compareAndSet(0x01234567, 0x89ABCDEF);
             assertEquals(r, true, "success compareAndSet int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "success compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndSet int value");
         }
 
         {
-            boolean r = vh.compareAndSet(1, 3);
+            boolean r = vh.compareAndSet(0x01234567, 0xCAFEBABE);
             assertEquals(r, false, "failing compareAndSet int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "failing compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeVolatile(2, 1);
-            assertEquals(r, 2, "success compareAndExchangeVolatile int");
+            int r = (int) vh.compareAndExchange(0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
             int x = (int) vh.get();
-            assertEquals(x, 1, "success compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "success compareAndExchange int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeVolatile(2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeVolatile int");
+            int r = (int) vh.compareAndExchange(0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchange int");
             int x = (int) vh.get();
-            assertEquals(x, 1, "failing compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchange int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeAcquire(1, 2);
-            assertEquals(r, 1, "success compareAndExchangeAcquire int");
+            int r = (int) vh.compareAndExchangeAcquire(0x01234567, 0x89ABCDEF);
+            assertEquals(r, 0x01234567, "success compareAndExchangeAcquire int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "success compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeAcquire(1, 3);
-            assertEquals(r, 2, "failing compareAndExchangeAcquire int");
+            int r = (int) vh.compareAndExchangeAcquire(0x01234567, 0xCAFEBABE);
+            assertEquals(r, 0x89ABCDEF, "failing compareAndExchangeAcquire int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "failing compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeRelease(2, 1);
-            assertEquals(r, 2, "success compareAndExchangeRelease int");
+            int r = (int) vh.compareAndExchangeRelease(0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchangeRelease int");
             int x = (int) vh.get();
-            assertEquals(x, 1, "success compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "success compareAndExchangeRelease int value");
         }
 
         {
-            int r = (int) vh.compareAndExchangeRelease(2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeRelease int");
+            int r = (int) vh.compareAndExchangeRelease(0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchangeRelease int");
             int x = (int) vh.get();
-            assertEquals(x, 1, "failing compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchangeRelease int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSet(1, 2);
+                success = vh.weakCompareAndSet(0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSet int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "weakCompareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetAcquire(2, 1);
+                success = vh.weakCompareAndSetAcquire(0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire int");
             int x = (int) vh.get();
-            assertEquals(x, 1, "weakCompareAndSetAcquire int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetRelease(1, 2);
+                success = vh.weakCompareAndSetRelease(0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSetRelease int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "weakCompareAndSetRelease int");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetRelease(2, 1);
+                success = vh.weakCompareAndSetRelease(0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile int");
             int x = (int) vh.get();
-            assertEquals(x, 1, "weakCompareAndSetVolatile int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
         }
 
         // Compare set and get
         {
-            int o = (int) vh.getAndSet(2);
-            assertEquals(o, 1, "getAndSet int");
+            int o = (int) vh.getAndSet(0x89ABCDEF);
+            assertEquals(o, 0x01234567, "getAndSet int");
             int x = (int) vh.get();
-            assertEquals(x, 2, "getAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "getAndSet int value");
         }
 
-        vh.set(1);
+        vh.set(0x01234567);
 
         // get and add, add and get
         {
-            int o = (int) vh.getAndAdd( 3);
-            assertEquals(o, 1, "getAndAdd int");
-            int c = (int) vh.addAndGet(3);
-            assertEquals(c, 1 + 3 + 3, "getAndAdd int value");
+            int o = (int) vh.getAndAdd( 0xCAFEBABE);
+            assertEquals(o, 0x01234567, "getAndAdd int");
+            int c = (int) vh.addAndGet(0xCAFEBABE);
+            assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
         }
     }
 
@@ -624,148 +624,148 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                vh.set(array, i, 1);
+                vh.set(array, i, 0x01234567);
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "get int value");
+                assertEquals(x, 0x01234567, "get int value");
             }
 
 
             // Volatile
             {
-                vh.setVolatile(array, i, 2);
+                vh.setVolatile(array, i, 0x89ABCDEF);
                 int x = (int) vh.getVolatile(array, i);
-                assertEquals(x, 2, "setVolatile int value");
+                assertEquals(x, 0x89ABCDEF, "setVolatile int value");
             }
 
             // Lazy
             {
-                vh.setRelease(array, i, 1);
+                vh.setRelease(array, i, 0x01234567);
                 int x = (int) vh.getAcquire(array, i);
-                assertEquals(x, 1, "setRelease int value");
+                assertEquals(x, 0x01234567, "setRelease int value");
             }
 
             // Opaque
             {
-                vh.setOpaque(array, i, 2);
+                vh.setOpaque(array, i, 0x89ABCDEF);
                 int x = (int) vh.getOpaque(array, i);
-                assertEquals(x, 2, "setOpaque int value");
+                assertEquals(x, 0x89ABCDEF, "setOpaque int value");
             }
 
-            vh.set(array, i, 1);
+            vh.set(array, i, 0x01234567);
 
             // Compare
             {
-                boolean r = vh.compareAndSet(array, i, 1, 2);
+                boolean r = vh.compareAndSet(array, i, 0x01234567, 0x89ABCDEF);
                 assertEquals(r, true, "success compareAndSet int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "success compareAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "success compareAndSet int value");
             }
 
             {
-                boolean r = vh.compareAndSet(array, i, 1, 3);
+                boolean r = vh.compareAndSet(array, i, 0x01234567, 0xCAFEBABE);
                 assertEquals(r, false, "failing compareAndSet int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "failing compareAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value");
             }
 
             {
-                int r = (int) vh.compareAndExchangeVolatile(array, i, 2, 1);
-                assertEquals(r, 2, "success compareAndExchangeVolatile int");
+                int r = (int) vh.compareAndExchange(array, i, 0x89ABCDEF, 0x01234567);
+                assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "success compareAndExchangeVolatile int value");
+                assertEquals(x, 0x01234567, "success compareAndExchange int value");
             }
 
             {
-                int r = (int) vh.compareAndExchangeVolatile(array, i, 2, 3);
-                assertEquals(r, 1, "failing compareAndExchangeVolatile int");
+                int r = (int) vh.compareAndExchange(array, i, 0x89ABCDEF, 0xCAFEBABE);
+                assertEquals(r, 0x01234567, "failing compareAndExchange int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "failing compareAndExchangeVolatile int value");
+                assertEquals(x, 0x01234567, "failing compareAndExchange int value");
             }
 
             {
-                int r = (int) vh.compareAndExchangeAcquire(array, i, 1, 2);
-                assertEquals(r, 1, "success compareAndExchangeAcquire int");
+                int r = (int) vh.compareAndExchangeAcquire(array, i, 0x01234567, 0x89ABCDEF);
+                assertEquals(r, 0x01234567, "success compareAndExchangeAcquire int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "success compareAndExchangeAcquire int value");
+                assertEquals(x, 0x89ABCDEF, "success compareAndExchangeAcquire int value");
             }
 
             {
-                int r = (int) vh.compareAndExchangeAcquire(array, i, 1, 3);
-                assertEquals(r, 2, "failing compareAndExchangeAcquire int");
+                int r = (int) vh.compareAndExchangeAcquire(array, i, 0x01234567, 0xCAFEBABE);
+                assertEquals(r, 0x89ABCDEF, "failing compareAndExchangeAcquire int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "failing compareAndExchangeAcquire int value");
+                assertEquals(x, 0x89ABCDEF, "failing compareAndExchangeAcquire int value");
             }
 
             {
-                int r = (int) vh.compareAndExchangeRelease(array, i, 2, 1);
-                assertEquals(r, 2, "success compareAndExchangeRelease int");
+                int r = (int) vh.compareAndExchangeRelease(array, i, 0x89ABCDEF, 0x01234567);
+                assertEquals(r, 0x89ABCDEF, "success compareAndExchangeRelease int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "success compareAndExchangeRelease int value");
+                assertEquals(x, 0x01234567, "success compareAndExchangeRelease int value");
             }
 
             {
-                int r = (int) vh.compareAndExchangeRelease(array, i, 2, 3);
-                assertEquals(r, 1, "failing compareAndExchangeRelease int");
+                int r = (int) vh.compareAndExchangeRelease(array, i, 0x89ABCDEF, 0xCAFEBABE);
+                assertEquals(r, 0x01234567, "failing compareAndExchangeRelease int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "failing compareAndExchangeRelease int value");
+                assertEquals(x, 0x01234567, "failing compareAndExchangeRelease int value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSet(array, i, 1, 2);
+                    success = vh.weakCompareAndSet(array, i, 0x01234567, 0x89ABCDEF);
                 }
                 assertEquals(success, true, "weakCompareAndSet int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "weakCompareAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSetAcquire(array, i, 2, 1);
+                    success = vh.weakCompareAndSetAcquire(array, i, 0x89ABCDEF, 0x01234567);
                 }
                 assertEquals(success, true, "weakCompareAndSetAcquire int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "weakCompareAndSetAcquire int");
+                assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSetRelease(array, i, 1, 2);
+                    success = vh.weakCompareAndSetRelease(array, i, 0x01234567, 0x89ABCDEF);
                 }
                 assertEquals(success, true, "weakCompareAndSetRelease int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "weakCompareAndSetRelease int");
+                assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSetVolatile(array, i, 2, 1);
+                    success = vh.weakCompareAndSetVolatile(array, i, 0x89ABCDEF, 0x01234567);
                 }
                 assertEquals(success, true, "weakCompareAndSetVolatile int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 1, "weakCompareAndSetVolatile int");
+                assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
             }
 
             // Compare set and get
             {
-                int o = (int) vh.getAndSet(array, i, 2);
-                assertEquals(o, 1, "getAndSet int");
+                int o = (int) vh.getAndSet(array, i, 0x89ABCDEF);
+                assertEquals(o, 0x01234567, "getAndSet int");
                 int x = (int) vh.get(array, i);
-                assertEquals(x, 2, "getAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "getAndSet int value");
             }
 
-            vh.set(array, i, 1);
+            vh.set(array, i, 0x01234567);
 
             // get and add, add and get
             {
-                int o = (int) vh.getAndAdd(array, i, 3);
-                assertEquals(o, 1, "getAndAdd int");
-                int c = (int) vh.addAndGet(array, i, 3);
-                assertEquals(c, 1 + 3 + 3, "getAndAdd int value");
+                int o = (int) vh.getAndAdd(array, i, 0xCAFEBABE);
+                assertEquals(o, 0x01234567, "getAndAdd int");
+                int c = (int) vh.addAndGet(array, i, 0xCAFEBABE);
+                assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
             }
         }
     }
@@ -788,7 +788,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.set(array, ci, 1);
+                vh.set(array, ci, 0x01234567);
             });
 
             checkIOOBE(() -> {
@@ -796,7 +796,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setVolatile(array, ci, 1);
+                vh.setVolatile(array, ci, 0x01234567);
             });
 
             checkIOOBE(() -> {
@@ -804,7 +804,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setRelease(array, ci, 1);
+                vh.setRelease(array, ci, 0x01234567);
             });
 
             checkIOOBE(() -> {
@@ -812,51 +812,51 @@
             });
 
             checkIOOBE(() -> {
-                vh.setOpaque(array, ci, 1);
+                vh.setOpaque(array, ci, 0x01234567);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.compareAndSet(array, ci, 1, 2);
+                boolean r = vh.compareAndSet(array, ci, 0x01234567, 0x89ABCDEF);
             });
 
             checkIOOBE(() -> {
-                int r = (int) vh.compareAndExchangeVolatile(array, ci, 2, 1);
+                int r = (int) vh.compareAndExchange(array, ci, 0x89ABCDEF, 0x01234567);
             });
 
             checkIOOBE(() -> {
-                int r = (int) vh.compareAndExchangeAcquire(array, ci, 2, 1);
+                int r = (int) vh.compareAndExchangeAcquire(array, ci, 0x89ABCDEF, 0x01234567);
             });
 
             checkIOOBE(() -> {
-                int r = (int) vh.compareAndExchangeRelease(array, ci, 2, 1);
+                int r = (int) vh.compareAndExchangeRelease(array, ci, 0x89ABCDEF, 0x01234567);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSet(array, ci, 1, 2);
+                boolean r = vh.weakCompareAndSet(array, ci, 0x01234567, 0x89ABCDEF);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSetVolatile(array, ci, 1, 2);
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, 0x01234567, 0x89ABCDEF);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSetAcquire(array, ci, 1, 2);
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, 0x01234567, 0x89ABCDEF);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSetRelease(array, ci, 1, 2);
+                boolean r = vh.weakCompareAndSetRelease(array, ci, 0x01234567, 0x89ABCDEF);
             });
 
             checkIOOBE(() -> {
-                int o = (int) vh.getAndSet(array, ci, 1);
+                int o = (int) vh.getAndSet(array, ci, 0x01234567);
             });
 
             checkIOOBE(() -> {
-                int o = (int) vh.getAndAdd(array, ci, 3);
+                int o = (int) vh.getAndAdd(array, ci, 0xCAFEBABE);
             });
 
             checkIOOBE(() -> {
-                int o = (int) vh.addAndGet(array, ci, 3);
+                int o = (int) vh.addAndGet(array, ci, 0xCAFEBABE);
             });
         }
     }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessLong.java	Thu Jul 07 18:35:29 2016 +0000
@@ -42,11 +42,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestAccessLong extends VarHandleBaseTest {
-    static final long static_final_v = 1L;
+    static final long static_final_v = 0x0123456789ABCDEFL;
 
     static long static_v;
 
-    final long final_v = 1L;
+    final long final_v = 0x0123456789ABCDEFL;
 
     long v;
 
@@ -100,7 +100,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -220,44 +220,44 @@
         // Plain
         {
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "get long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "get long value");
         }
 
 
         // Volatile
         {
             long x = (long) vh.getVolatile(recv);
-            assertEquals(x, 1L, "getVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "getVolatile long value");
         }
 
         // Lazy
         {
             long x = (long) vh.getAcquire(recv);
-            assertEquals(x, 1L, "getRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "getRelease long value");
         }
 
         // Opaque
         {
             long x = (long) vh.getOpaque(recv);
-            assertEquals(x, 1L, "getOpaque long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "getOpaque long value");
         }
     }
 
     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessLong recv, VarHandle vh) {
         checkUOE(() -> {
-            vh.set(recv, 2L);
+            vh.set(recv, 0xCAFEBABECAFEBABEL);
         });
 
         checkUOE(() -> {
-            vh.setVolatile(recv, 2L);
+            vh.setVolatile(recv, 0xCAFEBABECAFEBABEL);
         });
 
         checkUOE(() -> {
-            vh.setRelease(recv, 2L);
+            vh.setRelease(recv, 0xCAFEBABECAFEBABEL);
         });
 
         checkUOE(() -> {
-            vh.setOpaque(recv, 2L);
+            vh.setOpaque(recv, 0xCAFEBABECAFEBABEL);
         });
 
 
@@ -268,44 +268,44 @@
         // Plain
         {
             long x = (long) vh.get();
-            assertEquals(x, 1L, "get long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "get long value");
         }
 
 
         // Volatile
         {
             long x = (long) vh.getVolatile();
-            assertEquals(x, 1L, "getVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "getVolatile long value");
         }
 
         // Lazy
         {
             long x = (long) vh.getAcquire();
-            assertEquals(x, 1L, "getRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "getRelease long value");
         }
 
         // Opaque
         {
             long x = (long) vh.getOpaque();
-            assertEquals(x, 1L, "getOpaque long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "getOpaque long value");
         }
     }
 
     static void testStaticFinalFieldUnsupported(VarHandle vh) {
         checkUOE(() -> {
-            vh.set(2L);
+            vh.set(0xCAFEBABECAFEBABEL);
         });
 
         checkUOE(() -> {
-            vh.setVolatile(2L);
+            vh.setVolatile(0xCAFEBABECAFEBABEL);
         });
 
         checkUOE(() -> {
-            vh.setRelease(2L);
+            vh.setRelease(0xCAFEBABECAFEBABEL);
         });
 
         checkUOE(() -> {
-            vh.setOpaque(2L);
+            vh.setOpaque(0xCAFEBABECAFEBABEL);
         });
 
 
@@ -315,148 +315,148 @@
     static void testInstanceField(VarHandleTestAccessLong recv, VarHandle vh) {
         // Plain
         {
-            vh.set(recv, 1L);
+            vh.set(recv, 0x0123456789ABCDEFL);
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "set long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "set long value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(recv, 2L);
+            vh.setVolatile(recv, 0xCAFEBABECAFEBABEL);
             long x = (long) vh.getVolatile(recv);
-            assertEquals(x, 2L, "setVolatile long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setVolatile long value");
         }
 
         // Lazy
         {
-            vh.setRelease(recv, 1L);
+            vh.setRelease(recv, 0x0123456789ABCDEFL);
             long x = (long) vh.getAcquire(recv);
-            assertEquals(x, 1L, "setRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "setRelease long value");
         }
 
         // Opaque
         {
-            vh.setOpaque(recv, 2L);
+            vh.setOpaque(recv, 0xCAFEBABECAFEBABEL);
             long x = (long) vh.getOpaque(recv);
-            assertEquals(x, 2L, "setOpaque long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setOpaque long value");
         }
 
-        vh.set(recv, 1L);
+        vh.set(recv, 0x0123456789ABCDEFL);
 
         // Compare
         {
-            boolean r = vh.compareAndSet(recv, 1L, 2L);
+            boolean r = vh.compareAndSet(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             assertEquals(r, true, "success compareAndSet long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "success compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value");
         }
 
         {
-            boolean r = vh.compareAndSet(recv, 1L, 3L);
+            boolean r = vh.compareAndSet(recv, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
             assertEquals(r, false, "failing compareAndSet long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "failing compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeVolatile(recv, 2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeVolatile long");
+            long r = (long) vh.compareAndExchange(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "success compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeVolatile(recv, 2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeVolatile long");
+            long r = (long) vh.compareAndExchange(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "failing compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeAcquire(recv, 1L, 2L);
-            assertEquals(r, 1L, "success compareAndExchangeAcquire long");
+            long r = (long) vh.compareAndExchangeAcquire(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+            assertEquals(r, 0x0123456789ABCDEFL, "success compareAndExchangeAcquire long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "success compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeAcquire(recv, 1L, 3L);
-            assertEquals(r, 2L, "failing compareAndExchangeAcquire long");
+            long r = (long) vh.compareAndExchangeAcquire(recv, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "failing compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeRelease(recv, 2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeRelease long");
+            long r = (long) vh.compareAndExchangeRelease(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeRelease long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "success compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeRelease long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeRelease(recv, 2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeRelease long");
+            long r = (long) vh.compareAndExchangeRelease(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "failing compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSet(recv, 1L, 2L);
+                success = vh.weakCompareAndSet(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSet long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "weakCompareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetAcquire(recv, 2L, 1L);
+                success = vh.weakCompareAndSetAcquire(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "weakCompareAndSetAcquire long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetRelease(recv, 1L, 2L);
+                success = vh.weakCompareAndSetRelease(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSetRelease long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "weakCompareAndSetRelease long");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetVolatile(recv, 2L, 1L);
+                success = vh.weakCompareAndSetVolatile(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 1L, "weakCompareAndSetVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long value");
         }
 
         // Compare set and get
         {
-            long o = (long) vh.getAndSet(recv, 2L);
-            assertEquals(o, 1L, "getAndSet long");
+            long o = (long) vh.getAndSet(recv, 0xCAFEBABECAFEBABEL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
             long x = (long) vh.get(recv);
-            assertEquals(x, 2L, "getAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
         }
 
-        vh.set(recv, 1L);
+        vh.set(recv, 0x0123456789ABCDEFL);
 
         // get and add, add and get
         {
-            long o = (long) vh.getAndAdd(recv, 3L);
-            assertEquals(o, 1L, "getAndAdd long");
-            long c = (long) vh.addAndGet(recv, 3L);
-            assertEquals(c, 1L + 3L + 3L, "getAndAdd long value");
+            long o = (long) vh.getAndAdd(recv, 0xDEADBEEFDEADBEEFL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
+            long c = (long) vh.addAndGet(recv, 0xDEADBEEFDEADBEEFL);
+            assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
         }
     }
 
@@ -468,148 +468,148 @@
     static void testStaticField(VarHandle vh) {
         // Plain
         {
-            vh.set(1L);
+            vh.set(0x0123456789ABCDEFL);
             long x = (long) vh.get();
-            assertEquals(x, 1L, "set long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "set long value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(2L);
+            vh.setVolatile(0xCAFEBABECAFEBABEL);
             long x = (long) vh.getVolatile();
-            assertEquals(x, 2L, "setVolatile long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setVolatile long value");
         }
 
         // Lazy
         {
-            vh.setRelease(1L);
+            vh.setRelease(0x0123456789ABCDEFL);
             long x = (long) vh.getAcquire();
-            assertEquals(x, 1L, "setRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "setRelease long value");
         }
 
         // Opaque
         {
-            vh.setOpaque(2L);
+            vh.setOpaque(0xCAFEBABECAFEBABEL);
             long x = (long) vh.getOpaque();
-            assertEquals(x, 2L, "setOpaque long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setOpaque long value");
         }
 
-        vh.set(1L);
+        vh.set(0x0123456789ABCDEFL);
 
         // Compare
         {
-            boolean r = vh.compareAndSet(1L, 2L);
+            boolean r = vh.compareAndSet(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             assertEquals(r, true, "success compareAndSet long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "success compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value");
         }
 
         {
-            boolean r = vh.compareAndSet(1L, 3L);
+            boolean r = vh.compareAndSet(0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
             assertEquals(r, false, "failing compareAndSet long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "failing compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeVolatile(2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeVolatile long");
+            long r = (long) vh.compareAndExchange(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
             long x = (long) vh.get();
-            assertEquals(x, 1L, "success compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeVolatile(2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeVolatile long");
+            long r = (long) vh.compareAndExchange(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
             long x = (long) vh.get();
-            assertEquals(x, 1L, "failing compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeAcquire(1L, 2L);
-            assertEquals(r, 1L, "success compareAndExchangeAcquire long");
+            long r = (long) vh.compareAndExchangeAcquire(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+            assertEquals(r, 0x0123456789ABCDEFL, "success compareAndExchangeAcquire long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "success compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeAcquire(1L, 3L);
-            assertEquals(r, 2L, "failing compareAndExchangeAcquire long");
+            long r = (long) vh.compareAndExchangeAcquire(0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "failing compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeRelease(2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeRelease long");
+            long r = (long) vh.compareAndExchangeRelease(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeRelease long");
             long x = (long) vh.get();
-            assertEquals(x, 1L, "success compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeRelease long value");
         }
 
         {
-            long r = (long) vh.compareAndExchangeRelease(2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeRelease long");
+            long r = (long) vh.compareAndExchangeRelease(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long");
             long x = (long) vh.get();
-            assertEquals(x, 1L, "failing compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSet(1L, 2L);
+                success = vh.weakCompareAndSet(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSet long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "weakCompareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetAcquire(2L, 1L);
+                success = vh.weakCompareAndSetAcquire(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire long");
             long x = (long) vh.get();
-            assertEquals(x, 1L, "weakCompareAndSetAcquire long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetRelease(1L, 2L);
+                success = vh.weakCompareAndSetRelease(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSetRelease long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "weakCompareAndSetRelease long");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = vh.weakCompareAndSetRelease(2L, 1L);
+                success = vh.weakCompareAndSetRelease(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile long");
             long x = (long) vh.get();
-            assertEquals(x, 1L, "weakCompareAndSetVolatile long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
         }
 
         // Compare set and get
         {
-            long o = (long) vh.getAndSet(2L);
-            assertEquals(o, 1L, "getAndSet long");
+            long o = (long) vh.getAndSet(0xCAFEBABECAFEBABEL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
             long x = (long) vh.get();
-            assertEquals(x, 2L, "getAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
         }
 
-        vh.set(1L);
+        vh.set(0x0123456789ABCDEFL);
 
         // get and add, add and get
         {
-            long o = (long) vh.getAndAdd( 3L);
-            assertEquals(o, 1L, "getAndAdd long");
-            long c = (long) vh.addAndGet(3L);
-            assertEquals(c, 1L + 3L + 3L, "getAndAdd long value");
+            long o = (long) vh.getAndAdd( 0xDEADBEEFDEADBEEFL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
+            long c = (long) vh.addAndGet(0xDEADBEEFDEADBEEFL);
+            assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
         }
     }
 
@@ -624,148 +624,148 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                vh.set(array, i, 1L);
+                vh.set(array, i, 0x0123456789ABCDEFL);
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "get long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "get long value");
             }
 
 
             // Volatile
             {
-                vh.setVolatile(array, i, 2L);
+                vh.setVolatile(array, i, 0xCAFEBABECAFEBABEL);
                 long x = (long) vh.getVolatile(array, i);
-                assertEquals(x, 2L, "setVolatile long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "setVolatile long value");
             }
 
             // Lazy
             {
-                vh.setRelease(array, i, 1L);
+                vh.setRelease(array, i, 0x0123456789ABCDEFL);
                 long x = (long) vh.getAcquire(array, i);
-                assertEquals(x, 1L, "setRelease long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "setRelease long value");
             }
 
             // Opaque
             {
-                vh.setOpaque(array, i, 2L);
+                vh.setOpaque(array, i, 0xCAFEBABECAFEBABEL);
                 long x = (long) vh.getOpaque(array, i);
-                assertEquals(x, 2L, "setOpaque long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "setOpaque long value");
             }
 
-            vh.set(array, i, 1L);
+            vh.set(array, i, 0x0123456789ABCDEFL);
 
             // Compare
             {
-                boolean r = vh.compareAndSet(array, i, 1L, 2L);
+                boolean r = vh.compareAndSet(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 assertEquals(r, true, "success compareAndSet long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "success compareAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value");
             }
 
             {
-                boolean r = vh.compareAndSet(array, i, 1L, 3L);
+                boolean r = vh.compareAndSet(array, i, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
                 assertEquals(r, false, "failing compareAndSet long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "failing compareAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value");
             }
 
             {
-                long r = (long) vh.compareAndExchangeVolatile(array, i, 2L, 1L);
-                assertEquals(r, 2L, "success compareAndExchangeVolatile long");
+                long r = (long) vh.compareAndExchange(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+                assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "success compareAndExchangeVolatile long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
             }
 
             {
-                long r = (long) vh.compareAndExchangeVolatile(array, i, 2L, 3L);
-                assertEquals(r, 1L, "failing compareAndExchangeVolatile long");
+                long r = (long) vh.compareAndExchange(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+                assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "failing compareAndExchangeVolatile long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
             }
 
             {
-                long r = (long) vh.compareAndExchangeAcquire(array, i, 1L, 2L);
-                assertEquals(r, 1L, "success compareAndExchangeAcquire long");
+                long r = (long) vh.compareAndExchangeAcquire(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+                assertEquals(r, 0x0123456789ABCDEFL, "success compareAndExchangeAcquire long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "success compareAndExchangeAcquire long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndExchangeAcquire long value");
             }
 
             {
-                long r = (long) vh.compareAndExchangeAcquire(array, i, 1L, 3L);
-                assertEquals(r, 2L, "failing compareAndExchangeAcquire long");
+                long r = (long) vh.compareAndExchangeAcquire(array, i, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
+                assertEquals(r, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "failing compareAndExchangeAcquire long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long value");
             }
 
             {
-                long r = (long) vh.compareAndExchangeRelease(array, i, 2L, 1L);
-                assertEquals(r, 2L, "success compareAndExchangeRelease long");
+                long r = (long) vh.compareAndExchangeRelease(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+                assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeRelease long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "success compareAndExchangeRelease long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeRelease long value");
             }
 
             {
-                long r = (long) vh.compareAndExchangeRelease(array, i, 2L, 3L);
-                assertEquals(r, 1L, "failing compareAndExchangeRelease long");
+                long r = (long) vh.compareAndExchangeRelease(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+                assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "failing compareAndExchangeRelease long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSet(array, i, 1L, 2L);
+                    success = vh.weakCompareAndSet(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 }
                 assertEquals(success, true, "weakCompareAndSet long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "weakCompareAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSetAcquire(array, i, 2L, 1L);
+                    success = vh.weakCompareAndSetAcquire(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
                 }
                 assertEquals(success, true, "weakCompareAndSetAcquire long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "weakCompareAndSetAcquire long");
+                assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSetRelease(array, i, 1L, 2L);
+                    success = vh.weakCompareAndSetRelease(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 }
                 assertEquals(success, true, "weakCompareAndSetRelease long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "weakCompareAndSetRelease long");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = vh.weakCompareAndSetVolatile(array, i, 2L, 1L);
+                    success = vh.weakCompareAndSetVolatile(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
                 }
                 assertEquals(success, true, "weakCompareAndSetVolatile long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 1L, "weakCompareAndSetVolatile long");
+                assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
             }
 
             // Compare set and get
             {
-                long o = (long) vh.getAndSet(array, i, 2L);
-                assertEquals(o, 1L, "getAndSet long");
+                long o = (long) vh.getAndSet(array, i, 0xCAFEBABECAFEBABEL);
+                assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
                 long x = (long) vh.get(array, i);
-                assertEquals(x, 2L, "getAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
             }
 
-            vh.set(array, i, 1L);
+            vh.set(array, i, 0x0123456789ABCDEFL);
 
             // get and add, add and get
             {
-                long o = (long) vh.getAndAdd(array, i, 3L);
-                assertEquals(o, 1L, "getAndAdd long");
-                long c = (long) vh.addAndGet(array, i, 3L);
-                assertEquals(c, 1L + 3L + 3L, "getAndAdd long value");
+                long o = (long) vh.getAndAdd(array, i, 0xDEADBEEFDEADBEEFL);
+                assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
+                long c = (long) vh.addAndGet(array, i, 0xDEADBEEFDEADBEEFL);
+                assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
             }
         }
     }
@@ -788,7 +788,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.set(array, ci, 1L);
+                vh.set(array, ci, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
@@ -796,7 +796,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setVolatile(array, ci, 1L);
+                vh.setVolatile(array, ci, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
@@ -804,7 +804,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setRelease(array, ci, 1L);
+                vh.setRelease(array, ci, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
@@ -812,51 +812,51 @@
             });
 
             checkIOOBE(() -> {
-                vh.setOpaque(array, ci, 1L);
+                vh.setOpaque(array, ci, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.compareAndSet(array, ci, 1L, 2L);
+                boolean r = vh.compareAndSet(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             });
 
             checkIOOBE(() -> {
-                long r = (long) vh.compareAndExchangeVolatile(array, ci, 2L, 1L);
+                long r = (long) vh.compareAndExchange(array, ci, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
-                long r = (long) vh.compareAndExchangeAcquire(array, ci, 2L, 1L);
+                long r = (long) vh.compareAndExchangeAcquire(array, ci, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
-                long r = (long) vh.compareAndExchangeRelease(array, ci, 2L, 1L);
+                long r = (long) vh.compareAndExchangeRelease(array, ci, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSet(array, ci, 1L, 2L);
+                boolean r = vh.weakCompareAndSet(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSetVolatile(array, ci, 1L, 2L);
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSetAcquire(array, ci, 1L, 2L);
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             });
 
             checkIOOBE(() -> {
-                boolean r = vh.weakCompareAndSetRelease(array, ci, 1L, 2L);
+                boolean r = vh.weakCompareAndSetRelease(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             });
 
             checkIOOBE(() -> {
-                long o = (long) vh.getAndSet(array, ci, 1L);
+                long o = (long) vh.getAndSet(array, ci, 0x0123456789ABCDEFL);
             });
 
             checkIOOBE(() -> {
-                long o = (long) vh.getAndAdd(array, ci, 3L);
+                long o = (long) vh.getAndAdd(array, ci, 0xDEADBEEFDEADBEEFL);
             });
 
             checkIOOBE(() -> {
-                long o = (long) vh.addAndGet(array, ci, 3L);
+                long o = (long) vh.addAndGet(array, ci, 0xDEADBEEFDEADBEEFL);
             });
         }
     }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java	Thu Jul 07 18:35:29 2016 +0000
@@ -42,11 +42,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestAccessShort extends VarHandleBaseTest {
-    static final short static_final_v = (short)1;
+    static final short static_final_v = (short)0x0123;
 
     static short static_v;
 
-    final short final_v = (short)1;
+    final short final_v = (short)0x0123;
 
     short v;
 
@@ -99,18 +99,18 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
     }
 
 
@@ -220,89 +220,47 @@
         // Plain
         {
             short x = (short) vh.get(recv);
-            assertEquals(x, (short)1, "get short value");
+            assertEquals(x, (short)0x0123, "get short value");
         }
 
 
         // Volatile
         {
             short x = (short) vh.getVolatile(recv);
-            assertEquals(x, (short)1, "getVolatile short value");
+            assertEquals(x, (short)0x0123, "getVolatile short value");
         }
 
         // Lazy
         {
             short x = (short) vh.getAcquire(recv);
-            assertEquals(x, (short)1, "getRelease short value");
+            assertEquals(x, (short)0x0123, "getRelease short value");
         }
 
         // Opaque
         {
             short x = (short) vh.getOpaque(recv);
-            assertEquals(x, (short)1, "getOpaque short value");
+            assertEquals(x, (short)0x0123, "getOpaque short value");
         }
     }
 
     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
         checkUOE(() -> {
-            vh.set(recv, (short)2);
-        });
-
-        checkUOE(() -> {
-            vh.setVolatile(recv, (short)2);
-        });
-
-        checkUOE(() -> {
-            vh.setRelease(recv, (short)2);
+            vh.set(recv, (short)0x4567);
         });
 
         checkUOE(() -> {
-            vh.setOpaque(recv, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeVolatile(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeAcquire(recv, (short)1, (short)2);
+            vh.setVolatile(recv, (short)0x4567);
         });
 
         checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeRelease(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, (short)1, (short)2);
+            vh.setRelease(recv, (short)0x4567);
         });
 
         checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, (short)1, (short)2);
+            vh.setOpaque(recv, (short)0x4567);
         });
 
-        checkUOE(() -> {
-            short r = (short) vh.getAndSet(recv, (short)1);
-        });
 
-        checkUOE(() -> {
-            short o = (short) vh.getAndAdd(recv, (short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.addAndGet(recv, (short)1);
-        });
     }
 
 
@@ -310,249 +268,353 @@
         // Plain
         {
             short x = (short) vh.get();
-            assertEquals(x, (short)1, "get short value");
+            assertEquals(x, (short)0x0123, "get short value");
         }
 
 
         // Volatile
         {
             short x = (short) vh.getVolatile();
-            assertEquals(x, (short)1, "getVolatile short value");
+            assertEquals(x, (short)0x0123, "getVolatile short value");
         }
 
         // Lazy
         {
             short x = (short) vh.getAcquire();
-            assertEquals(x, (short)1, "getRelease short value");
+            assertEquals(x, (short)0x0123, "getRelease short value");
         }
 
         // Opaque
         {
             short x = (short) vh.getOpaque();
-            assertEquals(x, (short)1, "getOpaque short value");
+            assertEquals(x, (short)0x0123, "getOpaque short value");
         }
     }
 
     static void testStaticFinalFieldUnsupported(VarHandle vh) {
         checkUOE(() -> {
-            vh.set((short)2);
-        });
-
-        checkUOE(() -> {
-            vh.setVolatile((short)2);
-        });
-
-        checkUOE(() -> {
-            vh.setRelease((short)2);
+            vh.set((short)0x4567);
         });
 
         checkUOE(() -> {
-            vh.setOpaque((short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeVolatile((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeAcquire((short)1, (short)2);
+            vh.setVolatile((short)0x4567);
         });
 
         checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeRelease((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile((short)1, (short)2);
+            vh.setRelease((short)0x4567);
         });
 
         checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease((short)1, (short)2);
+            vh.setOpaque((short)0x4567);
         });
 
-        checkUOE(() -> {
-            short r = (short) vh.getAndSet((short)1);
-        });
 
-        checkUOE(() -> {
-            short o = (short) vh.getAndAdd((short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.addAndGet((short)1);
-        });
     }
 
 
     static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) {
         // Plain
         {
-            vh.set(recv, (short)1);
+            vh.set(recv, (short)0x0123);
             short x = (short) vh.get(recv);
-            assertEquals(x, (short)1, "set short value");
+            assertEquals(x, (short)0x0123, "set short value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile(recv, (short)2);
+            vh.setVolatile(recv, (short)0x4567);
             short x = (short) vh.getVolatile(recv);
-            assertEquals(x, (short)2, "setVolatile short value");
+            assertEquals(x, (short)0x4567, "setVolatile short value");
         }
 
         // Lazy
         {
-            vh.setRelease(recv, (short)1);
+            vh.setRelease(recv, (short)0x0123);
             short x = (short) vh.getAcquire(recv);
-            assertEquals(x, (short)1, "setRelease short value");
+            assertEquals(x, (short)0x0123, "setRelease short value");
         }
 
         // Opaque
         {
-            vh.setOpaque(recv, (short)2);
+            vh.setOpaque(recv, (short)0x4567);
             short x = (short) vh.getOpaque(recv);
-            assertEquals(x, (short)2, "setOpaque short value");
+            assertEquals(x, (short)0x4567, "setOpaque short value");
+        }
+
+        vh.set(recv, (short)0x0123);
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet(recv, (short)0x0123, (short)0x4567);
+            assertEquals(r, true, "success compareAndSet short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "success compareAndSet short value");
+        }
+
+        {
+            boolean r = vh.compareAndSet(recv, (short)0x0123, (short)0x89AB);
+            assertEquals(r, false, "failing compareAndSet short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "failing compareAndSet short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchange(recv, (short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchange short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x0123, "success compareAndExchange short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchange(recv, (short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchange short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x4567);
+            assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x89AB);
+            assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchangeRelease(recv, (short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
         }
 
+        {
+            short r = (short) vh.compareAndExchangeRelease(recv, (short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet(recv, (short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSet short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire(recv, (short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease(recv, (short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetVolatile(recv, (short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short value");
+        }
+
+        // Compare set and get
+        {
+            short o = (short) vh.getAndSet(recv, (short)0x4567);
+            assertEquals(o, (short)0x0123, "getAndSet short");
+            short x = (short) vh.get(recv);
+            assertEquals(x, (short)0x4567, "getAndSet short value");
+        }
+
+        vh.set(recv, (short)0x0123);
+
+        // get and add, add and get
+        {
+            short o = (short) vh.getAndAdd(recv, (short)0x89AB);
+            assertEquals(o, (short)0x0123, "getAndAdd short");
+            short c = (short) vh.addAndGet(recv, (short)0x89AB);
+            assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(recv, (short)1, (short)2);
-        });
 
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeVolatile(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeAcquire(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeRelease(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(recv, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.getAndSet(recv, (short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.getAndAdd(recv, (short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.addAndGet(recv, (short)1);
-        });
     }
 
 
     static void testStaticField(VarHandle vh) {
         // Plain
         {
-            vh.set((short)1);
+            vh.set((short)0x0123);
             short x = (short) vh.get();
-            assertEquals(x, (short)1, "set short value");
+            assertEquals(x, (short)0x0123, "set short value");
         }
 
 
         // Volatile
         {
-            vh.setVolatile((short)2);
+            vh.setVolatile((short)0x4567);
             short x = (short) vh.getVolatile();
-            assertEquals(x, (short)2, "setVolatile short value");
+            assertEquals(x, (short)0x4567, "setVolatile short value");
         }
 
         // Lazy
         {
-            vh.setRelease((short)1);
+            vh.setRelease((short)0x0123);
             short x = (short) vh.getAcquire();
-            assertEquals(x, (short)1, "setRelease short value");
+            assertEquals(x, (short)0x0123, "setRelease short value");
         }
 
         // Opaque
         {
-            vh.setOpaque((short)2);
+            vh.setOpaque((short)0x4567);
             short x = (short) vh.getOpaque();
-            assertEquals(x, (short)2, "setOpaque short value");
+            assertEquals(x, (short)0x4567, "setOpaque short value");
+        }
+
+        vh.set((short)0x0123);
+
+        // Compare
+        {
+            boolean r = vh.compareAndSet((short)0x0123, (short)0x4567);
+            assertEquals(r, true, "success compareAndSet short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "success compareAndSet short value");
+        }
+
+        {
+            boolean r = vh.compareAndSet((short)0x0123, (short)0x89AB);
+            assertEquals(r, false, "failing compareAndSet short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "failing compareAndSet short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchange((short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchange short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x0123, "success compareAndExchange short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchange((short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchange short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchangeAcquire((short)0x0123, (short)0x4567);
+            assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchangeAcquire((short)0x0123, (short)0x89AB);
+            assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) vh.compareAndExchangeRelease((short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
         }
 
+        {
+            short r = (short) vh.compareAndExchangeRelease((short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSet((short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSet short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetAcquire((short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease((short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = vh.weakCompareAndSetRelease((short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+        }
+
+        // Compare set and get
+        {
+            short o = (short) vh.getAndSet((short)0x4567);
+            assertEquals(o, (short)0x0123, "getAndSet short");
+            short x = (short) vh.get();
+            assertEquals(x, (short)0x4567, "getAndSet short value");
+        }
+
+        vh.set((short)0x0123);
+
+        // get and add, add and get
+        {
+            short o = (short) vh.getAndAdd( (short)0x89AB);
+            assertEquals(o, (short)0x0123, "getAndAdd short");
+            short c = (short) vh.addAndGet((short)0x89AB);
+            assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+        }
     }
 
     static void testStaticFieldUnsupported(VarHandle vh) {
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet((short)1, (short)2);
-        });
 
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeVolatile((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeAcquire((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeRelease((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease((short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.getAndSet((short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.getAndAdd((short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.addAndGet((short)1);
-        });
     }
 
 
@@ -562,34 +624,149 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                vh.set(array, i, (short)1);
+                vh.set(array, i, (short)0x0123);
                 short x = (short) vh.get(array, i);
-                assertEquals(x, (short)1, "get short value");
+                assertEquals(x, (short)0x0123, "get short value");
             }
 
 
             // Volatile
             {
-                vh.setVolatile(array, i, (short)2);
+                vh.setVolatile(array, i, (short)0x4567);
                 short x = (short) vh.getVolatile(array, i);
-                assertEquals(x, (short)2, "setVolatile short value");
+                assertEquals(x, (short)0x4567, "setVolatile short value");
             }
 
             // Lazy
             {
-                vh.setRelease(array, i, (short)1);
+                vh.setRelease(array, i, (short)0x0123);
                 short x = (short) vh.getAcquire(array, i);
-                assertEquals(x, (short)1, "setRelease short value");
+                assertEquals(x, (short)0x0123, "setRelease short value");
             }
 
             // Opaque
             {
-                vh.setOpaque(array, i, (short)2);
+                vh.setOpaque(array, i, (short)0x4567);
                 short x = (short) vh.getOpaque(array, i);
-                assertEquals(x, (short)2, "setOpaque short value");
+                assertEquals(x, (short)0x4567, "setOpaque short value");
+            }
+
+            vh.set(array, i, (short)0x0123);
+
+            // Compare
+            {
+                boolean r = vh.compareAndSet(array, i, (short)0x0123, (short)0x4567);
+                assertEquals(r, true, "success compareAndSet short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "success compareAndSet short value");
+            }
+
+            {
+                boolean r = vh.compareAndSet(array, i, (short)0x0123, (short)0x89AB);
+                assertEquals(r, false, "failing compareAndSet short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "failing compareAndSet short value");
+            }
+
+            {
+                short r = (short) vh.compareAndExchange(array, i, (short)0x4567, (short)0x0123);
+                assertEquals(r, (short)0x4567, "success compareAndExchange short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x0123, "success compareAndExchange short value");
+            }
+
+            {
+                short r = (short) vh.compareAndExchange(array, i, (short)0x4567, (short)0x89AB);
+                assertEquals(r, (short)0x0123, "failing compareAndExchange short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
+            }
+
+            {
+                short r = (short) vh.compareAndExchangeAcquire(array, i, (short)0x0123, (short)0x4567);
+                assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
+            }
+
+            {
+                short r = (short) vh.compareAndExchangeAcquire(array, i, (short)0x0123, (short)0x89AB);
+                assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
+            }
+
+            {
+                short r = (short) vh.compareAndExchangeRelease(array, i, (short)0x4567, (short)0x0123);
+                assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
             }
 
+            {
+                short r = (short) vh.compareAndExchangeRelease(array, i, (short)0x4567, (short)0x89AB);
+                assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
+            }
 
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSet(array, i, (short)0x0123, (short)0x4567);
+                }
+                assertEquals(success, true, "weakCompareAndSet short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetAcquire(array, i, (short)0x4567, (short)0x0123);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetRelease(array, i, (short)0x0123, (short)0x4567);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = vh.weakCompareAndSetVolatile(array, i, (short)0x4567, (short)0x0123);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+            }
+
+            // Compare set and get
+            {
+                short o = (short) vh.getAndSet(array, i, (short)0x4567);
+                assertEquals(o, (short)0x0123, "getAndSet short");
+                short x = (short) vh.get(array, i);
+                assertEquals(x, (short)0x4567, "getAndSet short value");
+            }
+
+            vh.set(array, i, (short)0x0123);
+
+            // get and add, add and get
+            {
+                short o = (short) vh.getAndAdd(array, i, (short)0x89AB);
+                assertEquals(o, (short)0x0123, "getAndAdd short");
+                short c = (short) vh.addAndGet(array, i, (short)0x89AB);
+                assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+            }
         }
     }
 
@@ -597,49 +774,7 @@
         short[] array = new short[10];
 
         int i = 0;
-        checkUOE(() -> {
-            boolean r = vh.compareAndSet(array, i, (short)1, (short)2);
-        });
 
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeVolatile(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeAcquire(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeRelease(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSet(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetVolatile(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetAcquire(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            boolean r = vh.weakCompareAndSetRelease(array, i, (short)1, (short)2);
-        });
-
-        checkUOE(() -> {
-            short r = (short) vh.getAndSet(array, i, (short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.getAndAdd(array, i, (short)1);
-        });
-
-        checkUOE(() -> {
-            short o = (short) vh.addAndGet(array, i, (short)1);
-        });
     }
 
     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
@@ -653,7 +788,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.set(array, ci, (short)1);
+                vh.set(array, ci, (short)0x0123);
             });
 
             checkIOOBE(() -> {
@@ -661,7 +796,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setVolatile(array, ci, (short)1);
+                vh.setVolatile(array, ci, (short)0x0123);
             });
 
             checkIOOBE(() -> {
@@ -669,7 +804,7 @@
             });
 
             checkIOOBE(() -> {
-                vh.setRelease(array, ci, (short)1);
+                vh.setRelease(array, ci, (short)0x0123);
             });
 
             checkIOOBE(() -> {
@@ -677,10 +812,52 @@
             });
 
             checkIOOBE(() -> {
-                vh.setOpaque(array, ci, (short)1);
+                vh.setOpaque(array, ci, (short)0x0123);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.compareAndSet(array, ci, (short)0x0123, (short)0x4567);
+            });
+
+            checkIOOBE(() -> {
+                short r = (short) vh.compareAndExchange(array, ci, (short)0x4567, (short)0x0123);
+            });
+
+            checkIOOBE(() -> {
+                short r = (short) vh.compareAndExchangeAcquire(array, ci, (short)0x4567, (short)0x0123);
+            });
+
+            checkIOOBE(() -> {
+                short r = (short) vh.compareAndExchangeRelease(array, ci, (short)0x4567, (short)0x0123);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSet(array, ci, (short)0x0123, (short)0x4567);
             });
 
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetVolatile(array, ci, (short)0x0123, (short)0x4567);
+            });
 
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetAcquire(array, ci, (short)0x0123, (short)0x4567);
+            });
+
+            checkIOOBE(() -> {
+                boolean r = vh.weakCompareAndSetRelease(array, ci, (short)0x0123, (short)0x4567);
+            });
+
+            checkIOOBE(() -> {
+                short o = (short) vh.getAndSet(array, ci, (short)0x0123);
+            });
+
+            checkIOOBE(() -> {
+                short o = (short) vh.getAndAdd(array, ci, (short)0x89AB);
+            });
+
+            checkIOOBE(() -> {
+                short o = (short) vh.addAndGet(array, ci, (short)0x89AB);
+            });
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestAccessString.java	Thu Jul 07 18:35:29 2016 +0000
@@ -100,7 +100,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -374,17 +374,17 @@
         }
 
         {
-            String r = (String) vh.compareAndExchangeVolatile(recv, "bar", "foo");
-            assertEquals(r, "bar", "success compareAndExchangeVolatile String");
+            String r = (String) vh.compareAndExchange(recv, "bar", "foo");
+            assertEquals(r, "bar", "success compareAndExchange String");
             String x = (String) vh.get(recv);
-            assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "success compareAndExchange String value");
         }
 
         {
-            String r = (String) vh.compareAndExchangeVolatile(recv, "bar", "baz");
-            assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
+            String r = (String) vh.compareAndExchange(recv, "bar", "baz");
+            assertEquals(r, "foo", "failing compareAndExchange String");
             String x = (String) vh.get(recv);
-            assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "failing compareAndExchange String value");
         }
 
         {
@@ -525,17 +525,17 @@
         }
 
         {
-            String r = (String) vh.compareAndExchangeVolatile("bar", "foo");
-            assertEquals(r, "bar", "success compareAndExchangeVolatile String");
+            String r = (String) vh.compareAndExchange("bar", "foo");
+            assertEquals(r, "bar", "success compareAndExchange String");
             String x = (String) vh.get();
-            assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "success compareAndExchange String value");
         }
 
         {
-            String r = (String) vh.compareAndExchangeVolatile("bar", "baz");
-            assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
+            String r = (String) vh.compareAndExchange("bar", "baz");
+            assertEquals(r, "foo", "failing compareAndExchange String");
             String x = (String) vh.get();
-            assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "failing compareAndExchange String value");
         }
 
         {
@@ -679,17 +679,17 @@
             }
 
             {
-                String r = (String) vh.compareAndExchangeVolatile(array, i, "bar", "foo");
-                assertEquals(r, "bar", "success compareAndExchangeVolatile String");
+                String r = (String) vh.compareAndExchange(array, i, "bar", "foo");
+                assertEquals(r, "bar", "success compareAndExchange String");
                 String x = (String) vh.get(array, i);
-                assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
+                assertEquals(x, "foo", "success compareAndExchange String value");
             }
 
             {
-                String r = (String) vh.compareAndExchangeVolatile(array, i, "bar", "baz");
-                assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
+                String r = (String) vh.compareAndExchange(array, i, "bar", "baz");
+                assertEquals(r, "foo", "failing compareAndExchange String");
                 String x = (String) vh.get(array, i);
-                assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
+                assertEquals(x, "foo", "failing compareAndExchange String value");
             }
 
             {
@@ -828,7 +828,7 @@
             });
 
             checkIOOBE(() -> {
-                String r = (String) vh.compareAndExchangeVolatile(array, ci, "bar", "foo");
+                String r = (String) vh.compareAndExchange(array, ci, "bar", "foo");
             });
 
             checkIOOBE(() -> {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsChar.java	Thu Jul 07 18:35:29 2016 +0000
@@ -89,7 +89,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -189,7 +189,7 @@
         });
 
         checkUOE(() -> {
-            char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+            char r = (char) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
         });
 
         checkUOE(() -> {
@@ -258,7 +258,7 @@
             });
 
             checkUOE(() -> {
-                char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                char r = (char) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkUOE(() -> {
@@ -303,7 +303,7 @@
             });
 
             checkUOE(() -> {
-                char r = (char) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                char r = (char) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkUOE(() -> {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsDouble.java	Thu Jul 07 18:35:29 2016 +0000
@@ -89,7 +89,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -224,7 +224,7 @@
             });
 
             checkROBE(() -> {
-                double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkROBE(() -> {
@@ -321,7 +321,7 @@
             });
 
             checkIOOBE(() -> {
-                double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkIOOBE(() -> {
@@ -406,7 +406,7 @@
                 });
 
                 checkIOOBE(() -> {
-                    double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkIOOBE(() -> {
@@ -482,7 +482,7 @@
                 });
 
                 checkISE(() -> {
-                    double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkISE(() -> {
@@ -561,7 +561,7 @@
                     });
 
                     checkISE(() -> {
-                        double r = (double) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                        double r = (double) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                     });
 
                     checkISE(() -> {
@@ -656,17 +656,17 @@
                 }
 
                 {
-                    double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile double");
+                    double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange double");
                     double x = (double) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile double value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange double value");
                 }
 
                 {
-                    double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile double");
+                    double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange double");
                     double x = (double) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile double value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange double value");
                 }
 
                 {
@@ -805,17 +805,17 @@
                 }
 
                 {
-                    double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile double");
+                    double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange double");
                     double x = (double) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile double value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange double value");
                 }
 
                 {
-                    double r = (double) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile double");
+                    double r = (double) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange double");
                     double x = (double) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile double value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange double value");
                 }
 
                 {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsFloat.java	Thu Jul 07 18:35:29 2016 +0000
@@ -89,7 +89,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -224,7 +224,7 @@
             });
 
             checkROBE(() -> {
-                float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkROBE(() -> {
@@ -321,7 +321,7 @@
             });
 
             checkIOOBE(() -> {
-                float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkIOOBE(() -> {
@@ -406,7 +406,7 @@
                 });
 
                 checkIOOBE(() -> {
-                    float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkIOOBE(() -> {
@@ -482,7 +482,7 @@
                 });
 
                 checkISE(() -> {
-                    float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkISE(() -> {
@@ -561,7 +561,7 @@
                     });
 
                     checkISE(() -> {
-                        float r = (float) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                        float r = (float) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                     });
 
                     checkISE(() -> {
@@ -656,17 +656,17 @@
                 }
 
                 {
-                    float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile float");
+                    float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange float");
                     float x = (float) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile float value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange float value");
                 }
 
                 {
-                    float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile float");
+                    float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange float");
                     float x = (float) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile float value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange float value");
                 }
 
                 {
@@ -805,17 +805,17 @@
                 }
 
                 {
-                    float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile float");
+                    float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange float");
                     float x = (float) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile float value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange float value");
                 }
 
                 {
-                    float r = (float) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile float");
+                    float r = (float) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange float");
                     float x = (float) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile float value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange float value");
                 }
 
                 {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsInt.java	Thu Jul 07 18:35:29 2016 +0000
@@ -89,7 +89,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -217,7 +217,7 @@
             });
 
             checkROBE(() -> {
-                int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkROBE(() -> {
@@ -307,7 +307,7 @@
             });
 
             checkIOOBE(() -> {
-                int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkIOOBE(() -> {
@@ -399,7 +399,7 @@
                 });
 
                 checkIOOBE(() -> {
-                    int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkIOOBE(() -> {
@@ -482,7 +482,7 @@
                 });
 
                 checkISE(() -> {
-                    int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkISE(() -> {
@@ -568,7 +568,7 @@
                     });
 
                     checkISE(() -> {
-                        int r = (int) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                        int r = (int) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                     });
 
                     checkISE(() -> {
@@ -670,17 +670,17 @@
                 }
 
                 {
-                    int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile int");
+                    int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange int");
                     int x = (int) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile int value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange int value");
                 }
 
                 {
-                    int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile int");
+                    int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange int");
                     int x = (int) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile int value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange int value");
                 }
 
                 {
@@ -828,17 +828,17 @@
                 }
 
                 {
-                    int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile int");
+                    int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange int");
                     int x = (int) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile int value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange int value");
                 }
 
                 {
-                    int r = (int) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile int");
+                    int r = (int) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange int");
                     int x = (int) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile int value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange int value");
                 }
 
                 {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsLong.java	Thu Jul 07 18:35:29 2016 +0000
@@ -89,7 +89,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -217,7 +217,7 @@
             });
 
             checkROBE(() -> {
-                long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkROBE(() -> {
@@ -307,7 +307,7 @@
             });
 
             checkIOOBE(() -> {
-                long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkIOOBE(() -> {
@@ -399,7 +399,7 @@
                 });
 
                 checkIOOBE(() -> {
-                    long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkIOOBE(() -> {
@@ -482,7 +482,7 @@
                 });
 
                 checkISE(() -> {
-                    long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkISE(() -> {
@@ -568,7 +568,7 @@
                     });
 
                     checkISE(() -> {
-                        long r = (long) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                        long r = (long) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                     });
 
                     checkISE(() -> {
@@ -670,17 +670,17 @@
                 }
 
                 {
-                    long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile long");
+                    long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange long");
                     long x = (long) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile long value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange long value");
                 }
 
                 {
-                    long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile long");
+                    long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange long");
                     long x = (long) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile long value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange long value");
                 }
 
                 {
@@ -828,17 +828,17 @@
                 }
 
                 {
-                    long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile long");
+                    long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange long");
                     long x = (long) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile long value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange long value");
                 }
 
                 {
-                    long r = (long) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile long");
+                    long r = (long) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange long");
                     long x = (long) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile long value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange long value");
                 }
 
                 {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestByteArrayAsShort.java	Thu Jul 07 18:35:29 2016 +0000
@@ -89,7 +89,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -189,7 +189,7 @@
         });
 
         checkUOE(() -> {
-            short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+            short r = (short) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
         });
 
         checkUOE(() -> {
@@ -258,7 +258,7 @@
             });
 
             checkUOE(() -> {
-                short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                short r = (short) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkUOE(() -> {
@@ -303,7 +303,7 @@
             });
 
             checkUOE(() -> {
-                short r = (short) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                short r = (short) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkUOE(() -> {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessBoolean.java	Thu Jul 07 18:35:29 2016 +0000
@@ -148,27 +148,116 @@
             assertEquals(x, false, "setOpaque boolean value");
         }
 
+        hs.get(TestAccessMode.SET).invokeExact(recv, true);
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, true, false);
+            assertEquals(r, true, "success compareAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "success compareAndSet boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, true, false);
+            assertEquals(r, false, "failing compareAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "failing compareAndSet boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, false, true);
+            assertEquals(r, false, "success compareAndExchange boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, true, "success compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, false, false);
+            assertEquals(r, true, "failing compareAndExchange boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, true, "failing compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, true, false);
+            assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, true, false);
+            assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, false, true);
+            assertEquals(r, false, "success compareAndExchangeRelease boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, false, false);
+            assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "weakCompareAndSet boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "weakCompareAndSetRelease boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+        }
+
+        // Compare set and get
+        {
+            boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, false);
+            assertEquals(o, true, "getAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, false, "getAndSet boolean value");
+        }
 
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessBoolean recv, Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, true, false);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, true, false);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, true);
-            });
-        }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkUOE(am, () -> {
@@ -208,27 +297,116 @@
             assertEquals(x, false, "setOpaque boolean value");
         }
 
+        hs.get(TestAccessMode.SET).invokeExact(true);
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(true, false);
+            assertEquals(r, true, "success compareAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "success compareAndSet boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(true, false);
+            assertEquals(r, false, "failing compareAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "failing compareAndSet boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(false, true);
+            assertEquals(r, false, "success compareAndExchange boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, true, "success compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(false, false);
+            assertEquals(r, true, "failing compareAndExchange boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, true, "failing compareAndExchange boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(true, false);
+            assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(true, false);
+            assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(false, true);
+            assertEquals(r, false, "success compareAndExchangeRelease boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(false, false);
+            assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "weakCompareAndSet boolean value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(true, false);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "weakCompareAndSetRelease boolean");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(false, true);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+        }
+
+        // Compare set and get
+        {
+            boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET).invokeExact( false);
+            assertEquals(o, true, "getAndSet boolean");
+            boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, false, "getAndSet boolean value");
+        }
 
     }
 
     static void testStaticFieldUnsupported(Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(true, false);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(true, false);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(true);
-            });
-        }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkUOE(am, () -> {
@@ -271,6 +449,112 @@
                 assertEquals(x, false, "setOpaque boolean value");
             }
 
+            hs.get(TestAccessMode.SET).invokeExact(array, i, true);
+
+            // Compare
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, true, false);
+                assertEquals(r, true, "success compareAndSet boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "success compareAndSet boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, true, false);
+                assertEquals(r, false, "failing compareAndSet boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "failing compareAndSet boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, false, true);
+                assertEquals(r, false, "success compareAndExchange boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, true, "success compareAndExchange boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, false, false);
+                assertEquals(r, true, "failing compareAndExchange boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, true, "failing compareAndExchange boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, true, false);
+                assertEquals(r, true, "success compareAndExchangeAcquire boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "success compareAndExchangeAcquire boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, true, false);
+                assertEquals(r, false, "failing compareAndExchangeAcquire boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "failing compareAndExchangeAcquire boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, false, true);
+                assertEquals(r, false, "success compareAndExchangeRelease boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, true, "success compareAndExchangeRelease boolean value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, false, false);
+                assertEquals(r, true, "failing compareAndExchangeRelease boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, true, "failing compareAndExchangeRelease boolean value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, true, false);
+                }
+                assertEquals(success, true, "weakCompareAndSet boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "weakCompareAndSet boolean value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, false, true);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, true, "weakCompareAndSetAcquire boolean");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, true, false);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "weakCompareAndSetRelease boolean");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, false, true);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, true, "weakCompareAndSetVolatile boolean");
+            }
+
+            // Compare set and get
+            {
+                boolean o = (boolean) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, false);
+                assertEquals(o, true, "getAndSet boolean");
+                boolean x = (boolean) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, false, "getAndSet boolean value");
+            }
 
         }
     }
@@ -279,23 +563,6 @@
         boolean[] array = new boolean[10];
 
         final int i = 0;
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, true, false);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, true, false);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, true);
-            });
-        }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkUOE(am, () -> {
@@ -322,6 +589,23 @@
                 });
             }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, true, false);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, false, true);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean o = (boolean) hs.get(am).invokeExact(array, ci, true);
+                });
+            }
 
         }
     }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessByte.java	Thu Jul 07 18:35:29 2016 +0000
@@ -39,11 +39,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestMethodHandleAccessByte extends VarHandleBaseTest {
-    static final byte static_final_v = (byte)1;
+    static final byte static_final_v = (byte)0x01;
 
     static byte static_v;
 
-    final byte final_v = (byte)1;
+    final byte final_v = (byte)0x01;
 
     byte v;
 
@@ -121,120 +121,306 @@
     static void testInstanceField(VarHandleTestMethodHandleAccessByte recv, Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(recv, (byte)1);
+            hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
             byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, (byte)1, "set byte value");
+            assertEquals(x, (byte)0x01, "set byte value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, (byte)2);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, (byte)0x23);
             byte x = (byte) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(recv);
-            assertEquals(x, (byte)2, "setVolatile byte value");
+            assertEquals(x, (byte)0x23, "setVolatile byte value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, (byte)1);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, (byte)0x01);
             byte x = (byte) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(recv);
-            assertEquals(x, (byte)1, "setRelease byte value");
+            assertEquals(x, (byte)0x01, "setRelease byte value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, (byte)2);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, (byte)0x23);
             byte x = (byte) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(recv);
-            assertEquals(x, (byte)2, "setOpaque byte value");
+            assertEquals(x, (byte)0x23, "setOpaque byte value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, (byte)0x01, (byte)0x23);
+            assertEquals(r, true, "success compareAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "success compareAndSet byte value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, (byte)0x01, (byte)0x45);
+            assertEquals(r, false, "failing compareAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "failing compareAndSet byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchange byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, (byte)0x01, (byte)0x23);
+            assertEquals(r, (byte)0x01, "success compareAndExchangeAcquire byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "success compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, (byte)0x01, (byte)0x45);
+            assertEquals(r, (byte)0x23, "failing compareAndExchangeAcquire byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "failing compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, (byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchangeRelease byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x01, "success compareAndExchangeRelease byte value");
         }
 
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, (byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchangeRelease byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x01, "failing compareAndExchangeRelease byte value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, (byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, (byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, (byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+        }
+
+        // Compare set and get
+        {
+            byte o = (byte) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, (byte)0x23);
+            assertEquals(o, (byte)0x01, "getAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (byte)0x23, "getAndSet byte value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, (byte)0x01);
+
+        // get and add, add and get
+        {
+            byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, (byte)0x45);
+            assertEquals(o, (byte)0x01, "getAndAdd byte");
+            byte c = (byte) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, (byte)0x45);
+            assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessByte recv, Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, (byte)1, (byte)2);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact(recv, (byte)1, (byte)2);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact(recv, (byte)1);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact(recv, (byte)1);
-            });
-        }
     }
 
 
     static void testStaticField(Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact((byte)1);
+            hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
             byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, (byte)1, "set byte value");
+            assertEquals(x, (byte)0x01, "set byte value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact((byte)2);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact((byte)0x23);
             byte x = (byte) hs.get(TestAccessMode.GET_VOLATILE).invokeExact();
-            assertEquals(x, (byte)2, "setVolatile byte value");
+            assertEquals(x, (byte)0x23, "setVolatile byte value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact((byte)1);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact((byte)0x01);
             byte x = (byte) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact();
-            assertEquals(x, (byte)1, "setRelease byte value");
+            assertEquals(x, (byte)0x01, "setRelease byte value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact((byte)2);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact((byte)0x23);
             byte x = (byte) hs.get(TestAccessMode.GET_OPAQUE).invokeExact();
-            assertEquals(x, (byte)2, "setOpaque byte value");
+            assertEquals(x, (byte)0x23, "setOpaque byte value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact((byte)0x01, (byte)0x23);
+            assertEquals(r, true, "success compareAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "success compareAndSet byte value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact((byte)0x01, (byte)0x45);
+            assertEquals(r, false, "failing compareAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "failing compareAndSet byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchange byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact((byte)0x01, (byte)0x23);
+            assertEquals(r, (byte)0x01, "success compareAndExchangeAcquire byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "success compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact((byte)0x01, (byte)0x45);
+            assertEquals(r, (byte)0x23, "failing compareAndExchangeAcquire byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "failing compareAndExchangeAcquire byte value");
+        }
+
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact((byte)0x23, (byte)0x01);
+            assertEquals(r, (byte)0x23, "success compareAndExchangeRelease byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x01, "success compareAndExchangeRelease byte value");
         }
 
+        {
+            byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact((byte)0x23, (byte)0x45);
+            assertEquals(r, (byte)0x01, "failing compareAndExchangeRelease byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x01, "failing compareAndExchangeRelease byte value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact((byte)0x01, (byte)0x23);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact((byte)0x23, (byte)0x01);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+        }
+
+        // Compare set and get
+        {
+            byte o = (byte) hs.get(TestAccessMode.GET_AND_SET).invokeExact( (byte)0x23);
+            assertEquals(o, (byte)0x01, "getAndSet byte");
+            byte x = (byte) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (byte)0x23, "getAndSet byte value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact((byte)0x01);
+
+        // get and add, add and get
+        {
+            byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( (byte)0x45);
+            assertEquals(o, (byte)0x01, "getAndAdd byte");
+            byte c = (byte) hs.get(TestAccessMode.ADD_AND_GET).invokeExact((byte)0x45);
+            assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+        }
     }
 
     static void testStaticFieldUnsupported(Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact((byte)1, (byte)2);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact((byte)1, (byte)2);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact((byte)1);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact((byte)1);
-            });
-        }
     }
 
 
@@ -244,34 +430,149 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)1);
+                hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
                 byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, (byte)1, "get byte value");
+                assertEquals(x, (byte)0x01, "get byte value");
             }
 
 
             // Volatile
             {
-                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, (byte)2);
+                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, (byte)0x23);
                 byte x = (byte) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(array, i);
-                assertEquals(x, (byte)2, "setVolatile byte value");
+                assertEquals(x, (byte)0x23, "setVolatile byte value");
             }
 
             // Lazy
             {
-                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, (byte)1);
+                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, (byte)0x01);
                 byte x = (byte) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(array, i);
-                assertEquals(x, (byte)1, "setRelease byte value");
+                assertEquals(x, (byte)0x01, "setRelease byte value");
             }
 
             // Opaque
             {
-                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, (byte)2);
+                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, (byte)0x23);
                 byte x = (byte) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(array, i);
-                assertEquals(x, (byte)2, "setOpaque byte value");
+                assertEquals(x, (byte)0x23, "setOpaque byte value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+            // Compare
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, (byte)0x01, (byte)0x23);
+                assertEquals(r, true, "success compareAndSet byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "success compareAndSet byte value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, (byte)0x01, (byte)0x45);
+                assertEquals(r, false, "failing compareAndSet byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "failing compareAndSet byte value");
+            }
+
+            {
+                byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (byte)0x23, (byte)0x01);
+                assertEquals(r, (byte)0x23, "success compareAndExchange byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x01, "success compareAndExchange byte value");
+            }
+
+            {
+                byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (byte)0x23, (byte)0x45);
+                assertEquals(r, (byte)0x01, "failing compareAndExchange byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x01, "failing compareAndExchange byte value");
+            }
+
+            {
+                byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, (byte)0x01, (byte)0x23);
+                assertEquals(r, (byte)0x01, "success compareAndExchangeAcquire byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "success compareAndExchangeAcquire byte value");
+            }
+
+            {
+                byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, (byte)0x01, (byte)0x45);
+                assertEquals(r, (byte)0x23, "failing compareAndExchangeAcquire byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "failing compareAndExchangeAcquire byte value");
+            }
+
+            {
+                byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, (byte)0x23, (byte)0x01);
+                assertEquals(r, (byte)0x23, "success compareAndExchangeRelease byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x01, "success compareAndExchangeRelease byte value");
             }
 
+            {
+                byte r = (byte) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, (byte)0x23, (byte)0x45);
+                assertEquals(r, (byte)0x01, "failing compareAndExchangeRelease byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x01, "failing compareAndExchangeRelease byte value");
+            }
 
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (byte)0x01, (byte)0x23);
+                }
+                assertEquals(success, true, "weakCompareAndSet byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "weakCompareAndSet byte value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, (byte)0x23, (byte)0x01);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x01, "weakCompareAndSetAcquire byte");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, (byte)0x01, (byte)0x23);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "weakCompareAndSetRelease byte");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, (byte)0x23, (byte)0x01);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x01, "weakCompareAndSetVolatile byte");
+            }
+
+            // Compare set and get
+            {
+                byte o = (byte) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, (byte)0x23);
+                assertEquals(o, (byte)0x01, "getAndSet byte");
+                byte x = (byte) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (byte)0x23, "getAndSet byte value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, (byte)0x01);
+
+            // get and add, add and get
+            {
+                byte o = (byte) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, (byte)0x45);
+                assertEquals(o, (byte)0x01, "getAndAdd byte");
+                byte c = (byte) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, (byte)0x45);
+                assertEquals(c, (byte)((byte)0x01 + (byte)0x45 + (byte)0x45), "getAndAdd byte value");
+            }
         }
     }
 
@@ -279,29 +580,7 @@
         byte[] array = new byte[10];
 
         final int i = 0;
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, (byte)1, (byte)2);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact(array, i, (byte)1, (byte)2);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                byte r = (byte) hs.get(am).invokeExact(array, i, (byte)1);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                byte o = (byte) hs.get(am).invokeExact(array, i, (byte)1);
-            });
-        }
     }
 
     static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -318,11 +597,33 @@
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
                 checkIOOBE(am, () -> {
-                    hs.get(am).invokeExact(array, ci, (byte)1);
+                    hs.get(am).invokeExact(array, ci, (byte)0x01);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, (byte)0x01, (byte)0x23);
                 });
             }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+                checkIOOBE(am, () -> {
+                    byte r = (byte) hs.get(am).invokeExact(array, ci, (byte)0x23, (byte)0x01);
+                });
+            }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    byte o = (byte) hs.get(am).invokeExact(array, ci, (byte)0x01);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+                checkIOOBE(am, () -> {
+                    byte o = (byte) hs.get(am).invokeExact(array, ci, (byte)0x45);
+                });
+            }
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessChar.java	Thu Jul 07 18:35:29 2016 +0000
@@ -39,11 +39,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestMethodHandleAccessChar extends VarHandleBaseTest {
-    static final char static_final_v = 'a';
+    static final char static_final_v = '\u0123';
 
     static char static_v;
 
-    final char final_v = 'a';
+    final char final_v = '\u0123';
 
     char v;
 
@@ -121,120 +121,306 @@
     static void testInstanceField(VarHandleTestMethodHandleAccessChar recv, Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(recv, 'a');
+            hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
             char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 'a', "set char value");
+            assertEquals(x, '\u0123', "set char value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, 'b');
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, '\u4567');
             char x = (char) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(recv);
-            assertEquals(x, 'b', "setVolatile char value");
+            assertEquals(x, '\u4567', "setVolatile char value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, 'a');
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, '\u0123');
             char x = (char) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(recv);
-            assertEquals(x, 'a', "setRelease char value");
+            assertEquals(x, '\u0123', "setRelease char value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, 'b');
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, '\u4567');
             char x = (char) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(recv);
-            assertEquals(x, 'b', "setOpaque char value");
+            assertEquals(x, '\u4567', "setOpaque char value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, '\u0123', '\u4567');
+            assertEquals(r, true, "success compareAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "success compareAndSet char value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, '\u0123', '\u89AB');
+            assertEquals(r, false, "failing compareAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "failing compareAndSet char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, '\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchange char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u0123', "success compareAndExchange char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, '\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchange char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u0123', "failing compareAndExchange char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, '\u0123', '\u4567');
+            assertEquals(r, '\u0123', "success compareAndExchangeAcquire char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "success compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, '\u0123', '\u89AB');
+            assertEquals(r, '\u4567', "failing compareAndExchangeAcquire char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "failing compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, '\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchangeRelease char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u0123', "success compareAndExchangeRelease char value");
         }
 
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, '\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchangeRelease char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u0123', "failing compareAndExchangeRelease char value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, '\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "weakCompareAndSet char value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, '\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u0123', "weakCompareAndSetAcquire char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, '\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "weakCompareAndSetRelease char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, '\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+        }
+
+        // Compare set and get
+        {
+            char o = (char) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, '\u4567');
+            assertEquals(o, '\u0123', "getAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, '\u4567', "getAndSet char value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, '\u0123');
+
+        // get and add, add and get
+        {
+            char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, '\u89AB');
+            assertEquals(o, '\u0123', "getAndAdd char");
+            char c = (char) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, '\u89AB');
+            assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessChar recv, Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, 'a', 'b');
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact(recv, 'a', 'b');
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact(recv, 'a');
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact(recv, 'a');
-            });
-        }
     }
 
 
     static void testStaticField(Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact('a');
+            hs.get(TestAccessMode.SET).invokeExact('\u0123');
             char x = (char) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 'a', "set char value");
+            assertEquals(x, '\u0123', "set char value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact('b');
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact('\u4567');
             char x = (char) hs.get(TestAccessMode.GET_VOLATILE).invokeExact();
-            assertEquals(x, 'b', "setVolatile char value");
+            assertEquals(x, '\u4567', "setVolatile char value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact('a');
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact('\u0123');
             char x = (char) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact();
-            assertEquals(x, 'a', "setRelease char value");
+            assertEquals(x, '\u0123', "setRelease char value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact('b');
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact('\u4567');
             char x = (char) hs.get(TestAccessMode.GET_OPAQUE).invokeExact();
-            assertEquals(x, 'b', "setOpaque char value");
+            assertEquals(x, '\u4567', "setOpaque char value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact('\u0123', '\u4567');
+            assertEquals(r, true, "success compareAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "success compareAndSet char value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact('\u0123', '\u89AB');
+            assertEquals(r, false, "failing compareAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "failing compareAndSet char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact('\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchange char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u0123', "success compareAndExchange char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact('\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchange char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u0123', "failing compareAndExchange char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact('\u0123', '\u4567');
+            assertEquals(r, '\u0123', "success compareAndExchangeAcquire char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "success compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact('\u0123', '\u89AB');
+            assertEquals(r, '\u4567', "failing compareAndExchangeAcquire char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "failing compareAndExchangeAcquire char value");
+        }
+
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact('\u4567', '\u0123');
+            assertEquals(r, '\u4567', "success compareAndExchangeRelease char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u0123', "success compareAndExchangeRelease char value");
         }
 
+        {
+            char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact('\u4567', '\u89AB');
+            assertEquals(r, '\u0123', "failing compareAndExchangeRelease char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u0123', "failing compareAndExchangeRelease char value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact('\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "weakCompareAndSet char value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact('\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u0123', "weakCompareAndSetAcquire char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact('\u0123', '\u4567');
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "weakCompareAndSetRelease char");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact('\u4567', '\u0123');
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+        }
+
+        // Compare set and get
+        {
+            char o = (char) hs.get(TestAccessMode.GET_AND_SET).invokeExact( '\u4567');
+            assertEquals(o, '\u0123', "getAndSet char");
+            char x = (char) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, '\u4567', "getAndSet char value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact('\u0123');
+
+        // get and add, add and get
+        {
+            char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( '\u89AB');
+            assertEquals(o, '\u0123', "getAndAdd char");
+            char c = (char) hs.get(TestAccessMode.ADD_AND_GET).invokeExact('\u89AB');
+            assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+        }
     }
 
     static void testStaticFieldUnsupported(Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact('a', 'b');
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact('a', 'b');
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact('a');
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact('a');
-            });
-        }
     }
 
 
@@ -244,34 +430,149 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                hs.get(TestAccessMode.SET).invokeExact(array, i, 'a');
+                hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
                 char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 'a', "get char value");
+                assertEquals(x, '\u0123', "get char value");
             }
 
 
             // Volatile
             {
-                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, 'b');
+                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, '\u4567');
                 char x = (char) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(array, i);
-                assertEquals(x, 'b', "setVolatile char value");
+                assertEquals(x, '\u4567', "setVolatile char value");
             }
 
             // Lazy
             {
-                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, 'a');
+                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, '\u0123');
                 char x = (char) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(array, i);
-                assertEquals(x, 'a', "setRelease char value");
+                assertEquals(x, '\u0123', "setRelease char value");
             }
 
             // Opaque
             {
-                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, 'b');
+                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, '\u4567');
                 char x = (char) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(array, i);
-                assertEquals(x, 'b', "setOpaque char value");
+                assertEquals(x, '\u4567', "setOpaque char value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+            // Compare
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, '\u0123', '\u4567');
+                assertEquals(r, true, "success compareAndSet char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "success compareAndSet char value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, '\u0123', '\u89AB');
+                assertEquals(r, false, "failing compareAndSet char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "failing compareAndSet char value");
+            }
+
+            {
+                char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, '\u4567', '\u0123');
+                assertEquals(r, '\u4567', "success compareAndExchange char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u0123', "success compareAndExchange char value");
+            }
+
+            {
+                char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, '\u4567', '\u89AB');
+                assertEquals(r, '\u0123', "failing compareAndExchange char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u0123', "failing compareAndExchange char value");
+            }
+
+            {
+                char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, '\u0123', '\u4567');
+                assertEquals(r, '\u0123', "success compareAndExchangeAcquire char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "success compareAndExchangeAcquire char value");
+            }
+
+            {
+                char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, '\u0123', '\u89AB');
+                assertEquals(r, '\u4567', "failing compareAndExchangeAcquire char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "failing compareAndExchangeAcquire char value");
+            }
+
+            {
+                char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, '\u4567', '\u0123');
+                assertEquals(r, '\u4567', "success compareAndExchangeRelease char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u0123', "success compareAndExchangeRelease char value");
             }
 
+            {
+                char r = (char) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, '\u4567', '\u89AB');
+                assertEquals(r, '\u0123', "failing compareAndExchangeRelease char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u0123', "failing compareAndExchangeRelease char value");
+            }
 
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, '\u0123', '\u4567');
+                }
+                assertEquals(success, true, "weakCompareAndSet char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "weakCompareAndSet char value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, '\u4567', '\u0123');
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u0123', "weakCompareAndSetAcquire char");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, '\u0123', '\u4567');
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "weakCompareAndSetRelease char");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, '\u4567', '\u0123');
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u0123', "weakCompareAndSetVolatile char");
+            }
+
+            // Compare set and get
+            {
+                char o = (char) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, '\u4567');
+                assertEquals(o, '\u0123', "getAndSet char");
+                char x = (char) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, '\u4567', "getAndSet char value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, '\u0123');
+
+            // get and add, add and get
+            {
+                char o = (char) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, '\u89AB');
+                assertEquals(o, '\u0123', "getAndAdd char");
+                char c = (char) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, '\u89AB');
+                assertEquals(c, (char)('\u0123' + '\u89AB' + '\u89AB'), "getAndAdd char value");
+            }
         }
     }
 
@@ -279,29 +580,7 @@
         char[] array = new char[10];
 
         final int i = 0;
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, 'a', 'b');
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact(array, i, 'a', 'b');
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                char r = (char) hs.get(am).invokeExact(array, i, 'a');
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                char o = (char) hs.get(am).invokeExact(array, i, 'a');
-            });
-        }
     }
 
     static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -318,11 +597,33 @@
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
                 checkIOOBE(am, () -> {
-                    hs.get(am).invokeExact(array, ci, 'a');
+                    hs.get(am).invokeExact(array, ci, '\u0123');
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, '\u0123', '\u4567');
                 });
             }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+                checkIOOBE(am, () -> {
+                    char r = (char) hs.get(am).invokeExact(array, ci, '\u4567', '\u0123');
+                });
+            }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    char o = (char) hs.get(am).invokeExact(array, ci, '\u0123');
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+                checkIOOBE(am, () -> {
+                    char o = (char) hs.get(am).invokeExact(array, ci, '\u89AB');
+                });
+            }
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessDouble.java	Thu Jul 07 18:35:29 2016 +0000
@@ -148,33 +148,126 @@
             assertEquals(x, 2.0d, "setOpaque double value");
         }
 
+        hs.get(TestAccessMode.SET).invokeExact(recv, 1.0d);
 
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1.0d, 2.0d);
+            assertEquals(r, true, "success compareAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "success compareAndSet double value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1.0d, 3.0d);
+            assertEquals(r, false, "failing compareAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "failing compareAndSet double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchange double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0d, "success compareAndExchange double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchange double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0d, "failing compareAndExchange double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1.0d, 2.0d);
+            assertEquals(r, 1.0d, "success compareAndExchangeAcquire double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "success compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1.0d, 3.0d);
+            assertEquals(r, 2.0d, "failing compareAndExchangeAcquire double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "failing compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchangeRelease double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0d, "success compareAndExchangeRelease double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchangeRelease double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0d, "failing compareAndExchangeRelease double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "weakCompareAndSet double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0d, "weakCompareAndSetAcquire double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "weakCompareAndSetRelease double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+        }
+
+        // Compare set and get
+        {
+            double o = (double) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, 2.0d);
+            assertEquals(o, 1.0d, "getAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0d, "getAndSet double value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, 1.0d);
+
+        // get and add, add and get
+        {
+            double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 3.0d);
+            assertEquals(o, 1.0d, "getAndAdd double");
+            double c = (double) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 3.0d);
+            assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessDouble recv, Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, 1.0d, 2.0d);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(recv, 1.0d, 2.0d);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(recv, 1.0d);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(recv, 1.0d);
-            });
-        }
     }
 
 
@@ -208,33 +301,126 @@
             assertEquals(x, 2.0d, "setOpaque double value");
         }
 
+        hs.get(TestAccessMode.SET).invokeExact(1.0d);
 
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1.0d, 2.0d);
+            assertEquals(r, true, "success compareAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "success compareAndSet double value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1.0d, 3.0d);
+            assertEquals(r, false, "failing compareAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "failing compareAndSet double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchange double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0d, "success compareAndExchange double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchange double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0d, "failing compareAndExchange double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1.0d, 2.0d);
+            assertEquals(r, 1.0d, "success compareAndExchangeAcquire double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "success compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1.0d, 3.0d);
+            assertEquals(r, 2.0d, "failing compareAndExchangeAcquire double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "failing compareAndExchangeAcquire double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2.0d, 1.0d);
+            assertEquals(r, 2.0d, "success compareAndExchangeRelease double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0d, "success compareAndExchangeRelease double value");
+        }
+
+        {
+            double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2.0d, 3.0d);
+            assertEquals(r, 1.0d, "failing compareAndExchangeRelease double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0d, "failing compareAndExchangeRelease double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "weakCompareAndSet double value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0d, "weakCompareAndSetAcquire double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1.0d, 2.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "weakCompareAndSetRelease double");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(2.0d, 1.0d);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+        }
+
+        // Compare set and get
+        {
+            double o = (double) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 2.0d);
+            assertEquals(o, 1.0d, "getAndSet double");
+            double x = (double) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0d, "getAndSet double value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(1.0d);
+
+        // get and add, add and get
+        {
+            double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 3.0d);
+            assertEquals(o, 1.0d, "getAndAdd double");
+            double c = (double) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(3.0d);
+            assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+        }
     }
 
     static void testStaticFieldUnsupported(Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(1.0d, 2.0d);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(1.0d, 2.0d);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(1.0d);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(1.0d);
-            });
-        }
     }
 
 
@@ -271,7 +457,122 @@
                 assertEquals(x, 2.0d, "setOpaque double value");
             }
 
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
 
+            // Compare
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1.0d, 2.0d);
+                assertEquals(r, true, "success compareAndSet double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "success compareAndSet double value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1.0d, 3.0d);
+                assertEquals(r, false, "failing compareAndSet double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "failing compareAndSet double value");
+            }
+
+            {
+                double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0d, 1.0d);
+                assertEquals(r, 2.0d, "success compareAndExchange double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0d, "success compareAndExchange double value");
+            }
+
+            {
+                double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0d, 3.0d);
+                assertEquals(r, 1.0d, "failing compareAndExchange double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0d, "failing compareAndExchange double value");
+            }
+
+            {
+                double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1.0d, 2.0d);
+                assertEquals(r, 1.0d, "success compareAndExchangeAcquire double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "success compareAndExchangeAcquire double value");
+            }
+
+            {
+                double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1.0d, 3.0d);
+                assertEquals(r, 2.0d, "failing compareAndExchangeAcquire double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "failing compareAndExchangeAcquire double value");
+            }
+
+            {
+                double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2.0d, 1.0d);
+                assertEquals(r, 2.0d, "success compareAndExchangeRelease double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0d, "success compareAndExchangeRelease double value");
+            }
+
+            {
+                double r = (double) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2.0d, 3.0d);
+                assertEquals(r, 1.0d, "failing compareAndExchangeRelease double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0d, "failing compareAndExchangeRelease double value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 1.0d, 2.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSet double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "weakCompareAndSet double value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2.0d, 1.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0d, "weakCompareAndSetAcquire double");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1.0d, 2.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "weakCompareAndSetRelease double");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 2.0d, 1.0d);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0d, "weakCompareAndSetVolatile double");
+            }
+
+            // Compare set and get
+            {
+                double o = (double) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 2.0d);
+                assertEquals(o, 1.0d, "getAndSet double");
+                double x = (double) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0d, "getAndSet double value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0d);
+
+            // get and add, add and get
+            {
+                double o = (double) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 3.0d);
+                assertEquals(o, 1.0d, "getAndAdd double");
+                double c = (double) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 3.0d);
+                assertEquals(c, (double)(1.0d + 3.0d + 3.0d), "getAndAdd double value");
+            }
         }
     }
 
@@ -279,29 +580,7 @@
         double[] array = new double[10];
 
         final int i = 0;
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, 1.0d, 2.0d);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(array, i, 1.0d, 2.0d);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                double r = (double) hs.get(am).invokeExact(array, i, 1.0d);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                double o = (double) hs.get(am).invokeExact(array, i, 1.0d);
-            });
-        }
     }
 
     static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -322,7 +601,29 @@
                 });
             }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, 1.0d, 2.0d);
+                });
+            }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+                checkIOOBE(am, () -> {
+                    double r = (double) hs.get(am).invokeExact(array, ci, 2.0d, 1.0d);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    double o = (double) hs.get(am).invokeExact(array, ci, 1.0d);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+                checkIOOBE(am, () -> {
+                    double o = (double) hs.get(am).invokeExact(array, ci, 3.0d);
+                });
+            }
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessFloat.java	Thu Jul 07 18:35:29 2016 +0000
@@ -148,33 +148,126 @@
             assertEquals(x, 2.0f, "setOpaque float value");
         }
 
+        hs.get(TestAccessMode.SET).invokeExact(recv, 1.0f);
 
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1.0f, 2.0f);
+            assertEquals(r, true, "success compareAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "success compareAndSet float value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1.0f, 3.0f);
+            assertEquals(r, false, "failing compareAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "failing compareAndSet float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchange float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0f, "success compareAndExchange float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchange float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0f, "failing compareAndExchange float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1.0f, 2.0f);
+            assertEquals(r, 1.0f, "success compareAndExchangeAcquire float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "success compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1.0f, 3.0f);
+            assertEquals(r, 2.0f, "failing compareAndExchangeAcquire float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "failing compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchangeRelease float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0f, "success compareAndExchangeRelease float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchangeRelease float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0f, "failing compareAndExchangeRelease float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "weakCompareAndSet float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0f, "weakCompareAndSetAcquire float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "weakCompareAndSetRelease float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+        }
+
+        // Compare set and get
+        {
+            float o = (float) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, 2.0f);
+            assertEquals(o, 1.0f, "getAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, 2.0f, "getAndSet float value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, 1.0f);
+
+        // get and add, add and get
+        {
+            float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 3.0f);
+            assertEquals(o, 1.0f, "getAndAdd float");
+            float c = (float) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 3.0f);
+            assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessFloat recv, Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, 1.0f, 2.0f);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(recv, 1.0f, 2.0f);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(recv, 1.0f);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(recv, 1.0f);
-            });
-        }
     }
 
 
@@ -208,33 +301,126 @@
             assertEquals(x, 2.0f, "setOpaque float value");
         }
 
+        hs.get(TestAccessMode.SET).invokeExact(1.0f);
 
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1.0f, 2.0f);
+            assertEquals(r, true, "success compareAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "success compareAndSet float value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1.0f, 3.0f);
+            assertEquals(r, false, "failing compareAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "failing compareAndSet float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchange float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0f, "success compareAndExchange float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchange float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0f, "failing compareAndExchange float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1.0f, 2.0f);
+            assertEquals(r, 1.0f, "success compareAndExchangeAcquire float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "success compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1.0f, 3.0f);
+            assertEquals(r, 2.0f, "failing compareAndExchangeAcquire float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "failing compareAndExchangeAcquire float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2.0f, 1.0f);
+            assertEquals(r, 2.0f, "success compareAndExchangeRelease float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0f, "success compareAndExchangeRelease float value");
+        }
+
+        {
+            float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2.0f, 3.0f);
+            assertEquals(r, 1.0f, "failing compareAndExchangeRelease float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0f, "failing compareAndExchangeRelease float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "weakCompareAndSet float value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0f, "weakCompareAndSetAcquire float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1.0f, 2.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "weakCompareAndSetRelease float");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(2.0f, 1.0f);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+        }
+
+        // Compare set and get
+        {
+            float o = (float) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 2.0f);
+            assertEquals(o, 1.0f, "getAndSet float");
+            float x = (float) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, 2.0f, "getAndSet float value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(1.0f);
+
+        // get and add, add and get
+        {
+            float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 3.0f);
+            assertEquals(o, 1.0f, "getAndAdd float");
+            float c = (float) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(3.0f);
+            assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+        }
     }
 
     static void testStaticFieldUnsupported(Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(1.0f, 2.0f);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(1.0f, 2.0f);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(1.0f);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(1.0f);
-            });
-        }
     }
 
 
@@ -271,7 +457,122 @@
                 assertEquals(x, 2.0f, "setOpaque float value");
             }
 
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
 
+            // Compare
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1.0f, 2.0f);
+                assertEquals(r, true, "success compareAndSet float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "success compareAndSet float value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1.0f, 3.0f);
+                assertEquals(r, false, "failing compareAndSet float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "failing compareAndSet float value");
+            }
+
+            {
+                float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0f, 1.0f);
+                assertEquals(r, 2.0f, "success compareAndExchange float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0f, "success compareAndExchange float value");
+            }
+
+            {
+                float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 2.0f, 3.0f);
+                assertEquals(r, 1.0f, "failing compareAndExchange float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0f, "failing compareAndExchange float value");
+            }
+
+            {
+                float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1.0f, 2.0f);
+                assertEquals(r, 1.0f, "success compareAndExchangeAcquire float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "success compareAndExchangeAcquire float value");
+            }
+
+            {
+                float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1.0f, 3.0f);
+                assertEquals(r, 2.0f, "failing compareAndExchangeAcquire float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "failing compareAndExchangeAcquire float value");
+            }
+
+            {
+                float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2.0f, 1.0f);
+                assertEquals(r, 2.0f, "success compareAndExchangeRelease float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0f, "success compareAndExchangeRelease float value");
+            }
+
+            {
+                float r = (float) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2.0f, 3.0f);
+                assertEquals(r, 1.0f, "failing compareAndExchangeRelease float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0f, "failing compareAndExchangeRelease float value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 1.0f, 2.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSet float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "weakCompareAndSet float value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2.0f, 1.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0f, "weakCompareAndSetAcquire float");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1.0f, 2.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "weakCompareAndSetRelease float");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 2.0f, 1.0f);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 1.0f, "weakCompareAndSetVolatile float");
+            }
+
+            // Compare set and get
+            {
+                float o = (float) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 2.0f);
+                assertEquals(o, 1.0f, "getAndSet float");
+                float x = (float) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, 2.0f, "getAndSet float value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 1.0f);
+
+            // get and add, add and get
+            {
+                float o = (float) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 3.0f);
+                assertEquals(o, 1.0f, "getAndAdd float");
+                float c = (float) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 3.0f);
+                assertEquals(c, (float)(1.0f + 3.0f + 3.0f), "getAndAdd float value");
+            }
         }
     }
 
@@ -279,29 +580,7 @@
         float[] array = new float[10];
 
         final int i = 0;
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, 1.0f, 2.0f);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(array, i, 1.0f, 2.0f);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                float r = (float) hs.get(am).invokeExact(array, i, 1.0f);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                float o = (float) hs.get(am).invokeExact(array, i, 1.0f);
-            });
-        }
     }
 
     static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -322,7 +601,29 @@
                 });
             }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, 1.0f, 2.0f);
+                });
+            }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+                checkIOOBE(am, () -> {
+                    float r = (float) hs.get(am).invokeExact(array, ci, 2.0f, 1.0f);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    float o = (float) hs.get(am).invokeExact(array, ci, 1.0f);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+                checkIOOBE(am, () -> {
+                    float o = (float) hs.get(am).invokeExact(array, ci, 3.0f);
+                });
+            }
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessInt.java	Thu Jul 07 18:35:29 2016 +0000
@@ -39,11 +39,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestMethodHandleAccessInt extends VarHandleBaseTest {
-    static final int static_final_v = 1;
+    static final int static_final_v = 0x01234567;
 
     static int static_v;
 
-    final int final_v = 1;
+    final int final_v = 0x01234567;
 
     int v;
 
@@ -121,148 +121,148 @@
     static void testInstanceField(VarHandleTestMethodHandleAccessInt recv, Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(recv, 1);
+            hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "set int value");
+            assertEquals(x, 0x01234567, "set int value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, 2);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, 0x89ABCDEF);
             int x = (int) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(recv);
-            assertEquals(x, 2, "setVolatile int value");
+            assertEquals(x, 0x89ABCDEF, "setVolatile int value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, 1);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, 0x01234567);
             int x = (int) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(recv);
-            assertEquals(x, 1, "setRelease int value");
+            assertEquals(x, 0x01234567, "setRelease int value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, 2);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, 0x89ABCDEF);
             int x = (int) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(recv);
-            assertEquals(x, 2, "setOpaque int value");
+            assertEquals(x, 0x89ABCDEF, "setOpaque int value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(recv, 1);
+        hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
 
         // Compare
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1, 2);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 0x01234567, 0x89ABCDEF);
             assertEquals(r, true, "success compareAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "success compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndSet int value");
         }
 
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1, 3);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 0x01234567, 0xCAFEBABE);
             assertEquals(r, false, "failing compareAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "failing compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2, 1);
-            assertEquals(r, 2, "success compareAndExchangeVolatile int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "success compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "success compareAndExchange int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeVolatile int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchange int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "failing compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchange int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1, 2);
-            assertEquals(r, 1, "success compareAndExchangeAcquire int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 0x01234567, 0x89ABCDEF);
+            assertEquals(r, 0x01234567, "success compareAndExchangeAcquire int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "success compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1, 3);
-            assertEquals(r, 2, "failing compareAndExchangeAcquire int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 0x01234567, 0xCAFEBABE);
+            assertEquals(r, 0x89ABCDEF, "failing compareAndExchangeAcquire int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "failing compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2, 1);
-            assertEquals(r, 2, "success compareAndExchangeRelease int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchangeRelease int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "success compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "success compareAndExchangeRelease int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeRelease int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchangeRelease int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "failing compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchangeRelease int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 1, 2);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "weakCompareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2, 1);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "weakCompareAndSetAcquire int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1, 2);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSetRelease int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "weakCompareAndSetRelease int");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 2, 1);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1, "weakCompareAndSetVolatile int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
         }
 
         // Compare set and get
         {
-            int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, 2);
-            assertEquals(o, 1, "getAndSet int");
+            int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, 0x89ABCDEF);
+            assertEquals(o, 0x01234567, "getAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2, "getAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "getAndSet int value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(recv, 1);
+        hs.get(TestAccessMode.SET).invokeExact(recv, 0x01234567);
 
         // get and add, add and get
         {
-            int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 3);
-            assertEquals(o, 1, "getAndAdd int");
-            int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 3);
-            assertEquals(c, 1 + 3 + 3, "getAndAdd int value");
+            int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 0xCAFEBABE);
+            assertEquals(o, 0x01234567, "getAndAdd int");
+            int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 0xCAFEBABE);
+            assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
         }
     }
 
@@ -274,148 +274,148 @@
     static void testStaticField(Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(1);
+            hs.get(TestAccessMode.SET).invokeExact(0x01234567);
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "set int value");
+            assertEquals(x, 0x01234567, "set int value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(2);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(0x89ABCDEF);
             int x = (int) hs.get(TestAccessMode.GET_VOLATILE).invokeExact();
-            assertEquals(x, 2, "setVolatile int value");
+            assertEquals(x, 0x89ABCDEF, "setVolatile int value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(1);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(0x01234567);
             int x = (int) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact();
-            assertEquals(x, 1, "setRelease int value");
+            assertEquals(x, 0x01234567, "setRelease int value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(2);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(0x89ABCDEF);
             int x = (int) hs.get(TestAccessMode.GET_OPAQUE).invokeExact();
-            assertEquals(x, 2, "setOpaque int value");
+            assertEquals(x, 0x89ABCDEF, "setOpaque int value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(1);
+        hs.get(TestAccessMode.SET).invokeExact(0x01234567);
 
         // Compare
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1, 2);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(0x01234567, 0x89ABCDEF);
             assertEquals(r, true, "success compareAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "success compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndSet int value");
         }
 
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1, 3);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(0x01234567, 0xCAFEBABE);
             assertEquals(r, false, "failing compareAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "failing compareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2, 1);
-            assertEquals(r, 2, "success compareAndExchangeVolatile int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "success compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "success compareAndExchange int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeVolatile int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchange int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "failing compareAndExchangeVolatile int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchange int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1, 2);
-            assertEquals(r, 1, "success compareAndExchangeAcquire int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(0x01234567, 0x89ABCDEF);
+            assertEquals(r, 0x01234567, "success compareAndExchangeAcquire int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "success compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "success compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1, 3);
-            assertEquals(r, 2, "failing compareAndExchangeAcquire int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(0x01234567, 0xCAFEBABE);
+            assertEquals(r, 0x89ABCDEF, "failing compareAndExchangeAcquire int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "failing compareAndExchangeAcquire int value");
+            assertEquals(x, 0x89ABCDEF, "failing compareAndExchangeAcquire int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2, 1);
-            assertEquals(r, 2, "success compareAndExchangeRelease int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(0x89ABCDEF, 0x01234567);
+            assertEquals(r, 0x89ABCDEF, "success compareAndExchangeRelease int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "success compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "success compareAndExchangeRelease int value");
         }
 
         {
-            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2, 3);
-            assertEquals(r, 1, "failing compareAndExchangeRelease int");
+            int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(0x89ABCDEF, 0xCAFEBABE);
+            assertEquals(r, 0x01234567, "failing compareAndExchangeRelease int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "failing compareAndExchangeRelease int value");
+            assertEquals(x, 0x01234567, "failing compareAndExchangeRelease int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(1, 2);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "weakCompareAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2, 1);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "weakCompareAndSetAcquire int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1, 2);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(0x01234567, 0x89ABCDEF);
             }
             assertEquals(success, true, "weakCompareAndSetRelease int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "weakCompareAndSetRelease int");
+            assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(2, 1);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(0x89ABCDEF, 0x01234567);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1, "weakCompareAndSetVolatile int");
+            assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
         }
 
         // Compare set and get
         {
-            int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 2);
-            assertEquals(o, 1, "getAndSet int");
+            int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 0x89ABCDEF);
+            assertEquals(o, 0x01234567, "getAndSet int");
             int x = (int) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2, "getAndSet int value");
+            assertEquals(x, 0x89ABCDEF, "getAndSet int value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(1);
+        hs.get(TestAccessMode.SET).invokeExact(0x01234567);
 
         // get and add, add and get
         {
-            int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 3);
-            assertEquals(o, 1, "getAndAdd int");
-            int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(3);
-            assertEquals(c, 1 + 3 + 3, "getAndAdd int value");
+            int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 0xCAFEBABE);
+            assertEquals(o, 0x01234567, "getAndAdd int");
+            int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(0xCAFEBABE);
+            assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
         }
     }
 
@@ -430,148 +430,148 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                hs.get(TestAccessMode.SET).invokeExact(array, i, 1);
+                hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "get int value");
+                assertEquals(x, 0x01234567, "get int value");
             }
 
 
             // Volatile
             {
-                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, 2);
+                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, 0x89ABCDEF);
                 int x = (int) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(array, i);
-                assertEquals(x, 2, "setVolatile int value");
+                assertEquals(x, 0x89ABCDEF, "setVolatile int value");
             }
 
             // Lazy
             {
-                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, 1);
+                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, 0x01234567);
                 int x = (int) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(array, i);
-                assertEquals(x, 1, "setRelease int value");
+                assertEquals(x, 0x01234567, "setRelease int value");
             }
 
             // Opaque
             {
-                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, 2);
+                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, 0x89ABCDEF);
                 int x = (int) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(array, i);
-                assertEquals(x, 2, "setOpaque int value");
+                assertEquals(x, 0x89ABCDEF, "setOpaque int value");
             }
 
-            hs.get(TestAccessMode.SET).invokeExact(array, i, 1);
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
 
             // Compare
             {
-                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1, 2);
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
                 assertEquals(r, true, "success compareAndSet int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "success compareAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "success compareAndSet int value");
             }
 
             {
-                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1, 3);
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 0x01234567, 0xCAFEBABE);
                 assertEquals(r, false, "failing compareAndSet int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "failing compareAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "failing compareAndSet int value");
             }
 
             {
-                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2, 1);
-                assertEquals(r, 2, "success compareAndExchangeVolatile int");
+                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
+                assertEquals(r, 0x89ABCDEF, "success compareAndExchange int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "success compareAndExchangeVolatile int value");
+                assertEquals(x, 0x01234567, "success compareAndExchange int value");
             }
 
             {
-                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2, 3);
-                assertEquals(r, 1, "failing compareAndExchangeVolatile int");
+                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0x89ABCDEF, 0xCAFEBABE);
+                assertEquals(r, 0x01234567, "failing compareAndExchange int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "failing compareAndExchangeVolatile int value");
+                assertEquals(x, 0x01234567, "failing compareAndExchange int value");
             }
 
             {
-                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1, 2);
-                assertEquals(r, 1, "success compareAndExchangeAcquire int");
+                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
+                assertEquals(r, 0x01234567, "success compareAndExchangeAcquire int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "success compareAndExchangeAcquire int value");
+                assertEquals(x, 0x89ABCDEF, "success compareAndExchangeAcquire int value");
             }
 
             {
-                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1, 3);
-                assertEquals(r, 2, "failing compareAndExchangeAcquire int");
+                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 0x01234567, 0xCAFEBABE);
+                assertEquals(r, 0x89ABCDEF, "failing compareAndExchangeAcquire int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "failing compareAndExchangeAcquire int value");
+                assertEquals(x, 0x89ABCDEF, "failing compareAndExchangeAcquire int value");
             }
 
             {
-                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2, 1);
-                assertEquals(r, 2, "success compareAndExchangeRelease int");
+                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
+                assertEquals(r, 0x89ABCDEF, "success compareAndExchangeRelease int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "success compareAndExchangeRelease int value");
+                assertEquals(x, 0x01234567, "success compareAndExchangeRelease int value");
             }
 
             {
-                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2, 3);
-                assertEquals(r, 1, "failing compareAndExchangeRelease int");
+                int r = (int) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 0x89ABCDEF, 0xCAFEBABE);
+                assertEquals(r, 0x01234567, "failing compareAndExchangeRelease int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "failing compareAndExchangeRelease int value");
+                assertEquals(x, 0x01234567, "failing compareAndExchangeRelease int value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 1, 2);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
                 }
                 assertEquals(success, true, "weakCompareAndSet int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "weakCompareAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "weakCompareAndSet int value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2, 1);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
                 }
                 assertEquals(success, true, "weakCompareAndSetAcquire int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "weakCompareAndSetAcquire int");
+                assertEquals(x, 0x01234567, "weakCompareAndSetAcquire int");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1, 2);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 0x01234567, 0x89ABCDEF);
                 }
                 assertEquals(success, true, "weakCompareAndSetRelease int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "weakCompareAndSetRelease int");
+                assertEquals(x, 0x89ABCDEF, "weakCompareAndSetRelease int");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 2, 1);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 0x89ABCDEF, 0x01234567);
                 }
                 assertEquals(success, true, "weakCompareAndSetVolatile int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1, "weakCompareAndSetVolatile int");
+                assertEquals(x, 0x01234567, "weakCompareAndSetVolatile int");
             }
 
             // Compare set and get
             {
-                int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 2);
-                assertEquals(o, 1, "getAndSet int");
+                int o = (int) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 0x89ABCDEF);
+                assertEquals(o, 0x01234567, "getAndSet int");
                 int x = (int) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2, "getAndSet int value");
+                assertEquals(x, 0x89ABCDEF, "getAndSet int value");
             }
 
-            hs.get(TestAccessMode.SET).invokeExact(array, i, 1);
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 0x01234567);
 
             // get and add, add and get
             {
-                int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 3);
-                assertEquals(o, 1, "getAndAdd int");
-                int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 3);
-                assertEquals(c, 1 + 3 + 3, "getAndAdd int value");
+                int o = (int) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 0xCAFEBABE);
+                assertEquals(o, 0x01234567, "getAndAdd int");
+                int c = (int) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 0xCAFEBABE);
+                assertEquals(c, (int)(0x01234567 + 0xCAFEBABE + 0xCAFEBABE), "getAndAdd int value");
             }
         }
     }
@@ -597,31 +597,31 @@
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
                 checkIOOBE(am, () -> {
-                    hs.get(am).invokeExact(array, ci, 1);
+                    hs.get(am).invokeExact(array, ci, 0x01234567);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
                 checkIOOBE(am, () -> {
-                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, 1, 2);
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, 0x01234567, 0x89ABCDEF);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
                 checkIOOBE(am, () -> {
-                    int r = (int) hs.get(am).invokeExact(array, ci, 2, 1);
+                    int r = (int) hs.get(am).invokeExact(array, ci, 0x89ABCDEF, 0x01234567);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
                 checkIOOBE(am, () -> {
-                    int o = (int) hs.get(am).invokeExact(array, ci, 1);
+                    int o = (int) hs.get(am).invokeExact(array, ci, 0x01234567);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
                 checkIOOBE(am, () -> {
-                    int o = (int) hs.get(am).invokeExact(array, ci, 3);
+                    int o = (int) hs.get(am).invokeExact(array, ci, 0xCAFEBABE);
                 });
             }
         }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessLong.java	Thu Jul 07 18:35:29 2016 +0000
@@ -39,11 +39,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestMethodHandleAccessLong extends VarHandleBaseTest {
-    static final long static_final_v = 1L;
+    static final long static_final_v = 0x0123456789ABCDEFL;
 
     static long static_v;
 
-    final long final_v = 1L;
+    final long final_v = 0x0123456789ABCDEFL;
 
     long v;
 
@@ -121,148 +121,148 @@
     static void testInstanceField(VarHandleTestMethodHandleAccessLong recv, Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(recv, 1L);
+            hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "set long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "set long value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, 2L);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
             long x = (long) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(recv);
-            assertEquals(x, 2L, "setVolatile long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setVolatile long value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, 1L);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, 0x0123456789ABCDEFL);
             long x = (long) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(recv);
-            assertEquals(x, 1L, "setRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "setRelease long value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, 2L);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, 0xCAFEBABECAFEBABEL);
             long x = (long) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(recv);
-            assertEquals(x, 2L, "setOpaque long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setOpaque long value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(recv, 1L);
+        hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
 
         // Compare
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1L, 2L);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             assertEquals(r, true, "success compareAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "success compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value");
         }
 
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 1L, 3L);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
             assertEquals(r, false, "failing compareAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "failing compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeVolatile long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "success compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, 2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeVolatile long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "failing compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1L, 2L);
-            assertEquals(r, 1L, "success compareAndExchangeAcquire long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+            assertEquals(r, 0x0123456789ABCDEFL, "success compareAndExchangeAcquire long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "success compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 1L, 3L);
-            assertEquals(r, 2L, "failing compareAndExchangeAcquire long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "failing compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeRelease long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeRelease long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "success compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeRelease long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeRelease long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "failing compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 1L, 2L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "weakCompareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 2L, 1L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "weakCompareAndSetAcquire long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 1L, 2L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSetRelease long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "weakCompareAndSetRelease long");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 2L, 1L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 1L, "weakCompareAndSetVolatile long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
         }
 
         // Compare set and get
         {
-            long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, 2L);
-            assertEquals(o, 1L, "getAndSet long");
+            long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, 0xCAFEBABECAFEBABEL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, 2L, "getAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(recv, 1L);
+        hs.get(TestAccessMode.SET).invokeExact(recv, 0x0123456789ABCDEFL);
 
         // get and add, add and get
         {
-            long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 3L);
-            assertEquals(o, 1L, "getAndAdd long");
-            long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 3L);
-            assertEquals(c, 1L + 3L + 3L, "getAndAdd long value");
+            long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, 0xDEADBEEFDEADBEEFL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
+            long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, 0xDEADBEEFDEADBEEFL);
+            assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
         }
     }
 
@@ -274,148 +274,148 @@
     static void testStaticField(Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(1L);
+            hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "set long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "set long value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(2L);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(0xCAFEBABECAFEBABEL);
             long x = (long) hs.get(TestAccessMode.GET_VOLATILE).invokeExact();
-            assertEquals(x, 2L, "setVolatile long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setVolatile long value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(1L);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(0x0123456789ABCDEFL);
             long x = (long) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact();
-            assertEquals(x, 1L, "setRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "setRelease long value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(2L);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(0xCAFEBABECAFEBABEL);
             long x = (long) hs.get(TestAccessMode.GET_OPAQUE).invokeExact();
-            assertEquals(x, 2L, "setOpaque long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "setOpaque long value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(1L);
+        hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
 
         // Compare
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1L, 2L);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             assertEquals(r, true, "success compareAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "success compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value");
         }
 
         {
-            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(1L, 3L);
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
             assertEquals(r, false, "failing compareAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "failing compareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeVolatile long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "success compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeVolatile long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "failing compareAndExchangeVolatile long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1L, 2L);
-            assertEquals(r, 1L, "success compareAndExchangeAcquire long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+            assertEquals(r, 0x0123456789ABCDEFL, "success compareAndExchangeAcquire long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "success compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(1L, 3L);
-            assertEquals(r, 2L, "failing compareAndExchangeAcquire long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "failing compareAndExchangeAcquire long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2L, 1L);
-            assertEquals(r, 2L, "success compareAndExchangeRelease long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+            assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeRelease long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "success compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeRelease long value");
         }
 
         {
-            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(2L, 3L);
-            assertEquals(r, 1L, "failing compareAndExchangeRelease long");
+            long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+            assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "failing compareAndExchangeRelease long value");
+            assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(1L, 2L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "weakCompareAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(2L, 1L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetAcquire long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "weakCompareAndSetAcquire long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(1L, 2L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
             }
             assertEquals(success, true, "weakCompareAndSetRelease long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "weakCompareAndSetRelease long");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(2L, 1L);
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
             }
             assertEquals(success, true, "weakCompareAndSetVolatile long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 1L, "weakCompareAndSetVolatile long");
+            assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
         }
 
         // Compare set and get
         {
-            long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 2L);
-            assertEquals(o, 1L, "getAndSet long");
+            long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact( 0xCAFEBABECAFEBABEL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
             long x = (long) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, 2L, "getAndSet long value");
+            assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
         }
 
-        hs.get(TestAccessMode.SET).invokeExact(1L);
+        hs.get(TestAccessMode.SET).invokeExact(0x0123456789ABCDEFL);
 
         // get and add, add and get
         {
-            long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 3L);
-            assertEquals(o, 1L, "getAndAdd long");
-            long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(3L);
-            assertEquals(c, 1L + 3L + 3L, "getAndAdd long value");
+            long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( 0xDEADBEEFDEADBEEFL);
+            assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
+            long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(0xDEADBEEFDEADBEEFL);
+            assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
         }
     }
 
@@ -430,148 +430,148 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                hs.get(TestAccessMode.SET).invokeExact(array, i, 1L);
+                hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "get long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "get long value");
             }
 
 
             // Volatile
             {
-                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, 2L);
+                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
                 long x = (long) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(array, i);
-                assertEquals(x, 2L, "setVolatile long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "setVolatile long value");
             }
 
             // Lazy
             {
-                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, 1L);
+                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, 0x0123456789ABCDEFL);
                 long x = (long) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(array, i);
-                assertEquals(x, 1L, "setRelease long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "setRelease long value");
             }
 
             // Opaque
             {
-                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, 2L);
+                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
                 long x = (long) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(array, i);
-                assertEquals(x, 2L, "setOpaque long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "setOpaque long value");
             }
 
-            hs.get(TestAccessMode.SET).invokeExact(array, i, 1L);
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
 
             // Compare
             {
-                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1L, 2L);
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 assertEquals(r, true, "success compareAndSet long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "success compareAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndSet long value");
             }
 
             {
-                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 1L, 3L);
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
                 assertEquals(r, false, "failing compareAndSet long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "failing compareAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndSet long value");
             }
 
             {
-                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2L, 1L);
-                assertEquals(r, 2L, "success compareAndExchangeVolatile long");
+                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+                assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchange long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "success compareAndExchangeVolatile long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchange long value");
             }
 
             {
-                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, 2L, 3L);
-                assertEquals(r, 1L, "failing compareAndExchangeVolatile long");
+                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+                assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchange long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "failing compareAndExchangeVolatile long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchange long value");
             }
 
             {
-                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1L, 2L);
-                assertEquals(r, 1L, "success compareAndExchangeAcquire long");
+                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
+                assertEquals(r, 0x0123456789ABCDEFL, "success compareAndExchangeAcquire long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "success compareAndExchangeAcquire long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "success compareAndExchangeAcquire long value");
             }
 
             {
-                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 1L, 3L);
-                assertEquals(r, 2L, "failing compareAndExchangeAcquire long");
+                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, 0x0123456789ABCDEFL, 0xDEADBEEFDEADBEEFL);
+                assertEquals(r, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "failing compareAndExchangeAcquire long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "failing compareAndExchangeAcquire long value");
             }
 
             {
-                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2L, 1L);
-                assertEquals(r, 2L, "success compareAndExchangeRelease long");
+                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
+                assertEquals(r, 0xCAFEBABECAFEBABEL, "success compareAndExchangeRelease long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "success compareAndExchangeRelease long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "success compareAndExchangeRelease long value");
             }
 
             {
-                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 2L, 3L);
-                assertEquals(r, 1L, "failing compareAndExchangeRelease long");
+                long r = (long) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0xDEADBEEFDEADBEEFL);
+                assertEquals(r, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "failing compareAndExchangeRelease long value");
+                assertEquals(x, 0x0123456789ABCDEFL, "failing compareAndExchangeRelease long value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 1L, 2L);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 }
                 assertEquals(success, true, "weakCompareAndSet long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "weakCompareAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSet long value");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 2L, 1L);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
                 }
                 assertEquals(success, true, "weakCompareAndSetAcquire long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "weakCompareAndSetAcquire long");
+                assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetAcquire long");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 1L, 2L);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 }
                 assertEquals(success, true, "weakCompareAndSetRelease long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "weakCompareAndSetRelease long");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "weakCompareAndSetRelease long");
             }
 
             {
                 boolean success = false;
                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 2L, 1L);
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
                 }
                 assertEquals(success, true, "weakCompareAndSetVolatile long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 1L, "weakCompareAndSetVolatile long");
+                assertEquals(x, 0x0123456789ABCDEFL, "weakCompareAndSetVolatile long");
             }
 
             // Compare set and get
             {
-                long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 2L);
-                assertEquals(o, 1L, "getAndSet long");
+                long o = (long) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, 0xCAFEBABECAFEBABEL);
+                assertEquals(o, 0x0123456789ABCDEFL, "getAndSet long");
                 long x = (long) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, 2L, "getAndSet long value");
+                assertEquals(x, 0xCAFEBABECAFEBABEL, "getAndSet long value");
             }
 
-            hs.get(TestAccessMode.SET).invokeExact(array, i, 1L);
+            hs.get(TestAccessMode.SET).invokeExact(array, i, 0x0123456789ABCDEFL);
 
             // get and add, add and get
             {
-                long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 3L);
-                assertEquals(o, 1L, "getAndAdd long");
-                long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 3L);
-                assertEquals(c, 1L + 3L + 3L, "getAndAdd long value");
+                long o = (long) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, 0xDEADBEEFDEADBEEFL);
+                assertEquals(o, 0x0123456789ABCDEFL, "getAndAdd long");
+                long c = (long) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, 0xDEADBEEFDEADBEEFL);
+                assertEquals(c, (long)(0x0123456789ABCDEFL + 0xDEADBEEFDEADBEEFL + 0xDEADBEEFDEADBEEFL), "getAndAdd long value");
             }
         }
     }
@@ -597,31 +597,31 @@
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
                 checkIOOBE(am, () -> {
-                    hs.get(am).invokeExact(array, ci, 1L);
+                    hs.get(am).invokeExact(array, ci, 0x0123456789ABCDEFL);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
                 checkIOOBE(am, () -> {
-                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, 1L, 2L);
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, 0x0123456789ABCDEFL, 0xCAFEBABECAFEBABEL);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
                 checkIOOBE(am, () -> {
-                    long r = (long) hs.get(am).invokeExact(array, ci, 2L, 1L);
+                    long r = (long) hs.get(am).invokeExact(array, ci, 0xCAFEBABECAFEBABEL, 0x0123456789ABCDEFL);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
                 checkIOOBE(am, () -> {
-                    long o = (long) hs.get(am).invokeExact(array, ci, 1L);
+                    long o = (long) hs.get(am).invokeExact(array, ci, 0x0123456789ABCDEFL);
                 });
             }
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
                 checkIOOBE(am, () -> {
-                    long o = (long) hs.get(am).invokeExact(array, ci, 3L);
+                    long o = (long) hs.get(am).invokeExact(array, ci, 0xDEADBEEFDEADBEEFL);
                 });
             }
         }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessShort.java	Thu Jul 07 18:35:29 2016 +0000
@@ -39,11 +39,11 @@
 import static org.testng.Assert.*;
 
 public class VarHandleTestMethodHandleAccessShort extends VarHandleBaseTest {
-    static final short static_final_v = (short)1;
+    static final short static_final_v = (short)0x0123;
 
     static short static_v;
 
-    final short final_v = (short)1;
+    final short final_v = (short)0x0123;
 
     short v;
 
@@ -121,120 +121,306 @@
     static void testInstanceField(VarHandleTestMethodHandleAccessShort recv, Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact(recv, (short)1);
+            hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
             short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, (short)1, "set short value");
+            assertEquals(x, (short)0x0123, "set short value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, (short)2);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact(recv, (short)0x4567);
             short x = (short) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(recv);
-            assertEquals(x, (short)2, "setVolatile short value");
+            assertEquals(x, (short)0x4567, "setVolatile short value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, (short)1);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact(recv, (short)0x0123);
             short x = (short) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(recv);
-            assertEquals(x, (short)1, "setRelease short value");
+            assertEquals(x, (short)0x0123, "setRelease short value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, (short)2);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact(recv, (short)0x4567);
             short x = (short) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(recv);
-            assertEquals(x, (short)2, "setOpaque short value");
+            assertEquals(x, (short)0x4567, "setOpaque short value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, (short)0x0123, (short)0x4567);
+            assertEquals(r, true, "success compareAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "success compareAndSet short value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(recv, (short)0x0123, (short)0x89AB);
+            assertEquals(r, false, "failing compareAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "failing compareAndSet short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchange short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x0123, "success compareAndExchange short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, (short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchange short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, (short)0x0123, (short)0x4567);
+            assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(recv, (short)0x0123, (short)0x89AB);
+            assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, (short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
         }
 
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(recv, (short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(recv, (short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(recv, (short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(recv, (short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(recv, (short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+        }
+
+        // Compare set and get
+        {
+            short o = (short) hs.get(TestAccessMode.GET_AND_SET).invokeExact(recv, (short)0x4567);
+            assertEquals(o, (short)0x0123, "getAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact(recv);
+            assertEquals(x, (short)0x4567, "getAndSet short value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact(recv, (short)0x0123);
+
+        // get and add, add and get
+        {
+            short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, (short)0x89AB);
+            assertEquals(o, (short)0x0123, "getAndAdd short");
+            short c = (short) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, (short)0x89AB);
+            assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+        }
     }
 
     static void testInstanceFieldUnsupported(VarHandleTestMethodHandleAccessShort recv, Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(recv, (short)1, (short)2);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact(recv, (short)1, (short)2);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact(recv, (short)1);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact(recv, (short)1);
-            });
-        }
     }
 
 
     static void testStaticField(Handles hs) throws Throwable {
         // Plain
         {
-            hs.get(TestAccessMode.SET).invokeExact((short)1);
+            hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
             short x = (short) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, (short)1, "set short value");
+            assertEquals(x, (short)0x0123, "set short value");
         }
 
 
         // Volatile
         {
-            hs.get(TestAccessMode.SET_VOLATILE).invokeExact((short)2);
+            hs.get(TestAccessMode.SET_VOLATILE).invokeExact((short)0x4567);
             short x = (short) hs.get(TestAccessMode.GET_VOLATILE).invokeExact();
-            assertEquals(x, (short)2, "setVolatile short value");
+            assertEquals(x, (short)0x4567, "setVolatile short value");
         }
 
         // Lazy
         {
-            hs.get(TestAccessMode.SET_RELEASE).invokeExact((short)1);
+            hs.get(TestAccessMode.SET_RELEASE).invokeExact((short)0x0123);
             short x = (short) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact();
-            assertEquals(x, (short)1, "setRelease short value");
+            assertEquals(x, (short)0x0123, "setRelease short value");
         }
 
         // Opaque
         {
-            hs.get(TestAccessMode.SET_OPAQUE).invokeExact((short)2);
+            hs.get(TestAccessMode.SET_OPAQUE).invokeExact((short)0x4567);
             short x = (short) hs.get(TestAccessMode.GET_OPAQUE).invokeExact();
-            assertEquals(x, (short)2, "setOpaque short value");
+            assertEquals(x, (short)0x4567, "setOpaque short value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+        // Compare
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact((short)0x0123, (short)0x4567);
+            assertEquals(r, true, "success compareAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "success compareAndSet short value");
+        }
+
+        {
+            boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact((short)0x0123, (short)0x89AB);
+            assertEquals(r, false, "failing compareAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "failing compareAndSet short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchange short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x0123, "success compareAndExchange short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact((short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchange short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact((short)0x0123, (short)0x4567);
+            assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact((short)0x0123, (short)0x89AB);
+            assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
+        }
+
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact((short)0x4567, (short)0x0123);
+            assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
         }
 
+        {
+            short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact((short)0x4567, (short)0x89AB);
+            assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
+        }
 
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact((short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact((short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetAcquire short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact((short)0x0123, (short)0x4567);
+            }
+            assertEquals(success, true, "weakCompareAndSetRelease short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
+        }
+
+        {
+            boolean success = false;
+            for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact((short)0x4567, (short)0x0123);
+            }
+            assertEquals(success, true, "weakCompareAndSetVolatile short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+        }
+
+        // Compare set and get
+        {
+            short o = (short) hs.get(TestAccessMode.GET_AND_SET).invokeExact( (short)0x4567);
+            assertEquals(o, (short)0x0123, "getAndSet short");
+            short x = (short) hs.get(TestAccessMode.GET).invokeExact();
+            assertEquals(x, (short)0x4567, "getAndSet short value");
+        }
+
+        hs.get(TestAccessMode.SET).invokeExact((short)0x0123);
+
+        // get and add, add and get
+        {
+            short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( (short)0x89AB);
+            assertEquals(o, (short)0x0123, "getAndAdd short");
+            short c = (short) hs.get(TestAccessMode.ADD_AND_GET).invokeExact((short)0x89AB);
+            assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+        }
     }
 
     static void testStaticFieldUnsupported(Handles hs) throws Throwable {
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact((short)1, (short)2);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact((short)1, (short)2);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact((short)1);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact((short)1);
-            });
-        }
     }
 
 
@@ -244,34 +430,149 @@
         for (int i = 0; i < array.length; i++) {
             // Plain
             {
-                hs.get(TestAccessMode.SET).invokeExact(array, i, (short)1);
+                hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
                 short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, (short)1, "get short value");
+                assertEquals(x, (short)0x0123, "get short value");
             }
 
 
             // Volatile
             {
-                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, (short)2);
+                hs.get(TestAccessMode.SET_VOLATILE).invokeExact(array, i, (short)0x4567);
                 short x = (short) hs.get(TestAccessMode.GET_VOLATILE).invokeExact(array, i);
-                assertEquals(x, (short)2, "setVolatile short value");
+                assertEquals(x, (short)0x4567, "setVolatile short value");
             }
 
             // Lazy
             {
-                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, (short)1);
+                hs.get(TestAccessMode.SET_RELEASE).invokeExact(array, i, (short)0x0123);
                 short x = (short) hs.get(TestAccessMode.GET_ACQUIRE).invokeExact(array, i);
-                assertEquals(x, (short)1, "setRelease short value");
+                assertEquals(x, (short)0x0123, "setRelease short value");
             }
 
             // Opaque
             {
-                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, (short)2);
+                hs.get(TestAccessMode.SET_OPAQUE).invokeExact(array, i, (short)0x4567);
                 short x = (short) hs.get(TestAccessMode.GET_OPAQUE).invokeExact(array, i);
-                assertEquals(x, (short)2, "setOpaque short value");
+                assertEquals(x, (short)0x4567, "setOpaque short value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+            // Compare
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, (short)0x0123, (short)0x4567);
+                assertEquals(r, true, "success compareAndSet short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "success compareAndSet short value");
+            }
+
+            {
+                boolean r = (boolean) hs.get(TestAccessMode.COMPARE_AND_SET).invokeExact(array, i, (short)0x0123, (short)0x89AB);
+                assertEquals(r, false, "failing compareAndSet short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "failing compareAndSet short value");
+            }
+
+            {
+                short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (short)0x4567, (short)0x0123);
+                assertEquals(r, (short)0x4567, "success compareAndExchange short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x0123, "success compareAndExchange short value");
+            }
+
+            {
+                short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, (short)0x4567, (short)0x89AB);
+                assertEquals(r, (short)0x0123, "failing compareAndExchange short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x0123, "failing compareAndExchange short value");
+            }
+
+            {
+                short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, (short)0x0123, (short)0x4567);
+                assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
+            }
+
+            {
+                short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_ACQUIRE).invokeExact(array, i, (short)0x0123, (short)0x89AB);
+                assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
+            }
+
+            {
+                short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, (short)0x4567, (short)0x0123);
+                assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
             }
 
+            {
+                short r = (short) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_RELEASE).invokeExact(array, i, (short)0x4567, (short)0x89AB);
+                assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
+            }
 
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET).invokeExact(array, i, (short)0x0123, (short)0x4567);
+                }
+                assertEquals(success, true, "weakCompareAndSet short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_ACQUIRE).invokeExact(array, i, (short)0x4567, (short)0x0123);
+                }
+                assertEquals(success, true, "weakCompareAndSetAcquire short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_RELEASE).invokeExact(array, i, (short)0x0123, (short)0x4567);
+                }
+                assertEquals(success, true, "weakCompareAndSetRelease short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
+            }
+
+            {
+                boolean success = false;
+                for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
+                    success = (boolean) hs.get(TestAccessMode.WEAK_COMPARE_AND_SET_VOLATILE).invokeExact(array, i, (short)0x4567, (short)0x0123);
+                }
+                assertEquals(success, true, "weakCompareAndSetVolatile short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x0123, "weakCompareAndSetVolatile short");
+            }
+
+            // Compare set and get
+            {
+                short o = (short) hs.get(TestAccessMode.GET_AND_SET).invokeExact(array, i, (short)0x4567);
+                assertEquals(o, (short)0x0123, "getAndSet short");
+                short x = (short) hs.get(TestAccessMode.GET).invokeExact(array, i);
+                assertEquals(x, (short)0x4567, "getAndSet short value");
+            }
+
+            hs.get(TestAccessMode.SET).invokeExact(array, i, (short)0x0123);
+
+            // get and add, add and get
+            {
+                short o = (short) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, (short)0x89AB);
+                assertEquals(o, (short)0x0123, "getAndAdd short");
+                short c = (short) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, (short)0x89AB);
+                assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
+            }
         }
     }
 
@@ -279,29 +580,7 @@
         short[] array = new short[10];
 
         final int i = 0;
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
-            checkUOE(am, () -> {
-                boolean r = (boolean) hs.get(am).invokeExact(array, i, (short)1, (short)2);
-            });
-        }
 
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact(array, i, (short)1, (short)2);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
-            checkUOE(am, () -> {
-                short r = (short) hs.get(am).invokeExact(array, i, (short)1);
-            });
-        }
-
-        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
-            checkUOE(am, () -> {
-                short o = (short) hs.get(am).invokeExact(array, i, (short)1);
-            });
-        }
     }
 
     static void testArrayIndexOutOfBounds(Handles hs) throws Throwable {
@@ -318,11 +597,33 @@
 
             for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) {
                 checkIOOBE(am, () -> {
-                    hs.get(am).invokeExact(array, ci, (short)1);
+                    hs.get(am).invokeExact(array, ci, (short)0x0123);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    boolean r = (boolean) hs.get(am).invokeExact(array, ci, (short)0x0123, (short)0x4567);
                 });
             }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+                checkIOOBE(am, () -> {
+                    short r = (short) hs.get(am).invokeExact(array, ci, (short)0x4567, (short)0x0123);
+                });
+            }
 
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+                checkIOOBE(am, () -> {
+                    short o = (short) hs.get(am).invokeExact(array, ci, (short)0x0123);
+                });
+            }
+
+            for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+                checkIOOBE(am, () -> {
+                    short o = (short) hs.get(am).invokeExact(array, ci, (short)0x89AB);
+                });
+            }
         }
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodHandleAccessString.java	Thu Jul 07 18:35:29 2016 +0000
@@ -166,17 +166,17 @@
         }
 
         {
-            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, "bar", "foo");
-            assertEquals(r, "bar", "success compareAndExchangeVolatile String");
+            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, "bar", "foo");
+            assertEquals(r, "bar", "success compareAndExchange String");
             String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "success compareAndExchange String value");
         }
 
         {
-            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, "bar", "baz");
-            assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
+            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, "bar", "baz");
+            assertEquals(r, "foo", "failing compareAndExchange String");
             String x = (String) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "failing compareAndExchange String value");
         }
 
         {
@@ -315,17 +315,17 @@
         }
 
         {
-            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact("bar", "foo");
-            assertEquals(r, "bar", "success compareAndExchangeVolatile String");
+            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact("bar", "foo");
+            assertEquals(r, "bar", "success compareAndExchange String");
             String x = (String) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "success compareAndExchange String value");
         }
 
         {
-            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact("bar", "baz");
-            assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
+            String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact("bar", "baz");
+            assertEquals(r, "foo", "failing compareAndExchange String");
             String x = (String) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
+            assertEquals(x, "foo", "failing compareAndExchange String value");
         }
 
         {
@@ -467,17 +467,17 @@
             }
 
             {
-                String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, "bar", "foo");
-                assertEquals(r, "bar", "success compareAndExchangeVolatile String");
+                String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, "bar", "foo");
+                assertEquals(r, "bar", "success compareAndExchange String");
                 String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, "foo", "success compareAndExchangeVolatile String value");
+                assertEquals(x, "foo", "success compareAndExchange String value");
             }
 
             {
-                String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, "bar", "baz");
-                assertEquals(r, "foo", "failing compareAndExchangeVolatile String");
+                String r = (String) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, "bar", "baz");
+                assertEquals(r, "foo", "failing compareAndExchange String");
                 String x = (String) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, "foo", "failing compareAndExchangeVolatile String value");
+                assertEquals(x, "foo", "failing compareAndExchange String value");
             }
 
             {
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeBoolean.java	Thu Jul 07 18:35:29 2016 +0000
@@ -324,6 +324,263 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, true, true, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.compareAndExchange(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean x = (boolean) vh.compareAndExchange(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchange(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchange(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            boolean x = (boolean) vh.compareAndExchange(0, true, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(recv, true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchange(recv, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchange(recv, true, true, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.compareAndExchangeAcquire(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(0, true, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchangeAcquire(recv, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, true, true, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.compareAndExchangeRelease(null, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(Void.class, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, true, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(0, true, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchangeRelease(recv, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, true, true, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.getAndSet(null, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean x = (boolean) vh.getAndSet(Void.class, true);
+        });
+        checkWMTE(() -> { // value reference class
+            boolean x = (boolean) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            boolean x = (boolean) vh.getAndSet(0, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.getAndSet(recv, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.getAndSet(recv, true, Void.class);
+        });
 
     }
 
@@ -391,6 +648,116 @@
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class, boolean.class)).
+                    invokeExact((VarHandleTestMethodTypeBoolean) null, true, true);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, boolean.class, boolean.class)).
+                    invokeExact(Void.class, true, true);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, Class.class, boolean.class)).
+                    invokeExact(recv, Void.class, true);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class, Class.class)).
+                    invokeExact(recv, true, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , boolean.class, boolean.class)).
+                    invokeExact(0, true, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class, boolean.class, Class.class)).
+                    invokeExact(recv, true, true, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class, boolean.class)).
+                    invokeExact((VarHandleTestMethodTypeBoolean) null, true, true);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, boolean.class, boolean.class)).
+                    invokeExact(Void.class, true, true);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, Class.class, boolean.class)).
+                    invokeExact(recv, Void.class, true);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class, Class.class)).
+                    invokeExact(recv, true, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class , boolean.class, boolean.class)).
+                    invokeExact(0, true, true);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeBoolean.class , boolean.class, boolean.class)).
+                    invokeExact(recv, true, true);
+            });
+            checkWMTE(() -> { // primitive class
+                int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeBoolean.class , boolean.class, boolean.class)).
+                    invokeExact(recv, true, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class, boolean.class, Class.class)).
+                    invokeExact(recv, true, true, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+                    invokeExact((VarHandleTestMethodTypeBoolean) null, true);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, boolean.class)).
+                    invokeExact(Void.class, true);
+            });
+            checkWMTE(() -> { // value reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, boolean.class)).
+                    invokeExact(0, true);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+                    invokeExact(recv, true);
+            });
+            checkWMTE(() -> { // primitive class
+                int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+                    invokeExact(recv, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeBoolean.class, boolean.class)).
+                    invokeExact(recv, true, Void.class);
+            });
+        }
 
     }
 
@@ -505,6 +872,182 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(true, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(true, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(true, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(true, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(true, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(true, true, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchange(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchange(true, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchange(true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchange(true, true, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(true, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchangeAcquire(true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchangeAcquire(true, true, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(true, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchangeRelease(true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchangeRelease(true, true, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            boolean x = (boolean) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.getAndSet(true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.getAndSet(true, Void.class);
+        });
 
     }
 
@@ -543,6 +1086,82 @@
                     invokeExact(true, Void.class);
             });
         }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, boolean.class)).
+                    invokeExact(Void.class, true);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean.class, Class.class)).
+                    invokeExact(true, Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean.class, boolean.class, Class.class)).
+                    invokeExact(true, true, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, boolean.class)).
+                    invokeExact(Void.class, true);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean.class, Class.class)).
+                    invokeExact(true, Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, boolean.class, boolean.class)).
+                    invokeExact(true, true);
+            });
+            checkWMTE(() -> { // primitive class
+                int x = (int) hs.get(am, methodType(int.class, boolean.class, boolean.class)).
+                    invokeExact(true, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean.class, boolean.class, Class.class)).
+                    invokeExact(true, true, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, boolean.class)).
+                    invokeExact(true);
+            });
+            checkWMTE(() -> { // primitive class
+                int x = (int) hs.get(am, methodType(int.class, boolean.class)).
+                    invokeExact(true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean.class, Class.class)).
+                    invokeExact(true, Void.class);
+            });
+        }
 
     }
 
@@ -775,6 +1394,290 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(array, 0, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(array, 0, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, true, true, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, true, true);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(array, 0, true, true, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.compareAndExchange(null, 0, true, true);
+        });
+        checkCCE(() -> { // array reference class
+            boolean x = (boolean) vh.compareAndExchange(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            boolean x = (boolean) vh.compareAndExchange(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean x = (boolean) vh.compareAndExchange(array, Void.class, true, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(array, 0, true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchange(array, 0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchange(array, 0, true, true, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.compareAndExchangeAcquire(null, 0, true, true);
+        });
+        checkCCE(() -> { // array reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, Void.class, true, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchangeAcquire(array, 0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, true, true, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean x = (boolean) vh.compareAndExchangeRelease(null, 0, true, true);
+        });
+        checkCCE(() -> { // array reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(Void.class, 0, true, true);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, Void.class, true);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, true, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(0, 0, true, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, Void.class, true, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, true, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.compareAndExchangeRelease(array, 0, true, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, true, true, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            boolean x = (boolean) vh.getAndSet(null, 0, true);
+        });
+        checkCCE(() -> { // array reference class
+            boolean x = (boolean) vh.getAndSet(Void.class, 0, true);
+        });
+        checkWMTE(() -> { // value reference class
+            boolean x = (boolean) vh.getAndSet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // reciarrayever primitive class
+            boolean x = (boolean) vh.getAndSet(0, 0, true);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean x = (boolean) vh.getAndSet(array, Void.class, true);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, true);
+        });
+        checkWMTE(() -> { // primitive class
+            int x = (int) vh.getAndSet(array, 0, true);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean x = (boolean) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean x = (boolean) vh.getAndSet(array, 0, true, Void.class);
+        });
 
     }
 
@@ -852,6 +1755,130 @@
                     invokeExact(array, 0, true, Void.class);
             });
         }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, boolean.class)).
+                    invokeExact((boolean[]) null, 0, true, true);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, boolean.class, boolean.class)).
+                    invokeExact(Void.class, 0, true, true);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, Class.class, boolean.class)).
+                    invokeExact(array, 0, Void.class, true);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, Class.class)).
+                    invokeExact(array, 0, true, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, boolean.class, boolean.class)).
+                    invokeExact(0, 0, true, true);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, Class.class, boolean.class, boolean.class)).
+                    invokeExact(array, Void.class, true, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, boolean.class, Class.class)).
+                    invokeExact(array, 0, true, true, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, boolean.class)).
+                    invokeExact((boolean[]) null, 0, true, true);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, boolean.class, boolean.class)).
+                    invokeExact(Void.class, 0, true, true);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, Class.class, boolean.class)).
+                    invokeExact(array, 0, Void.class, true);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, Class.class)).
+                    invokeExact(array, 0, true, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, boolean.class, boolean.class)).
+                    invokeExact(0, 0, true, true);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, Class.class, boolean.class, boolean.class)).
+                    invokeExact(array, Void.class, true, true);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, boolean[].class, int.class, boolean.class, boolean.class)).
+                    invokeExact(array, 0, true, true);
+            });
+            checkWMTE(() -> { // primitive class
+                int x = (int) hs.get(am, methodType(int.class, boolean[].class, int.class, boolean.class, boolean.class)).
+                    invokeExact(array, 0, true, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, boolean.class, Class.class)).
+                    invokeExact(array, 0, true, true, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class)).
+                    invokeExact((boolean[]) null, 0, true);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, boolean.class)).
+                    invokeExact(Void.class, 0, true);
+            });
+            checkWMTE(() -> { // value reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, boolean.class)).
+                    invokeExact(0, 0, true);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, Class.class, boolean.class)).
+                    invokeExact(array, Void.class, true);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, boolean[].class, int.class, boolean.class)).
+                    invokeExact(array, 0, true);
+            });
+            checkWMTE(() -> { // primitive class
+                int x = (int) hs.get(am, methodType(int.class, boolean[].class, int.class, boolean.class)).
+                    invokeExact(array, 0, true);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean x = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, boolean[].class, int.class, boolean.class, Class.class)).
+                    invokeExact(array, 0, true, Void.class);
+            });
+        }
 
     }
 }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeByte.java	Thu Jul 07 18:35:29 2016 +0000
@@ -43,13 +43,13 @@
 import static java.lang.invoke.MethodType.*;
 
 public class VarHandleTestMethodTypeByte extends VarHandleBaseTest {
-    static final byte static_final_v = (byte)1;
+    static final byte static_final_v = (byte)0x01;
 
-    static byte static_v = (byte)1;
+    static byte static_v = (byte)0x01;
 
-    final byte final_v = (byte)1;
+    final byte final_v = (byte)0x01;
 
-    byte v = (byte)1;
+    byte v = (byte)0x01;
 
     VarHandle vhFinalField;
 
@@ -154,23 +154,23 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.set(null, (byte)1);
+            vh.set(null, (byte)0x01);
         });
         checkCCE(() -> { // receiver reference class
-            vh.set(Void.class, (byte)1);
+            vh.set(Void.class, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.set(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, (byte)1);
+            vh.set(0, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(recv, (byte)1, Void.class);
+            vh.set(recv, (byte)0x01, Void.class);
         });
 
 
@@ -204,23 +204,23 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setVolatile(null, (byte)1);
+            vh.setVolatile(null, (byte)0x01);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setVolatile(Void.class, (byte)1);
+            vh.setVolatile(Void.class, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, (byte)1);
+            vh.setVolatile(0, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(recv, (byte)1, Void.class);
+            vh.setVolatile(recv, (byte)0x01, Void.class);
         });
 
 
@@ -254,23 +254,23 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setOpaque(null, (byte)1);
+            vh.setOpaque(null, (byte)0x01);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setOpaque(Void.class, (byte)1);
+            vh.setOpaque(Void.class, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, (byte)1);
+            vh.setOpaque(0, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(recv, (byte)1, Void.class);
+            vh.setOpaque(recv, (byte)0x01, Void.class);
         });
 
 
@@ -304,27 +304,342 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setRelease(null, (byte)1);
+            vh.setRelease(null, (byte)0x01);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setRelease(Void.class, (byte)1);
+            vh.setRelease(Void.class, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, (byte)1);
+            vh.setRelease(0, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(recv, (byte)1, Void.class);
+            vh.setRelease(recv, (byte)0x01, Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, (byte)0x01, (byte)0x01, Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.compareAndExchange(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            byte x = (byte) vh.compareAndExchange(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchange(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchange(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            byte x = (byte) vh.compareAndExchange(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchange(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.compareAndExchangeAcquire(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            byte x = (byte) vh.compareAndExchangeAcquire(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchangeAcquire(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.compareAndExchangeRelease(null, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            byte x = (byte) vh.compareAndExchangeRelease(Void.class, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchangeRelease(recv, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchangeRelease(recv, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            byte x = (byte) vh.compareAndExchangeRelease(0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchangeRelease(recv, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.getAndSet(null, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            byte x = (byte) vh.getAndSet(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            byte x = (byte) vh.getAndSet(0, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(recv, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.getAndSet(recv, (byte)0x01, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.getAndAdd(null, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            byte x = (byte) vh.getAndAdd(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.getAndAdd(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            byte x = (byte) vh.getAndAdd(0, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(recv, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(recv, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.getAndAdd(recv, (byte)0x01, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.addAndGet(null, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            byte x = (byte) vh.addAndGet(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.addAndGet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            byte x = (byte) vh.addAndGet(0, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(recv, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(recv, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.addAndGet(recv, (byte)0x01, Void.class);
+        });
     }
 
     static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeByte recv, Handles hs) throws Throwable {
@@ -366,11 +681,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeByte.class, byte.class)).
-                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)1);
+                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)0x01);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, byte.class)).
-                    invokeExact(Void.class, (byte)1);
+                    invokeExact(Void.class, (byte)0x01);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeByte.class, Class.class)).
@@ -378,7 +693,7 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, byte.class)).
-                    invokeExact(0, (byte)1);
+                    invokeExact(0, (byte)0x01);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -387,11 +702,157 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeByte.class, byte.class, Class.class)).
-                    invokeExact(recv, (byte)1, Void.class);
+                    invokeExact(recv, (byte)0x01, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, byte.class, byte.class)).
+                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)0x01, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, byte.class, byte.class)).
+                    invokeExact(Void.class, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, Class.class, byte.class)).
+                    invokeExact(recv, Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, byte.class, Class.class)).
+                    invokeExact(recv, (byte)0x01, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , byte.class, byte.class)).
+                    invokeExact(0, (byte)0x01, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, byte.class, byte.class, Class.class)).
+                    invokeExact(recv, (byte)0x01, (byte)0x01, Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class, byte.class)).
+                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)0x01, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, byte.class, byte.class)).
+                    invokeExact(Void.class, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // expected reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, Class.class, byte.class)).
+                    invokeExact(recv, Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // actual reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class, Class.class)).
+                    invokeExact(recv, (byte)0x01, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                byte x = (byte) hs.get(am, methodType(byte.class, int.class , byte.class, byte.class)).
+                    invokeExact(0, (byte)0x01, (byte)0x01);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeByte.class , byte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class , byte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class, byte.class, Class.class)).
+                    invokeExact(recv, (byte)0x01, (byte)0x01, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, byte.class)).
+                    invokeExact(Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // value reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                byte x = (byte) hs.get(am, methodType(byte.class, int.class, byte.class)).
+                    invokeExact(0, (byte)0x01);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            checkNPE(() -> { // null receiver
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact((VarHandleTestMethodTypeByte) null, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, byte.class)).
+                    invokeExact(Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // value reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                byte x = (byte) hs.get(am, methodType(byte.class, int.class, byte.class)).
+                    invokeExact(0, (byte)0x01);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, VarHandleTestMethodTypeByte.class, byte.class)).
+                    invokeExact(recv, (byte)0x01, Void.class);
+            });
+        }
     }
 
 
@@ -420,7 +881,7 @@
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set((byte)1, Void.class);
+            vh.set((byte)0x01, Void.class);
         });
 
 
@@ -447,7 +908,7 @@
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile((byte)1, Void.class);
+            vh.setVolatile((byte)0x01, Void.class);
         });
 
 
@@ -474,7 +935,7 @@
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque((byte)1, Void.class);
+            vh.setOpaque((byte)0x01, Void.class);
         });
 
 
@@ -501,11 +962,227 @@
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease((byte)1, Void.class);
+            vh.setRelease((byte)0x01, Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet((byte)0x01, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet((byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet((byte)0x01, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet((byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile((byte)0x01, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile((byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire((byte)0x01, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire((byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease((byte)0x01, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease((byte)0x01, (byte)0x01, Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchange(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchange((byte)0x01, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange((byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange((byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchange((byte)0x01, (byte)0x01, Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchangeAcquire((byte)0x01, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire((byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire((byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchangeAcquire((byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchangeRelease(Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchangeRelease((byte)0x01, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease((byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease((byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchangeRelease((byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet((byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet((byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.getAndSet((byte)0x01, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.getAndAdd(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd((byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd((byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.getAndAdd((byte)0x01, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.addAndGet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet((byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet((byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.addAndGet((byte)0x01, Void.class);
+        });
     }
 
     static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -540,16 +1217,117 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, byte.class, Class.class)).
-                    invokeExact((byte)1, Void.class);
+                    invokeExact((byte)0x01, Void.class);
+            });
+        }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, byte.class)).
+                    invokeExact(Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte.class, Class.class)).
+                    invokeExact((byte)0x01, Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte.class, byte.class, Class.class)).
+                    invokeExact((byte)0x01, (byte)0x01, Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, byte.class)).
+                    invokeExact(Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // actual reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte.class, Class.class)).
+                    invokeExact((byte)0x01, Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, byte.class, byte.class)).
+                    invokeExact((byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, byte.class, byte.class)).
+                    invokeExact((byte)0x01, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, byte.class, byte.class, Class.class)).
+                    invokeExact((byte)0x01, (byte)0x01, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, byte.class)).
+                    invokeExact((byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, byte.class)).
+                    invokeExact((byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, byte.class, Class.class)).
+                    invokeExact((byte)0x01, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, byte.class)).
+                    invokeExact((byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, byte.class)).
+                    invokeExact((byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, byte.class, Class.class)).
+                    invokeExact((byte)0x01, Void.class);
+            });
+        }
     }
 
 
     static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
         byte[] array = new byte[10];
-        Arrays.fill(array, (byte)1);
+        Arrays.fill(array, (byte)0x01);
 
         // Get
         // Incorrect argument types
@@ -584,26 +1362,26 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.set(null, 0, (byte)1);
+            vh.set(null, 0, (byte)0x01);
         });
         checkCCE(() -> { // array reference class
-            vh.set(Void.class, 0, (byte)1);
+            vh.set(Void.class, 0, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.set(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 0, (byte)1);
+            vh.set(0, 0, (byte)0x01);
         });
         checkWMTE(() -> { // index reference class
-            vh.set(array, Void.class, (byte)1);
+            vh.set(array, Void.class, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(array, 0, (byte)1, Void.class);
+            vh.set(array, 0, (byte)0x01, Void.class);
         });
 
 
@@ -640,26 +1418,26 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setVolatile(null, 0, (byte)1);
+            vh.setVolatile(null, 0, (byte)0x01);
         });
         checkCCE(() -> { // array reference class
-            vh.setVolatile(Void.class, 0, (byte)1);
+            vh.setVolatile(Void.class, 0, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 0, (byte)1);
+            vh.setVolatile(0, 0, (byte)0x01);
         });
         checkWMTE(() -> { // index reference class
-            vh.setVolatile(array, Void.class, (byte)1);
+            vh.setVolatile(array, Void.class, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(array, 0, (byte)1, Void.class);
+            vh.setVolatile(array, 0, (byte)0x01, Void.class);
         });
 
 
@@ -696,26 +1474,26 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setOpaque(null, 0, (byte)1);
+            vh.setOpaque(null, 0, (byte)0x01);
         });
         checkCCE(() -> { // array reference class
-            vh.setOpaque(Void.class, 0, (byte)1);
+            vh.setOpaque(Void.class, 0, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 0, (byte)1);
+            vh.setOpaque(0, 0, (byte)0x01);
         });
         checkWMTE(() -> { // index reference class
-            vh.setOpaque(array, Void.class, (byte)1);
+            vh.setOpaque(array, Void.class, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(array, 0, (byte)1, Void.class);
+            vh.setOpaque(array, 0, (byte)0x01, Void.class);
         });
 
 
@@ -752,35 +1530,383 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setRelease(null, 0, (byte)1);
+            vh.setRelease(null, 0, (byte)0x01);
         });
         checkCCE(() -> { // array reference class
-            vh.setRelease(Void.class, 0, (byte)1);
+            vh.setRelease(Void.class, 0, (byte)0x01);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 0, (byte)1);
+            vh.setRelease(0, 0, (byte)0x01);
         });
         checkWMTE(() -> { // index reference class
-            vh.setRelease(array, Void.class, (byte)1);
+            vh.setRelease(array, Void.class, (byte)0x01);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(array, 0, (byte)1, Void.class);
+            vh.setRelease(array, 0, (byte)0x01, Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(array, 0, (byte)0x01, (byte)0x01, Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.compareAndExchange(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // array reference class
+            byte x = (byte) vh.compareAndExchange(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchange(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchange(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            byte x = (byte) vh.compareAndExchange(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            byte x = (byte) vh.compareAndExchange(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(array, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchange(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.compareAndExchangeAcquire(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // array reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            byte x = (byte) vh.compareAndExchangeAcquire(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            byte x = (byte) vh.compareAndExchangeAcquire(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchangeAcquire(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            byte x = (byte) vh.compareAndExchangeRelease(null, 0, (byte)0x01, (byte)0x01);
+        });
+        checkCCE(() -> { // array reference class
+            byte x = (byte) vh.compareAndExchangeRelease(Void.class, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // expected reference class
+            byte x = (byte) vh.compareAndExchangeRelease(array, 0, Void.class, (byte)0x01);
+        });
+        checkWMTE(() -> { // actual reference class
+            byte x = (byte) vh.compareAndExchangeRelease(array, 0, (byte)0x01, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            byte x = (byte) vh.compareAndExchangeRelease(0, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            byte x = (byte) vh.compareAndExchangeRelease(array, Void.class, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, (byte)0x01, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, (byte)0x01, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.compareAndExchangeRelease(array, 0, (byte)0x01, (byte)0x01, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            byte x = (byte) vh.getAndSet(null, 0, (byte)0x01);
+        });
+        checkCCE(() -> { // array reference class
+            byte x = (byte) vh.getAndSet(Void.class, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.getAndSet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // reciarrayever primitive class
+            byte x = (byte) vh.getAndSet(0, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            byte x = (byte) vh.getAndSet(array, Void.class, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(array, 0, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.getAndSet(array, 0, (byte)0x01, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            byte x = (byte) vh.getAndAdd(null, 0, (byte)0x01);
+        });
+        checkCCE(() -> { // array reference class
+            byte x = (byte) vh.getAndAdd(Void.class, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.getAndAdd(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            byte x = (byte) vh.getAndAdd(0, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            byte x = (byte) vh.getAndAdd(array, Void.class, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(array, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(array, 0, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.getAndAdd(array, 0, (byte)0x01, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            byte x = (byte) vh.addAndGet(null, 0, (byte)0x01);
+        });
+        checkCCE(() -> { // array reference class
+            byte x = (byte) vh.addAndGet(Void.class, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // value reference class
+            byte x = (byte) vh.addAndGet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            byte x = (byte) vh.addAndGet(0, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // index reference class
+            byte x = (byte) vh.addAndGet(array, Void.class, (byte)0x01);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(array, 0, (byte)0x01);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(array, 0, (byte)0x01);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            byte x = (byte) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            byte x = (byte) vh.addAndGet(array, 0, (byte)0x01, Void.class);
+        });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
         byte[] array = new byte[10];
-        Arrays.fill(array, (byte)1);
+        Arrays.fill(array, (byte)0x01);
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
@@ -824,11 +1950,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 hs.get(am, methodType(void.class, byte[].class, int.class, byte.class)).
-                    invokeExact((byte[]) null, 0, (byte)1);
+                    invokeExact((byte[]) null, 0, (byte)0x01);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, byte.class)).
-                    invokeExact(Void.class, 0, (byte)1);
+                    invokeExact(Void.class, 0, (byte)0x01);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, byte[].class, int.class, Class.class)).
@@ -836,11 +1962,11 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, byte.class)).
-                    invokeExact(0, 0, (byte)1);
+                    invokeExact(0, 0, (byte)0x01);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, byte[].class, Class.class, byte.class)).
-                    invokeExact(array, Void.class, (byte)1);
+                    invokeExact(array, Void.class, (byte)0x01);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -849,10 +1975,175 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, byte[].class, int.class, Class.class)).
-                    invokeExact(array, 0, (byte)1, Void.class);
+                    invokeExact(array, 0, (byte)0x01, Void.class);
+            });
+        }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class, byte.class)).
+                    invokeExact((byte[]) null, 0, (byte)0x01, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, byte.class, byte.class)).
+                    invokeExact(Void.class, 0, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, Class.class, byte.class)).
+                    invokeExact(array, 0, Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class, Class.class)).
+                    invokeExact(array, 0, (byte)0x01, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, byte.class, byte.class)).
+                    invokeExact(0, 0, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte[].class, Class.class, byte.class, byte.class)).
+                    invokeExact(array, Void.class, (byte)0x01, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class, byte.class, Class.class)).
+                    invokeExact(array, 0, (byte)0x01, (byte)0x01, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class, byte.class)).
+                    invokeExact((byte[]) null, 0, (byte)0x01, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, int.class, byte.class, byte.class)).
+                    invokeExact(Void.class, 0, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // expected reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, Class.class, byte.class)).
+                    invokeExact(array, 0, Void.class, (byte)0x01);
+            });
+            checkWMTE(() -> { // actual reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class, Class.class)).
+                    invokeExact(array, 0, (byte)0x01, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                byte x = (byte) hs.get(am, methodType(byte.class, int.class, int.class, byte.class, byte.class)).
+                    invokeExact(0, 0, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // index reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, Class.class, byte.class, byte.class)).
+                    invokeExact(array, Void.class, (byte)0x01, (byte)0x01);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, byte[].class, int.class, byte.class, byte.class)).
+                    invokeExact(array, 0, (byte)0x01, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class, byte.class)).
+                    invokeExact(array, 0, (byte)0x01, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class, byte.class, Class.class)).
+                    invokeExact(array, 0, (byte)0x01, (byte)0x01, Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class)).
+                    invokeExact((byte[]) null, 0, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, int.class, byte.class)).
+                    invokeExact(Void.class, 0, (byte)0x01);
+            });
+            checkWMTE(() -> { // value reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                byte x = (byte) hs.get(am, methodType(byte.class, int.class, int.class, byte.class)).
+                    invokeExact(0, 0, (byte)0x01);
+            });
+            checkWMTE(() -> { // index reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, Class.class, byte.class)).
+                    invokeExact(array, Void.class, (byte)0x01);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, byte[].class, int.class, byte.class)).
+                    invokeExact(array, 0, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class)).
+                    invokeExact(array, 0, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class, Class.class)).
+                    invokeExact(array, 0, (byte)0x01, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class)).
+                    invokeExact((byte[]) null, 0, (byte)0x01);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, Class.class, int.class, byte.class)).
+                    invokeExact(Void.class, 0, (byte)0x01);
+            });
+            checkWMTE(() -> { // value reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                byte x = (byte) hs.get(am, methodType(byte.class, int.class, int.class, byte.class)).
+                    invokeExact(0, 0, (byte)0x01);
+            });
+            checkWMTE(() -> { // index reference class
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, Class.class, byte.class)).
+                    invokeExact(array, Void.class, (byte)0x01);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, byte[].class, int.class, byte.class)).
+                    invokeExact(array, 0, (byte)0x01);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, byte[].class, int.class, byte.class)).
+                    invokeExact(array, 0, (byte)0x01);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                byte x = (byte) hs.get(am, methodType(byte.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                byte x = (byte) hs.get(am, methodType(byte.class, byte[].class, int.class, byte.class, Class.class)).
+                    invokeExact(array, 0, (byte)0x01, Void.class);
+            });
+        }
     }
 }
 
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeChar.java	Thu Jul 07 18:35:29 2016 +0000
@@ -43,13 +43,13 @@
 import static java.lang.invoke.MethodType.*;
 
 public class VarHandleTestMethodTypeChar extends VarHandleBaseTest {
-    static final char static_final_v = 'a';
+    static final char static_final_v = '\u0123';
 
-    static char static_v = 'a';
+    static char static_v = '\u0123';
 
-    final char final_v = 'a';
+    final char final_v = '\u0123';
 
-    char v = 'a';
+    char v = '\u0123';
 
     VarHandle vhFinalField;
 
@@ -154,23 +154,23 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.set(null, 'a');
+            vh.set(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.set(Void.class, 'a');
+            vh.set(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.set(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 'a');
+            vh.set(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(recv, 'a', Void.class);
+            vh.set(recv, '\u0123', Void.class);
         });
 
 
@@ -204,23 +204,23 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setVolatile(null, 'a');
+            vh.setVolatile(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.setVolatile(Void.class, 'a');
+            vh.setVolatile(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 'a');
+            vh.setVolatile(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(recv, 'a', Void.class);
+            vh.setVolatile(recv, '\u0123', Void.class);
         });
 
 
@@ -254,23 +254,23 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setOpaque(null, 'a');
+            vh.setOpaque(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.setOpaque(Void.class, 'a');
+            vh.setOpaque(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 'a');
+            vh.setOpaque(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(recv, 'a', Void.class);
+            vh.setOpaque(recv, '\u0123', Void.class);
         });
 
 
@@ -304,27 +304,342 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setRelease(null, 'a');
+            vh.setRelease(null, '\u0123');
         });
         checkCCE(() -> { // receiver reference class
-            vh.setRelease(Void.class, 'a');
+            vh.setRelease(Void.class, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 'a');
+            vh.setRelease(0, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(recv, 'a', Void.class);
+            vh.setRelease(recv, '\u0123', Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, '\u0123', '\u0123', Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchange(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.compareAndExchange(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchange(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchange(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.compareAndExchange(0, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(recv, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(recv, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchange(recv, '\u0123', '\u0123', Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeAcquire(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.compareAndExchangeAcquire(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeAcquire(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeAcquire(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.compareAndExchangeAcquire(0, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeAcquire(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeRelease(null, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.compareAndExchangeRelease(Void.class, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeRelease(recv, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeRelease(recv, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.compareAndExchangeRelease(0, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeRelease(recv, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.getAndSet(null, '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.getAndSet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.getAndSet(0, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(recv, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndSet(recv, '\u0123', Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.getAndAdd(null, '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.getAndAdd(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndAdd(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.getAndAdd(0, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(recv, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(recv, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndAdd(recv, '\u0123', Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.addAndGet(null, '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            char x = (char) vh.addAndGet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.addAndGet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            char x = (char) vh.addAndGet(0, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(recv, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(recv, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.addAndGet(recv, '\u0123', Void.class);
+        });
     }
 
     static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeChar recv, Handles hs) throws Throwable {
@@ -366,11 +681,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, char.class)).
-                    invokeExact((VarHandleTestMethodTypeChar) null, 'a');
+                    invokeExact((VarHandleTestMethodTypeChar) null, '\u0123');
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, char.class)).
-                    invokeExact(Void.class, 'a');
+                    invokeExact(Void.class, '\u0123');
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, Class.class)).
@@ -378,7 +693,7 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, char.class)).
-                    invokeExact(0, 'a');
+                    invokeExact(0, '\u0123');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -387,11 +702,157 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
-                    invokeExact(recv, 'a', Void.class);
+                    invokeExact(recv, '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class, char.class)).
+                    invokeExact((VarHandleTestMethodTypeChar) null, '\u0123', '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, char.class, char.class)).
+                    invokeExact(Void.class, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, Class.class, char.class)).
+                    invokeExact(recv, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
+                    invokeExact(recv, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , char.class, char.class)).
+                    invokeExact(0, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class, char.class, Class.class)).
+                    invokeExact(recv, '\u0123', '\u0123', Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class, char.class)).
+                    invokeExact((VarHandleTestMethodTypeChar) null, '\u0123', '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class, char.class)).
+                    invokeExact(Void.class, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class, char.class)).
+                    invokeExact(recv, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class, Class.class)).
+                    invokeExact(recv, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class , char.class, char.class)).
+                    invokeExact(0, '\u0123', '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class , char.class, char.class)).
+                    invokeExact(recv, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class , char.class, char.class)).
+                    invokeExact(recv, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class, char.class, Class.class)).
+                    invokeExact(recv, '\u0123', '\u0123', Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact((VarHandleTestMethodTypeChar) null, '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+                    invokeExact(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, char.class)).
+                    invokeExact(0, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact(recv, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact(recv, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact(recv, '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact((VarHandleTestMethodTypeChar) null, '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+                    invokeExact(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, char.class)).
+                    invokeExact(0, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact(recv, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact(recv, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, VarHandleTestMethodTypeChar.class, char.class)).
+                    invokeExact(recv, '\u0123', Void.class);
+            });
+        }
     }
 
 
@@ -420,7 +881,7 @@
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set('a', Void.class);
+            vh.set('\u0123', Void.class);
         });
 
 
@@ -447,7 +908,7 @@
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile('a', Void.class);
+            vh.setVolatile('\u0123', Void.class);
         });
 
 
@@ -474,7 +935,7 @@
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque('a', Void.class);
+            vh.setOpaque('\u0123', Void.class);
         });
 
 
@@ -501,11 +962,227 @@
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease('a', Void.class);
+            vh.setRelease('\u0123', Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire('\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease('\u0123', Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease('\u0123', '\u0123', Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchange(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchange('\u0123', Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange('\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange('\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchange('\u0123', '\u0123', Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeAcquire(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeAcquire('\u0123', Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire('\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire('\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeAcquire('\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeRelease(Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeRelease('\u0123', Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease('\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease('\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeRelease('\u0123', '\u0123', Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet('\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet('\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndSet('\u0123', Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndAdd(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd('\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd('\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndAdd('\u0123', Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.addAndGet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet('\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet('\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.addAndGet('\u0123', Void.class);
+        });
     }
 
     static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -540,16 +1217,117 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, char.class, Class.class)).
-                    invokeExact('a', Void.class);
+                    invokeExact('\u0123', Void.class);
+            });
+        }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, char.class)).
+                    invokeExact(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char.class, Class.class)).
+                    invokeExact('\u0123', Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char.class, char.class, Class.class)).
+                    invokeExact('\u0123', '\u0123', Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, char.class)).
+                    invokeExact(Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+                    invokeExact('\u0123', Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char.class, char.class)).
+                    invokeExact('\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class, char.class)).
+                    invokeExact('\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char.class, char.class, Class.class)).
+                    invokeExact('\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char.class)).
+                    invokeExact('\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class)).
+                    invokeExact('\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+                    invokeExact('\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char.class)).
+                    invokeExact('\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char.class)).
+                    invokeExact('\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char.class, Class.class)).
+                    invokeExact('\u0123', Void.class);
+            });
+        }
     }
 
 
     static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
         char[] array = new char[10];
-        Arrays.fill(array, 'a');
+        Arrays.fill(array, '\u0123');
 
         // Get
         // Incorrect argument types
@@ -584,26 +1362,26 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.set(null, 0, 'a');
+            vh.set(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.set(Void.class, 0, 'a');
+            vh.set(Void.class, 0, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.set(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 0, 'a');
+            vh.set(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.set(array, Void.class, 'a');
+            vh.set(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(array, 0, 'a', Void.class);
+            vh.set(array, 0, '\u0123', Void.class);
         });
 
 
@@ -640,26 +1418,26 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setVolatile(null, 0, 'a');
+            vh.setVolatile(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.setVolatile(Void.class, 0, 'a');
+            vh.setVolatile(Void.class, 0, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 0, 'a');
+            vh.setVolatile(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.setVolatile(array, Void.class, 'a');
+            vh.setVolatile(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(array, 0, 'a', Void.class);
+            vh.setVolatile(array, 0, '\u0123', Void.class);
         });
 
 
@@ -696,26 +1474,26 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setOpaque(null, 0, 'a');
+            vh.setOpaque(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.setOpaque(Void.class, 0, 'a');
+            vh.setOpaque(Void.class, 0, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 0, 'a');
+            vh.setOpaque(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.setOpaque(array, Void.class, 'a');
+            vh.setOpaque(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(array, 0, 'a', Void.class);
+            vh.setOpaque(array, 0, '\u0123', Void.class);
         });
 
 
@@ -752,35 +1530,383 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setRelease(null, 0, 'a');
+            vh.setRelease(null, 0, '\u0123');
         });
         checkCCE(() -> { // array reference class
-            vh.setRelease(Void.class, 0, 'a');
+            vh.setRelease(Void.class, 0, '\u0123');
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 0, 'a');
+            vh.setRelease(0, 0, '\u0123');
         });
         checkWMTE(() -> { // index reference class
-            vh.setRelease(array, Void.class, 'a');
+            vh.setRelease(array, Void.class, '\u0123');
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(array, 0, 'a', Void.class);
+            vh.setRelease(array, 0, '\u0123', Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(array, 0, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(array, 0, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(array, 0, '\u0123', '\u0123', Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchange(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.compareAndExchange(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchange(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchange(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.compareAndExchange(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.compareAndExchange(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(array, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchange(array, 0, '\u0123', '\u0123', Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeAcquire(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.compareAndExchangeAcquire(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeAcquire(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeAcquire(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.compareAndExchangeAcquire(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.compareAndExchangeAcquire(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeAcquire(array, 0, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            char x = (char) vh.compareAndExchangeRelease(null, 0, '\u0123', '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.compareAndExchangeRelease(Void.class, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // expected reference class
+            char x = (char) vh.compareAndExchangeRelease(array, 0, Void.class, '\u0123');
+        });
+        checkWMTE(() -> { // actual reference class
+            char x = (char) vh.compareAndExchangeRelease(array, 0, '\u0123', Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.compareAndExchangeRelease(0, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.compareAndExchangeRelease(array, Void.class, '\u0123', '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, '\u0123', '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, '\u0123', '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.compareAndExchangeRelease(array, 0, '\u0123', '\u0123', Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.getAndSet(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.getAndSet(Void.class, 0, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndSet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // reciarrayever primitive class
+            char x = (char) vh.getAndSet(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.getAndSet(array, Void.class, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(array, 0, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndSet(array, 0, '\u0123', Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.getAndAdd(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.getAndAdd(Void.class, 0, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.getAndAdd(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.getAndAdd(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.getAndAdd(array, Void.class, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(array, 0, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(array, 0, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.getAndAdd(array, 0, '\u0123', Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            char x = (char) vh.addAndGet(null, 0, '\u0123');
+        });
+        checkCCE(() -> { // array reference class
+            char x = (char) vh.addAndGet(Void.class, 0, '\u0123');
+        });
+        checkWMTE(() -> { // value reference class
+            char x = (char) vh.addAndGet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            char x = (char) vh.addAndGet(0, 0, '\u0123');
+        });
+        checkWMTE(() -> { // index reference class
+            char x = (char) vh.addAndGet(array, Void.class, '\u0123');
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(array, 0, '\u0123');
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(array, 0, '\u0123');
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            char x = (char) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            char x = (char) vh.addAndGet(array, 0, '\u0123', Void.class);
+        });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
         char[] array = new char[10];
-        Arrays.fill(array, 'a');
+        Arrays.fill(array, '\u0123');
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
@@ -824,11 +1950,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 hs.get(am, methodType(void.class, char[].class, int.class, char.class)).
-                    invokeExact((char[]) null, 0, 'a');
+                    invokeExact((char[]) null, 0, '\u0123');
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, char.class)).
-                    invokeExact(Void.class, 0, 'a');
+                    invokeExact(Void.class, 0, '\u0123');
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, char[].class, int.class, Class.class)).
@@ -836,11 +1962,11 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, char.class)).
-                    invokeExact(0, 0, 'a');
+                    invokeExact(0, 0, '\u0123');
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, char[].class, Class.class, char.class)).
-                    invokeExact(array, Void.class, 'a');
+                    invokeExact(array, Void.class, '\u0123');
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -849,10 +1975,175 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, char[].class, int.class, Class.class)).
-                    invokeExact(array, 0, 'a', Void.class);
+                    invokeExact(array, 0, '\u0123', Void.class);
+            });
+        }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, char.class)).
+                    invokeExact((char[]) null, 0, '\u0123', '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, char.class, char.class)).
+                    invokeExact(Void.class, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, Class.class, char.class)).
+                    invokeExact(array, 0, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, Class.class)).
+                    invokeExact(array, 0, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, char.class, char.class)).
+                    invokeExact(0, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, Class.class, char.class, char.class)).
+                    invokeExact(array, Void.class, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, char.class, Class.class)).
+                    invokeExact(array, 0, '\u0123', '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, char.class)).
+                    invokeExact((char[]) null, 0, '\u0123', '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class, char.class)).
+                    invokeExact(Void.class, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // expected reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class, char.class)).
+                    invokeExact(array, 0, Void.class, '\u0123');
+            });
+            checkWMTE(() -> { // actual reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+                    invokeExact(array, 0, '\u0123', Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class, char.class)).
+                    invokeExact(0, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class, char.class)).
+                    invokeExact(array, Void.class, '\u0123', '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class, char.class)).
+                    invokeExact(array, 0, '\u0123', '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class, char.class)).
+                    invokeExact(array, 0, '\u0123', '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, char.class, Class.class)).
+                    invokeExact(array, 0, '\u0123', '\u0123', Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class)).
+                    invokeExact((char[]) null, 0, '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class)).
+                    invokeExact(Void.class, 0, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class)).
+                    invokeExact(0, 0, '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class)).
+                    invokeExact(array, Void.class, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class)).
+                    invokeExact(array, 0, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class)).
+                    invokeExact(array, 0, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+                    invokeExact(array, 0, '\u0123', Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class)).
+                    invokeExact((char[]) null, 0, '\u0123');
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                char x = (char) hs.get(am, methodType(char.class, Class.class, int.class, char.class)).
+                    invokeExact(Void.class, 0, '\u0123');
+            });
+            checkWMTE(() -> { // value reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                char x = (char) hs.get(am, methodType(char.class, int.class, int.class, char.class)).
+                    invokeExact(0, 0, '\u0123');
+            });
+            checkWMTE(() -> { // index reference class
+                char x = (char) hs.get(am, methodType(char.class, char[].class, Class.class, char.class)).
+                    invokeExact(array, Void.class, '\u0123');
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, char[].class, int.class, char.class)).
+                    invokeExact(array, 0, '\u0123');
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, char[].class, int.class, char.class)).
+                    invokeExact(array, 0, '\u0123');
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                char x = (char) hs.get(am, methodType(char.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                char x = (char) hs.get(am, methodType(char.class, char[].class, int.class, char.class, Class.class)).
+                    invokeExact(array, 0, '\u0123', Void.class);
+            });
+        }
     }
 }
 
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeDouble.java	Thu Jul 07 18:35:29 2016 +0000
@@ -324,7 +324,322 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, 1.0d, 1.0d, Void.class);
+        });
 
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.compareAndExchange(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            double x = (double) vh.compareAndExchange(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchange(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchange(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            double x = (double) vh.compareAndExchange(0, 1.0d, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(recv, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(recv, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchange(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.compareAndExchangeAcquire(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            double x = (double) vh.compareAndExchangeAcquire(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchangeAcquire(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchangeAcquire(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            double x = (double) vh.compareAndExchangeAcquire(0, 1.0d, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchangeAcquire(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.compareAndExchangeRelease(null, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            double x = (double) vh.compareAndExchangeRelease(Void.class, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchangeRelease(recv, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchangeRelease(recv, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            double x = (double) vh.compareAndExchangeRelease(0, 1.0d, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchangeRelease(recv, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.getAndSet(null, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            double x = (double) vh.getAndSet(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            double x = (double) vh.getAndSet(0, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(recv, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.getAndSet(recv, 1.0d, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.getAndAdd(null, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            double x = (double) vh.getAndAdd(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.getAndAdd(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            double x = (double) vh.getAndAdd(0, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(recv, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(recv, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.getAndAdd(recv, 1.0d, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.addAndGet(null, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            double x = (double) vh.addAndGet(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.addAndGet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            double x = (double) vh.addAndGet(0, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(recv, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(recv, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.addAndGet(recv, 1.0d, Void.class);
+        });
     }
 
     static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeDouble recv, Handles hs) throws Throwable {
@@ -391,7 +706,153 @@
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class, double.class, double.class)).
+                    invokeExact((VarHandleTestMethodTypeDouble) null, 1.0d, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, double.class, double.class)).
+                    invokeExact(Void.class, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class, Class.class, double.class)).
+                    invokeExact(recv, Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class, double.class, Class.class)).
+                    invokeExact(recv, 1.0d, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , double.class, double.class)).
+                    invokeExact(0, 1.0d, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class, double.class, double.class, Class.class)).
+                    invokeExact(recv, 1.0d, 1.0d, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class, double.class)).
+                    invokeExact((VarHandleTestMethodTypeDouble) null, 1.0d, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, double.class, double.class)).
+                    invokeExact(Void.class, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // expected reference class
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, Class.class, double.class)).
+                    invokeExact(recv, Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // actual reference class
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class, Class.class)).
+                    invokeExact(recv, 1.0d, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                double x = (double) hs.get(am, methodType(double.class, int.class , double.class, double.class)).
+                    invokeExact(0, 1.0d, 1.0d);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeDouble.class , double.class, double.class)).
+                    invokeExact(recv, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class , double.class, double.class)).
+                    invokeExact(recv, 1.0d, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class, double.class, Class.class)).
+                    invokeExact(recv, 1.0d, 1.0d, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact((VarHandleTestMethodTypeDouble) null, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, double.class)).
+                    invokeExact(Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // value reference class
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                double x = (double) hs.get(am, methodType(double.class, int.class, double.class)).
+                    invokeExact(0, 1.0d);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact(recv, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact(recv, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact(recv, 1.0d, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            checkNPE(() -> { // null receiver
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact((VarHandleTestMethodTypeDouble) null, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, double.class)).
+                    invokeExact(Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // value reference class
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                double x = (double) hs.get(am, methodType(double.class, int.class, double.class)).
+                    invokeExact(0, 1.0d);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact(recv, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact(recv, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, VarHandleTestMethodTypeDouble.class, double.class)).
+                    invokeExact(recv, 1.0d, Void.class);
+            });
+        }
     }
 
 
@@ -505,7 +966,223 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(1.0d, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(1.0d, 1.0d, Void.class);
+        });
 
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(1.0d, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(1.0d, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(1.0d, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(1.0d, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchange(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchange(1.0d, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchange(1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchangeAcquire(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchangeAcquire(1.0d, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchangeAcquire(1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchangeRelease(Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchangeRelease(1.0d, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchangeRelease(1.0d, 1.0d, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.getAndSet(1.0d, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.getAndAdd(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.getAndAdd(1.0d, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.addAndGet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.addAndGet(1.0d, Void.class);
+        });
     }
 
     static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -543,7 +1220,108 @@
                     invokeExact(1.0d, Void.class);
             });
         }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, double.class)).
+                    invokeExact(Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double.class, Class.class)).
+                    invokeExact(1.0d, Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double.class, double.class, Class.class)).
+                    invokeExact(1.0d, 1.0d, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, double.class)).
+                    invokeExact(Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // actual reference class
+                double x = (double) hs.get(am, methodType(double.class, double.class, Class.class)).
+                    invokeExact(1.0d, Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, double.class, double.class)).
+                    invokeExact(1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, double.class, double.class)).
+                    invokeExact(1.0d, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, double.class, double.class, Class.class)).
+                    invokeExact(1.0d, 1.0d, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, double.class)).
+                    invokeExact(1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, double.class)).
+                    invokeExact(1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, double.class, Class.class)).
+                    invokeExact(1.0d, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, double.class)).
+                    invokeExact(1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, double.class)).
+                    invokeExact(1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, double.class, Class.class)).
+                    invokeExact(1.0d, Void.class);
+            });
+        }
     }
 
 
@@ -775,7 +1553,355 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(array, 0, 1.0d, 1.0d, Void.class);
+        });
 
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.compareAndExchange(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // array reference class
+            double x = (double) vh.compareAndExchange(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchange(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchange(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            double x = (double) vh.compareAndExchange(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            double x = (double) vh.compareAndExchange(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(array, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchange(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.compareAndExchangeAcquire(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // array reference class
+            double x = (double) vh.compareAndExchangeAcquire(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchangeAcquire(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchangeAcquire(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            double x = (double) vh.compareAndExchangeAcquire(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            double x = (double) vh.compareAndExchangeAcquire(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchangeAcquire(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            double x = (double) vh.compareAndExchangeRelease(null, 0, 1.0d, 1.0d);
+        });
+        checkCCE(() -> { // array reference class
+            double x = (double) vh.compareAndExchangeRelease(Void.class, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // expected reference class
+            double x = (double) vh.compareAndExchangeRelease(array, 0, Void.class, 1.0d);
+        });
+        checkWMTE(() -> { // actual reference class
+            double x = (double) vh.compareAndExchangeRelease(array, 0, 1.0d, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            double x = (double) vh.compareAndExchangeRelease(0, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            double x = (double) vh.compareAndExchangeRelease(array, Void.class, 1.0d, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, 1.0d, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 1.0d, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.compareAndExchangeRelease(array, 0, 1.0d, 1.0d, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            double x = (double) vh.getAndSet(null, 0, 1.0d);
+        });
+        checkCCE(() -> { // array reference class
+            double x = (double) vh.getAndSet(Void.class, 0, 1.0d);
+        });
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.getAndSet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // reciarrayever primitive class
+            double x = (double) vh.getAndSet(0, 0, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            double x = (double) vh.getAndSet(array, Void.class, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(array, 0, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.getAndSet(array, 0, 1.0d, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            double x = (double) vh.getAndAdd(null, 0, 1.0d);
+        });
+        checkCCE(() -> { // array reference class
+            double x = (double) vh.getAndAdd(Void.class, 0, 1.0d);
+        });
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.getAndAdd(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            double x = (double) vh.getAndAdd(0, 0, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            double x = (double) vh.getAndAdd(array, Void.class, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(array, 0, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(array, 0, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.getAndAdd(array, 0, 1.0d, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            double x = (double) vh.addAndGet(null, 0, 1.0d);
+        });
+        checkCCE(() -> { // array reference class
+            double x = (double) vh.addAndGet(Void.class, 0, 1.0d);
+        });
+        checkWMTE(() -> { // value reference class
+            double x = (double) vh.addAndGet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            double x = (double) vh.addAndGet(0, 0, 1.0d);
+        });
+        checkWMTE(() -> { // index reference class
+            double x = (double) vh.addAndGet(array, Void.class, 1.0d);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(array, 0, 1.0d);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(array, 0, 1.0d);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            double x = (double) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            double x = (double) vh.addAndGet(array, 0, 1.0d, Void.class);
+        });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -852,7 +1978,172 @@
                     invokeExact(array, 0, 1.0d, Void.class);
             });
         }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, double.class, double.class)).
+                    invokeExact((double[]) null, 0, 1.0d, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, double.class, double.class)).
+                    invokeExact(Void.class, 0, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, Class.class, double.class)).
+                    invokeExact(array, 0, Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, double.class, Class.class)).
+                    invokeExact(array, 0, 1.0d, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, double.class, double.class)).
+                    invokeExact(0, 0, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double[].class, Class.class, double.class, double.class)).
+                    invokeExact(array, Void.class, 1.0d, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, double.class, double.class, Class.class)).
+                    invokeExact(array, 0, 1.0d, 1.0d, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class, double.class)).
+                    invokeExact((double[]) null, 0, 1.0d, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, int.class, double.class, double.class)).
+                    invokeExact(Void.class, 0, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // expected reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, Class.class, double.class)).
+                    invokeExact(array, 0, Void.class, 1.0d);
+            });
+            checkWMTE(() -> { // actual reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class, Class.class)).
+                    invokeExact(array, 0, 1.0d, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                double x = (double) hs.get(am, methodType(double.class, int.class, int.class, double.class, double.class)).
+                    invokeExact(0, 0, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // index reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, Class.class, double.class, double.class)).
+                    invokeExact(array, Void.class, 1.0d, 1.0d);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, double[].class, int.class, double.class, double.class)).
+                    invokeExact(array, 0, 1.0d, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, double.class, double.class)).
+                    invokeExact(array, 0, 1.0d, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class, double.class, Class.class)).
+                    invokeExact(array, 0, 1.0d, 1.0d, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class)).
+                    invokeExact((double[]) null, 0, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, int.class, double.class)).
+                    invokeExact(Void.class, 0, 1.0d);
+            });
+            checkWMTE(() -> { // value reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                double x = (double) hs.get(am, methodType(double.class, int.class, int.class, double.class)).
+                    invokeExact(0, 0, 1.0d);
+            });
+            checkWMTE(() -> { // index reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, Class.class, double.class)).
+                    invokeExact(array, Void.class, 1.0d);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, double[].class, int.class, double.class)).
+                    invokeExact(array, 0, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, double.class)).
+                    invokeExact(array, 0, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class, Class.class)).
+                    invokeExact(array, 0, 1.0d, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class)).
+                    invokeExact((double[]) null, 0, 1.0d);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                double x = (double) hs.get(am, methodType(double.class, Class.class, int.class, double.class)).
+                    invokeExact(Void.class, 0, 1.0d);
+            });
+            checkWMTE(() -> { // value reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                double x = (double) hs.get(am, methodType(double.class, int.class, int.class, double.class)).
+                    invokeExact(0, 0, 1.0d);
+            });
+            checkWMTE(() -> { // index reference class
+                double x = (double) hs.get(am, methodType(double.class, double[].class, Class.class, double.class)).
+                    invokeExact(array, Void.class, 1.0d);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, double[].class, int.class, double.class)).
+                    invokeExact(array, 0, 1.0d);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, double[].class, int.class, double.class)).
+                    invokeExact(array, 0, 1.0d);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                double x = (double) hs.get(am, methodType(double.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                double x = (double) hs.get(am, methodType(double.class, double[].class, int.class, double.class, Class.class)).
+                    invokeExact(array, 0, 1.0d, Void.class);
+            });
+        }
     }
 }
 
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeFloat.java	Thu Jul 07 18:35:29 2016 +0000
@@ -324,7 +324,322 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, 1.0f, 1.0f, Void.class);
+        });
 
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.compareAndExchange(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            float x = (float) vh.compareAndExchange(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchange(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchange(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            float x = (float) vh.compareAndExchange(0, 1.0f, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(recv, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(recv, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchange(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.compareAndExchangeAcquire(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            float x = (float) vh.compareAndExchangeAcquire(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchangeAcquire(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchangeAcquire(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            float x = (float) vh.compareAndExchangeAcquire(0, 1.0f, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchangeAcquire(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.compareAndExchangeRelease(null, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            float x = (float) vh.compareAndExchangeRelease(Void.class, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchangeRelease(recv, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchangeRelease(recv, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            float x = (float) vh.compareAndExchangeRelease(0, 1.0f, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchangeRelease(recv, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.getAndSet(null, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            float x = (float) vh.getAndSet(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            float x = (float) vh.getAndSet(0, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(recv, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.getAndSet(recv, 1.0f, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.getAndAdd(null, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            float x = (float) vh.getAndAdd(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.getAndAdd(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            float x = (float) vh.getAndAdd(0, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(recv, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(recv, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.getAndAdd(recv, 1.0f, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.addAndGet(null, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            float x = (float) vh.addAndGet(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.addAndGet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            float x = (float) vh.addAndGet(0, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(recv, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(recv, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.addAndGet(recv, 1.0f, Void.class);
+        });
     }
 
     static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeFloat recv, Handles hs) throws Throwable {
@@ -391,7 +706,153 @@
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class, float.class, float.class)).
+                    invokeExact((VarHandleTestMethodTypeFloat) null, 1.0f, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, float.class, float.class)).
+                    invokeExact(Void.class, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class, Class.class, float.class)).
+                    invokeExact(recv, Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class, float.class, Class.class)).
+                    invokeExact(recv, 1.0f, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , float.class, float.class)).
+                    invokeExact(0, 1.0f, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class, float.class, float.class, Class.class)).
+                    invokeExact(recv, 1.0f, 1.0f, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class, float.class)).
+                    invokeExact((VarHandleTestMethodTypeFloat) null, 1.0f, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, float.class, float.class)).
+                    invokeExact(Void.class, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // expected reference class
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, Class.class, float.class)).
+                    invokeExact(recv, Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // actual reference class
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class, Class.class)).
+                    invokeExact(recv, 1.0f, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                float x = (float) hs.get(am, methodType(float.class, int.class , float.class, float.class)).
+                    invokeExact(0, 1.0f, 1.0f);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeFloat.class , float.class, float.class)).
+                    invokeExact(recv, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class , float.class, float.class)).
+                    invokeExact(recv, 1.0f, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class, float.class, Class.class)).
+                    invokeExact(recv, 1.0f, 1.0f, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact((VarHandleTestMethodTypeFloat) null, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, float.class)).
+                    invokeExact(Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // value reference class
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                float x = (float) hs.get(am, methodType(float.class, int.class, float.class)).
+                    invokeExact(0, 1.0f);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact(recv, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact(recv, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact(recv, 1.0f, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            checkNPE(() -> { // null receiver
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact((VarHandleTestMethodTypeFloat) null, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, float.class)).
+                    invokeExact(Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // value reference class
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                float x = (float) hs.get(am, methodType(float.class, int.class, float.class)).
+                    invokeExact(0, 1.0f);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact(recv, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact(recv, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, VarHandleTestMethodTypeFloat.class, float.class)).
+                    invokeExact(recv, 1.0f, Void.class);
+            });
+        }
     }
 
 
@@ -505,7 +966,223 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(1.0f, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(1.0f, 1.0f, Void.class);
+        });
 
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(1.0f, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(1.0f, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(1.0f, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(1.0f, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchange(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchange(1.0f, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchange(1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchangeAcquire(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchangeAcquire(1.0f, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchangeAcquire(1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchangeRelease(Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchangeRelease(1.0f, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchangeRelease(1.0f, 1.0f, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.getAndSet(1.0f, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.getAndAdd(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.getAndAdd(1.0f, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.addAndGet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.addAndGet(1.0f, Void.class);
+        });
     }
 
     static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -543,7 +1220,108 @@
                     invokeExact(1.0f, Void.class);
             });
         }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, float.class)).
+                    invokeExact(Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float.class, Class.class)).
+                    invokeExact(1.0f, Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float.class, float.class, Class.class)).
+                    invokeExact(1.0f, 1.0f, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, float.class)).
+                    invokeExact(Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // actual reference class
+                float x = (float) hs.get(am, methodType(float.class, float.class, Class.class)).
+                    invokeExact(1.0f, Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, float.class, float.class)).
+                    invokeExact(1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, float.class, float.class)).
+                    invokeExact(1.0f, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, float.class, float.class, Class.class)).
+                    invokeExact(1.0f, 1.0f, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, float.class)).
+                    invokeExact(1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, float.class)).
+                    invokeExact(1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, float.class, Class.class)).
+                    invokeExact(1.0f, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, float.class)).
+                    invokeExact(1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, float.class)).
+                    invokeExact(1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, float.class, Class.class)).
+                    invokeExact(1.0f, Void.class);
+            });
+        }
     }
 
 
@@ -775,7 +1553,355 @@
         });
 
 
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(array, 0, 1.0f, 1.0f, Void.class);
+        });
 
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.compareAndExchange(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // array reference class
+            float x = (float) vh.compareAndExchange(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchange(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchange(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            float x = (float) vh.compareAndExchange(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            float x = (float) vh.compareAndExchange(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(array, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchange(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.compareAndExchangeAcquire(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // array reference class
+            float x = (float) vh.compareAndExchangeAcquire(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchangeAcquire(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchangeAcquire(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            float x = (float) vh.compareAndExchangeAcquire(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            float x = (float) vh.compareAndExchangeAcquire(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchangeAcquire(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            float x = (float) vh.compareAndExchangeRelease(null, 0, 1.0f, 1.0f);
+        });
+        checkCCE(() -> { // array reference class
+            float x = (float) vh.compareAndExchangeRelease(Void.class, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // expected reference class
+            float x = (float) vh.compareAndExchangeRelease(array, 0, Void.class, 1.0f);
+        });
+        checkWMTE(() -> { // actual reference class
+            float x = (float) vh.compareAndExchangeRelease(array, 0, 1.0f, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            float x = (float) vh.compareAndExchangeRelease(0, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            float x = (float) vh.compareAndExchangeRelease(array, Void.class, 1.0f, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, 1.0f, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 1.0f, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.compareAndExchangeRelease(array, 0, 1.0f, 1.0f, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            float x = (float) vh.getAndSet(null, 0, 1.0f);
+        });
+        checkCCE(() -> { // array reference class
+            float x = (float) vh.getAndSet(Void.class, 0, 1.0f);
+        });
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.getAndSet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // reciarrayever primitive class
+            float x = (float) vh.getAndSet(0, 0, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            float x = (float) vh.getAndSet(array, Void.class, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(array, 0, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.getAndSet(array, 0, 1.0f, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            float x = (float) vh.getAndAdd(null, 0, 1.0f);
+        });
+        checkCCE(() -> { // array reference class
+            float x = (float) vh.getAndAdd(Void.class, 0, 1.0f);
+        });
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.getAndAdd(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            float x = (float) vh.getAndAdd(0, 0, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            float x = (float) vh.getAndAdd(array, Void.class, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(array, 0, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(array, 0, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.getAndAdd(array, 0, 1.0f, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            float x = (float) vh.addAndGet(null, 0, 1.0f);
+        });
+        checkCCE(() -> { // array reference class
+            float x = (float) vh.addAndGet(Void.class, 0, 1.0f);
+        });
+        checkWMTE(() -> { // value reference class
+            float x = (float) vh.addAndGet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            float x = (float) vh.addAndGet(0, 0, 1.0f);
+        });
+        checkWMTE(() -> { // index reference class
+            float x = (float) vh.addAndGet(array, Void.class, 1.0f);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(array, 0, 1.0f);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(array, 0, 1.0f);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            float x = (float) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            float x = (float) vh.addAndGet(array, 0, 1.0f, Void.class);
+        });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
@@ -852,7 +1978,172 @@
                     invokeExact(array, 0, 1.0f, Void.class);
             });
         }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, float.class, float.class)).
+                    invokeExact((float[]) null, 0, 1.0f, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, float.class, float.class)).
+                    invokeExact(Void.class, 0, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, Class.class, float.class)).
+                    invokeExact(array, 0, Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, float.class, Class.class)).
+                    invokeExact(array, 0, 1.0f, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, float.class, float.class)).
+                    invokeExact(0, 0, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float[].class, Class.class, float.class, float.class)).
+                    invokeExact(array, Void.class, 1.0f, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, float.class, float.class, Class.class)).
+                    invokeExact(array, 0, 1.0f, 1.0f, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class, float.class)).
+                    invokeExact((float[]) null, 0, 1.0f, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, int.class, float.class, float.class)).
+                    invokeExact(Void.class, 0, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // expected reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, Class.class, float.class)).
+                    invokeExact(array, 0, Void.class, 1.0f);
+            });
+            checkWMTE(() -> { // actual reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class, Class.class)).
+                    invokeExact(array, 0, 1.0f, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                float x = (float) hs.get(am, methodType(float.class, int.class, int.class, float.class, float.class)).
+                    invokeExact(0, 0, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // index reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, Class.class, float.class, float.class)).
+                    invokeExact(array, Void.class, 1.0f, 1.0f);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, float[].class, int.class, float.class, float.class)).
+                    invokeExact(array, 0, 1.0f, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, float.class, float.class)).
+                    invokeExact(array, 0, 1.0f, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class, float.class, Class.class)).
+                    invokeExact(array, 0, 1.0f, 1.0f, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class)).
+                    invokeExact((float[]) null, 0, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, int.class, float.class)).
+                    invokeExact(Void.class, 0, 1.0f);
+            });
+            checkWMTE(() -> { // value reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                float x = (float) hs.get(am, methodType(float.class, int.class, int.class, float.class)).
+                    invokeExact(0, 0, 1.0f);
+            });
+            checkWMTE(() -> { // index reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, Class.class, float.class)).
+                    invokeExact(array, Void.class, 1.0f);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, float[].class, int.class, float.class)).
+                    invokeExact(array, 0, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, float.class)).
+                    invokeExact(array, 0, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class, Class.class)).
+                    invokeExact(array, 0, 1.0f, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class)).
+                    invokeExact((float[]) null, 0, 1.0f);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                float x = (float) hs.get(am, methodType(float.class, Class.class, int.class, float.class)).
+                    invokeExact(Void.class, 0, 1.0f);
+            });
+            checkWMTE(() -> { // value reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                float x = (float) hs.get(am, methodType(float.class, int.class, int.class, float.class)).
+                    invokeExact(0, 0, 1.0f);
+            });
+            checkWMTE(() -> { // index reference class
+                float x = (float) hs.get(am, methodType(float.class, float[].class, Class.class, float.class)).
+                    invokeExact(array, Void.class, 1.0f);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, float[].class, int.class, float.class)).
+                    invokeExact(array, 0, 1.0f);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, float[].class, int.class, float.class)).
+                    invokeExact(array, 0, 1.0f);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                float x = (float) hs.get(am, methodType(float.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                float x = (float) hs.get(am, methodType(float.class, float[].class, int.class, float.class, Class.class)).
+                    invokeExact(array, 0, 1.0f, Void.class);
+            });
+        }
     }
 }
 
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeInt.java	Thu Jul 07 18:35:29 2016 +0000
@@ -43,13 +43,13 @@
 import static java.lang.invoke.MethodType.*;
 
 public class VarHandleTestMethodTypeInt extends VarHandleBaseTest {
-    static final int static_final_v = 1;
+    static final int static_final_v = 0x01234567;
 
-    static int static_v = 1;
+    static int static_v = 0x01234567;
 
-    final int final_v = 1;
+    final int final_v = 0x01234567;
 
-    int v = 1;
+    int v = 0x01234567;
 
     VarHandle vhFinalField;
 
@@ -154,23 +154,23 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.set(null, 1);
+            vh.set(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            vh.set(Void.class, 1);
+            vh.set(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.set(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 1);
+            vh.set(0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(recv, 1, Void.class);
+            vh.set(recv, 0x01234567, Void.class);
         });
 
 
@@ -204,23 +204,23 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setVolatile(null, 1);
+            vh.setVolatile(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setVolatile(Void.class, 1);
+            vh.setVolatile(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 1);
+            vh.setVolatile(0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(recv, 1, Void.class);
+            vh.setVolatile(recv, 0x01234567, Void.class);
         });
 
 
@@ -254,23 +254,23 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setOpaque(null, 1);
+            vh.setOpaque(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setOpaque(Void.class, 1);
+            vh.setOpaque(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 1);
+            vh.setOpaque(0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(recv, 1, Void.class);
+            vh.setOpaque(recv, 0x01234567, Void.class);
         });
 
 
@@ -304,341 +304,341 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setRelease(null, 1);
+            vh.setRelease(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setRelease(Void.class, 1);
+            vh.setRelease(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 1);
+            vh.setRelease(0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(recv, 1, Void.class);
+            vh.setRelease(recv, 0x01234567, Void.class);
         });
 
 
         // CompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.compareAndSet(null, 1, 1);
+            boolean r = vh.compareAndSet(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.compareAndSet(Void.class, 1, 1);
+            boolean r = vh.compareAndSet(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.compareAndSet(recv, Void.class, 1);
+            boolean r = vh.compareAndSet(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.compareAndSet(recv, 1, Void.class);
+            boolean r = vh.compareAndSet(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.compareAndSet(0, 1, 1);
+            boolean r = vh.compareAndSet(0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.compareAndSet(recv, 1, 1, Void.class);
+            boolean r = vh.compareAndSet(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSet(null, 1, 1);
+            boolean r = vh.weakCompareAndSet(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSet(Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSet(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSet(recv, Void.class, 1);
+            boolean r = vh.weakCompareAndSet(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSet(recv, 1, Void.class);
+            boolean r = vh.weakCompareAndSet(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSet(0, 1, 1);
+            boolean r = vh.weakCompareAndSet(0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSet(recv, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSet(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetVolatile(null, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1);
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetVolatile(0, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetVolatile();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetAcquire(null, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 1);
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetAcquire(0, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetRelease(null, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetRelease(Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 1);
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetRelease(recv, 1, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetRelease(0, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetRelease(recv, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.compareAndExchangeVolatile(null, 1, 1);
+            int x = (int) vh.compareAndExchange(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            int x = (int) vh.compareAndExchangeVolatile(Void.class, 1, 1);
+            int x = (int) vh.compareAndExchange(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeVolatile(recv, Void.class, 1);
+            int x = (int) vh.compareAndExchange(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeVolatile(recv, 1, Void.class);
+            int x = (int) vh.compareAndExchange(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            int x = (int) vh.compareAndExchangeVolatile(0, 1, 1);
+            int x = (int) vh.compareAndExchange(0, 0x01234567, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(recv, 1, 1);
+            Void r = (Void) vh.compareAndExchange(recv, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 1, 1);
+            boolean x = (boolean) vh.compareAndExchange(recv, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            int x = (int) vh.compareAndExchangeVolatile();
+            int x = (int) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeVolatile(recv, 1, 1, Void.class);
+            int x = (int) vh.compareAndExchange(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
-        // CompareAndExchangeVolatileAcquire
+        // CompareAndExchangeAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.compareAndExchangeAcquire(null, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            int x = (int) vh.compareAndExchangeAcquire(Void.class, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeAcquire(recv, Void.class, 1);
+            int x = (int) vh.compareAndExchangeAcquire(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeAcquire(recv, 1, Void.class);
+            int x = (int) vh.compareAndExchangeAcquire(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            int x = (int) vh.compareAndExchangeAcquire(0, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(0, 0x01234567, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeAcquire(recv, 1, 1);
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 1, 1);
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeAcquire(recv, 1, 1, Void.class);
+            int x = (int) vh.compareAndExchangeAcquire(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // CompareAndExchangeRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.compareAndExchangeRelease(null, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(null, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            int x = (int) vh.compareAndExchangeRelease(Void.class, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(Void.class, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeRelease(recv, Void.class, 1);
+            int x = (int) vh.compareAndExchangeRelease(recv, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeRelease(recv, 1, Void.class);
+            int x = (int) vh.compareAndExchangeRelease(recv, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            int x = (int) vh.compareAndExchangeRelease(0, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(0, 0x01234567, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeRelease(recv, 1, 1);
+            Void r = (Void) vh.compareAndExchangeRelease(recv, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeRelease(recv, 1, 1);
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeRelease(recv, 1, 1, Void.class);
+            int x = (int) vh.compareAndExchangeRelease(recv, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // GetAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.getAndSet(null, 1);
+            int x = (int) vh.getAndSet(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            int x = (int) vh.getAndSet(Void.class, 1);
+            int x = (int) vh.getAndSet(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             int x = (int) vh.getAndSet(recv, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            int x = (int) vh.getAndSet(0, 1);
+            int x = (int) vh.getAndSet(0, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndSet(recv, 1);
+            Void r = (Void) vh.getAndSet(recv, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndSet(recv, 1);
+            boolean x = (boolean) vh.getAndSet(recv, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.getAndSet(recv, 1, Void.class);
+            int x = (int) vh.getAndSet(recv, 0x01234567, Void.class);
         });
 
         // GetAndAdd
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.getAndAdd(null, 1);
+            int x = (int) vh.getAndAdd(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            int x = (int) vh.getAndAdd(Void.class, 1);
+            int x = (int) vh.getAndAdd(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             int x = (int) vh.getAndAdd(recv, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            int x = (int) vh.getAndAdd(0, 1);
+            int x = (int) vh.getAndAdd(0, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndAdd(recv, 1);
+            Void r = (Void) vh.getAndAdd(recv, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndAdd(recv, 1);
+            boolean x = (boolean) vh.getAndAdd(recv, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.getAndAdd(recv, 1, Void.class);
+            int x = (int) vh.getAndAdd(recv, 0x01234567, Void.class);
         });
 
 
         // AddAndGet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.addAndGet(null, 1);
+            int x = (int) vh.addAndGet(null, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            int x = (int) vh.addAndGet(Void.class, 1);
+            int x = (int) vh.addAndGet(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             int x = (int) vh.addAndGet(recv, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            int x = (int) vh.addAndGet(0, 1);
+            int x = (int) vh.addAndGet(0, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.addAndGet(recv, 1);
+            Void r = (Void) vh.addAndGet(recv, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.addAndGet(recv, 1);
+            boolean x = (boolean) vh.addAndGet(recv, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.addAndGet(recv, 1, Void.class);
+            int x = (int) vh.addAndGet(recv, 0x01234567, Void.class);
         });
     }
 
@@ -681,11 +681,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact((VarHandleTestMethodTypeInt) null, 1);
+                    invokeExact((VarHandleTestMethodTypeInt) null, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, int.class)).
-                    invokeExact(Void.class, 1);
+                    invokeExact(Void.class, 0x01234567);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, Class.class)).
@@ -693,7 +693,7 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class)).
-                    invokeExact(0, 1);
+                    invokeExact(0, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -702,7 +702,7 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
-                    invokeExact(recv, 1, Void.class);
+                    invokeExact(recv, 0x01234567, Void.class);
             });
         }
 
@@ -710,23 +710,23 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, int.class)).
-                    invokeExact((VarHandleTestMethodTypeInt) null, 1, 1);
+                    invokeExact((VarHandleTestMethodTypeInt) null, 0x01234567, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, int.class)).
-                    invokeExact(Void.class, 1, 1);
+                    invokeExact(Void.class, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, Class.class, int.class)).
-                    invokeExact(recv, Void.class, 1);
+                    invokeExact(recv, Void.class, 0x01234567);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
-                    invokeExact(recv, 1, Void.class);
+                    invokeExact(recv, 0x01234567, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , int.class, int.class)).
-                    invokeExact(0, 1, 1);
+                    invokeExact(0, 0x01234567, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -735,39 +735,39 @@
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class, int.class, Class.class)).
-                    invokeExact(recv, 1, 1, Void.class);
+                    invokeExact(recv, 0x01234567, 0x01234567, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
             checkNPE(() -> { // null receiver
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, int.class)).
-                    invokeExact((VarHandleTestMethodTypeInt) null, 1, 1);
+                    invokeExact((VarHandleTestMethodTypeInt) null, 0x01234567, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
-                    invokeExact(Void.class, 1, 1);
+                    invokeExact(Void.class, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // expected reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class, int.class)).
-                    invokeExact(recv, Void.class, 1);
+                    invokeExact(recv, Void.class, 0x01234567);
             });
             checkWMTE(() -> { // actual reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, Class.class)).
-                    invokeExact(recv, 1, Void.class);
+                    invokeExact(recv, 0x01234567, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class , int.class, int.class)).
-                    invokeExact(0, 1, 1);
+                    invokeExact(0, 0x01234567, 0x01234567);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class , int.class, int.class)).
-                    invokeExact(recv, 1, 1);
+                    invokeExact(recv, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class , int.class, int.class)).
-                    invokeExact(recv, 1, 1);
+                    invokeExact(recv, 0x01234567, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -776,18 +776,18 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class, int.class, Class.class)).
-                    invokeExact(recv, 1, 1, Void.class);
+                    invokeExact(recv, 0x01234567, 0x01234567, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             checkNPE(() -> { // null receiver
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact((VarHandleTestMethodTypeInt) null, 1);
+                    invokeExact((VarHandleTestMethodTypeInt) null, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invokeExact(Void.class, 1);
+                    invokeExact(Void.class, 0x01234567);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
@@ -795,16 +795,16 @@
             });
             checkWMTE(() -> { // reciever primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
-                    invokeExact(0, 1);
+                    invokeExact(0, 0x01234567);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact(recv, 1);
+                    invokeExact(recv, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact(recv, 1);
+                    invokeExact(recv, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -813,18 +813,18 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact(recv, 1, Void.class);
+                    invokeExact(recv, 0x01234567, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkNPE(() -> { // null receiver
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact((VarHandleTestMethodTypeInt) null, 1);
+                    invokeExact((VarHandleTestMethodTypeInt) null, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invokeExact(Void.class, 1);
+                    invokeExact(Void.class, 0x01234567);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, Class.class)).
@@ -832,16 +832,16 @@
             });
             checkWMTE(() -> { // reciever primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class)).
-                    invokeExact(0, 1);
+                    invokeExact(0, 0x01234567);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact(recv, 1);
+                    invokeExact(recv, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact(recv, 1);
+                    invokeExact(recv, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -850,7 +850,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, VarHandleTestMethodTypeInt.class, int.class)).
-                    invokeExact(recv, 1, Void.class);
+                    invokeExact(recv, 0x01234567, Void.class);
             });
         }
     }
@@ -881,7 +881,7 @@
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(1, Void.class);
+            vh.set(0x01234567, Void.class);
         });
 
 
@@ -908,7 +908,7 @@
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(1, Void.class);
+            vh.setVolatile(0x01234567, Void.class);
         });
 
 
@@ -935,7 +935,7 @@
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(1, Void.class);
+            vh.setOpaque(0x01234567, Void.class);
         });
 
 
@@ -962,164 +962,164 @@
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(1, Void.class);
+            vh.setRelease(0x01234567, Void.class);
         });
 
 
         // CompareAndSet
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.compareAndSet(Void.class, 1);
+            boolean r = vh.compareAndSet(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.compareAndSet(1, Void.class);
+            boolean r = vh.compareAndSet(0x01234567, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.compareAndSet(1, 1, Void.class);
+            boolean r = vh.compareAndSet(0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSet
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSet(Void.class, 1);
+            boolean r = vh.weakCompareAndSet(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSet(1, Void.class);
+            boolean r = vh.weakCompareAndSet(0x01234567, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSet(1, 1, Void.class);
+            boolean r = vh.weakCompareAndSet(0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetVolatile
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1);
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetVolatile(1, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(0x01234567, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetVolatile();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetVolatile(1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetAcquire
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1);
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetAcquire(1, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(0x01234567, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetAcquire(1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetRelease
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetRelease(Void.class, 1);
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetRelease(1, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(0x01234567, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetRelease(1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(0x01234567, 0x01234567, Void.class);
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeVolatile(Void.class, 1);
+            int x = (int) vh.compareAndExchange(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeVolatile(1, Void.class);
+            int x = (int) vh.compareAndExchange(0x01234567, Void.class);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(1, 1);
+            Void r = (Void) vh.compareAndExchange(0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(1, 1);
+            boolean x = (boolean) vh.compareAndExchange(0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            int x = (int) vh.compareAndExchangeVolatile();
+            int x = (int) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeVolatile(1, 1, Void.class);
+            int x = (int) vh.compareAndExchange(0x01234567, 0x01234567, Void.class);
         });
 
 
         // CompareAndExchangeAcquire
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeAcquire(Void.class, 1);
+            int x = (int) vh.compareAndExchangeAcquire(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeAcquire(1, Void.class);
+            int x = (int) vh.compareAndExchangeAcquire(0x01234567, Void.class);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeAcquire(1, 1);
+            Void r = (Void) vh.compareAndExchangeAcquire(0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeAcquire(1, 1);
+            boolean x = (boolean) vh.compareAndExchangeAcquire(0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeAcquire(1, 1, Void.class);
+            int x = (int) vh.compareAndExchangeAcquire(0x01234567, 0x01234567, Void.class);
         });
 
 
         // CompareAndExchangeRelease
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeRelease(Void.class, 1);
+            int x = (int) vh.compareAndExchangeRelease(Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeRelease(1, Void.class);
+            int x = (int) vh.compareAndExchangeRelease(0x01234567, Void.class);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeRelease(1, 1);
+            Void r = (Void) vh.compareAndExchangeRelease(0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeRelease(1, 1);
+            boolean x = (boolean) vh.compareAndExchangeRelease(0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeRelease(1, 1, Void.class);
+            int x = (int) vh.compareAndExchangeRelease(0x01234567, 0x01234567, Void.class);
         });
 
 
@@ -1130,17 +1130,17 @@
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndSet(1);
+            Void r = (Void) vh.getAndSet(0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndSet(1);
+            boolean x = (boolean) vh.getAndSet(0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.getAndSet(1, Void.class);
+            int x = (int) vh.getAndSet(0x01234567, Void.class);
         });
 
         // GetAndAdd
@@ -1150,17 +1150,17 @@
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndAdd(1);
+            Void r = (Void) vh.getAndAdd(0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndAdd(1);
+            boolean x = (boolean) vh.getAndAdd(0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.getAndAdd(1, Void.class);
+            int x = (int) vh.getAndAdd(0x01234567, Void.class);
         });
 
 
@@ -1171,17 +1171,17 @@
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.addAndGet(1);
+            Void r = (Void) vh.addAndGet(0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.addAndGet(1);
+            boolean x = (boolean) vh.addAndGet(0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.addAndGet(1, Void.class);
+            int x = (int) vh.addAndGet(0x01234567, Void.class);
         });
     }
 
@@ -1217,18 +1217,18 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, int.class, Class.class)).
-                    invokeExact(1, Void.class);
+                    invokeExact(0x01234567, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class)).
-                    invokeExact(Void.class, 1);
+                    invokeExact(Void.class, 0x01234567);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, Class.class)).
-                    invokeExact(1, Void.class);
+                    invokeExact(0x01234567, Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1237,7 +1237,7 @@
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, Class.class)).
-                    invokeExact(1, 1, Void.class);
+                    invokeExact(0x01234567, 0x01234567, Void.class);
             });
         }
 
@@ -1245,20 +1245,20 @@
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class)).
-                    invokeExact(Void.class, 1);
+                    invokeExact(Void.class, 0x01234567);
             });
             checkWMTE(() -> { // actual reference class
                 int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
-                    invokeExact(1, Void.class);
+                    invokeExact(0x01234567, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int.class, int.class)).
-                    invokeExact(1, 1);
+                    invokeExact(0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class)).
-                    invokeExact(1, 1);
+                    invokeExact(0x01234567, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1267,7 +1267,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, Class.class)).
-                    invokeExact(1, 1, Void.class);
+                    invokeExact(0x01234567, 0x01234567, Void.class);
             });
         }
 
@@ -1280,11 +1280,11 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
-                    invokeExact(1);
+                    invokeExact(0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
-                    invokeExact(1);
+                    invokeExact(0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1293,7 +1293,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
-                    invokeExact(1, Void.class);
+                    invokeExact(0x01234567, Void.class);
             });
         }
 
@@ -1306,11 +1306,11 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int.class)).
-                    invokeExact(1);
+                    invokeExact(0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int.class)).
-                    invokeExact(1);
+                    invokeExact(0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1319,7 +1319,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int.class, Class.class)).
-                    invokeExact(1, Void.class);
+                    invokeExact(0x01234567, Void.class);
             });
         }
     }
@@ -1327,7 +1327,7 @@
 
     static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
         int[] array = new int[10];
-        Arrays.fill(array, 1);
+        Arrays.fill(array, 0x01234567);
 
         // Get
         // Incorrect argument types
@@ -1362,26 +1362,26 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.set(null, 0, 1);
+            vh.set(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            vh.set(Void.class, 0, 1);
+            vh.set(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.set(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 0, 1);
+            vh.set(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            vh.set(array, Void.class, 1);
+            vh.set(array, Void.class, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(array, 0, 1, Void.class);
+            vh.set(array, 0, 0x01234567, Void.class);
         });
 
 
@@ -1418,26 +1418,26 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setVolatile(null, 0, 1);
+            vh.setVolatile(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            vh.setVolatile(Void.class, 0, 1);
+            vh.setVolatile(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 0, 1);
+            vh.setVolatile(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            vh.setVolatile(array, Void.class, 1);
+            vh.setVolatile(array, Void.class, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(array, 0, 1, Void.class);
+            vh.setVolatile(array, 0, 0x01234567, Void.class);
         });
 
 
@@ -1474,26 +1474,26 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setOpaque(null, 0, 1);
+            vh.setOpaque(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            vh.setOpaque(Void.class, 0, 1);
+            vh.setOpaque(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 0, 1);
+            vh.setOpaque(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            vh.setOpaque(array, Void.class, 1);
+            vh.setOpaque(array, Void.class, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(array, 0, 1, Void.class);
+            vh.setOpaque(array, 0, 0x01234567, Void.class);
         });
 
 
@@ -1530,383 +1530,383 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setRelease(null, 0, 1);
+            vh.setRelease(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            vh.setRelease(Void.class, 0, 1);
+            vh.setRelease(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 0, 1);
+            vh.setRelease(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            vh.setRelease(array, Void.class, 1);
+            vh.setRelease(array, Void.class, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(array, 0, 1, Void.class);
+            vh.setRelease(array, 0, 0x01234567, Void.class);
         });
 
 
         // CompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.compareAndSet(null, 0, 1, 1);
+            boolean r = vh.compareAndSet(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.compareAndSet(Void.class, 0, 1, 1);
+            boolean r = vh.compareAndSet(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.compareAndSet(array, 0, Void.class, 1);
+            boolean r = vh.compareAndSet(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.compareAndSet(array, 0, 1, Void.class);
+            boolean r = vh.compareAndSet(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.compareAndSet(0, 0, 1, 1);
+            boolean r = vh.compareAndSet(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.compareAndSet(array, Void.class, 1, 1);
+            boolean r = vh.compareAndSet(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.compareAndSet(array, 0, 1, 1, Void.class);
+            boolean r = vh.compareAndSet(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSet(null, 0, 1, 1);
+            boolean r = vh.weakCompareAndSet(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSet(Void.class, 0, 1, 1);
+            boolean r = vh.weakCompareAndSet(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSet(array, 0, Void.class, 1);
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSet(array, 0, 1, Void.class);
+            boolean r = vh.weakCompareAndSet(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSet(0, 0, 1, 1);
+            boolean r = vh.weakCompareAndSet(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSet(array, Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSet(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSet(array, 0, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSet(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetVolatile(null, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetVolatile(0, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetVolatile();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetAcquire(null, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 1);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetAcquire(0, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // WeakCompareAndSetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetRelease(null, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 1);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetRelease(array, 0, 1, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetRelease(0, 0, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSetRelease(array, Void.class, 1, 1);
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetRelease(array, 0, 1, 1, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.compareAndExchangeVolatile(null, 0, 1, 1);
+            int x = (int) vh.compareAndExchange(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            int x = (int) vh.compareAndExchangeVolatile(Void.class, 0, 1, 1);
+            int x = (int) vh.compareAndExchange(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeVolatile(array, 0, Void.class, 1);
+            int x = (int) vh.compareAndExchange(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeVolatile(array, 0, 1, Void.class);
+            int x = (int) vh.compareAndExchange(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            int x = (int) vh.compareAndExchangeVolatile(0, 0, 1, 1);
+            int x = (int) vh.compareAndExchange(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            int x = (int) vh.compareAndExchangeVolatile(array, Void.class, 1, 1);
+            int x = (int) vh.compareAndExchange(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 1, 1);
+            Void r = (Void) vh.compareAndExchange(array, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 1, 1);
+            boolean x = (boolean) vh.compareAndExchange(array, 0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            int x = (int) vh.compareAndExchangeVolatile();
+            int x = (int) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeVolatile(array, 0, 1, 1, Void.class);
+            int x = (int) vh.compareAndExchange(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // CompareAndExchangeAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.compareAndExchangeAcquire(null, 0, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            int x = (int) vh.compareAndExchangeAcquire(Void.class, 0, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeAcquire(array, 0, Void.class, 1);
+            int x = (int) vh.compareAndExchangeAcquire(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeAcquire(array, 0, 1, Void.class);
+            int x = (int) vh.compareAndExchangeAcquire(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            int x = (int) vh.compareAndExchangeAcquire(0, 0, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            int x = (int) vh.compareAndExchangeAcquire(array, Void.class, 1, 1);
+            int x = (int) vh.compareAndExchangeAcquire(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 1, 1);
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 1, 1);
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeAcquire(array, 0, 1, 1, Void.class);
+            int x = (int) vh.compareAndExchangeAcquire(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // CompareAndExchangeRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            int x = (int) vh.compareAndExchangeRelease(null, 0, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(null, 0, 0x01234567, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            int x = (int) vh.compareAndExchangeRelease(Void.class, 0, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(Void.class, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // expected reference class
-            int x = (int) vh.compareAndExchangeRelease(array, 0, Void.class, 1);
+            int x = (int) vh.compareAndExchangeRelease(array, 0, Void.class, 0x01234567);
         });
         checkWMTE(() -> { // actual reference class
-            int x = (int) vh.compareAndExchangeRelease(array, 0, 1, Void.class);
+            int x = (int) vh.compareAndExchangeRelease(array, 0, 0x01234567, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            int x = (int) vh.compareAndExchangeRelease(0, 0, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(0, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            int x = (int) vh.compareAndExchangeRelease(array, Void.class, 1, 1);
+            int x = (int) vh.compareAndExchangeRelease(array, Void.class, 0x01234567, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeRelease(array, 0, 1, 1);
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, 0x01234567, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 1, 1);
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 0x01234567, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.compareAndExchangeRelease(array, 0, 1, 1, Void.class);
+            int x = (int) vh.compareAndExchangeRelease(array, 0, 0x01234567, 0x01234567, Void.class);
         });
 
 
         // GetAndSet
         // Incorrect argument types
         checkNPE(() -> { // null array
-            int x = (int) vh.getAndSet(null, 0, 1);
+            int x = (int) vh.getAndSet(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            int x = (int) vh.getAndSet(Void.class, 0, 1);
+            int x = (int) vh.getAndSet(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             int x = (int) vh.getAndSet(array, 0, Void.class);
         });
         checkWMTE(() -> { // reciarrayever primitive class
-            int x = (int) vh.getAndSet(0, 0, 1);
+            int x = (int) vh.getAndSet(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            int x = (int) vh.getAndSet(array, Void.class, 1);
+            int x = (int) vh.getAndSet(array, Void.class, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndSet(array, 0, 1);
+            Void r = (Void) vh.getAndSet(array, 0, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndSet(array, 0, 1);
+            boolean x = (boolean) vh.getAndSet(array, 0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.getAndSet(array, 0, 1, Void.class);
+            int x = (int) vh.getAndSet(array, 0, 0x01234567, Void.class);
         });
 
         // GetAndAdd
         // Incorrect argument types
         checkNPE(() -> { // null array
-            int x = (int) vh.getAndAdd(null, 0, 1);
+            int x = (int) vh.getAndAdd(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            int x = (int) vh.getAndAdd(Void.class, 0, 1);
+            int x = (int) vh.getAndAdd(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             int x = (int) vh.getAndAdd(array, 0, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            int x = (int) vh.getAndAdd(0, 0, 1);
+            int x = (int) vh.getAndAdd(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            int x = (int) vh.getAndAdd(array, Void.class, 1);
+            int x = (int) vh.getAndAdd(array, Void.class, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndAdd(array, 0, 1);
+            Void r = (Void) vh.getAndAdd(array, 0, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndAdd(array, 0, 1);
+            boolean x = (boolean) vh.getAndAdd(array, 0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.getAndAdd(array, 0, 1, Void.class);
+            int x = (int) vh.getAndAdd(array, 0, 0x01234567, Void.class);
         });
 
 
         // AddAndGet
         // Incorrect argument types
         checkNPE(() -> { // null array
-            int x = (int) vh.addAndGet(null, 0, 1);
+            int x = (int) vh.addAndGet(null, 0, 0x01234567);
         });
         checkCCE(() -> { // array reference class
-            int x = (int) vh.addAndGet(Void.class, 0, 1);
+            int x = (int) vh.addAndGet(Void.class, 0, 0x01234567);
         });
         checkWMTE(() -> { // value reference class
             int x = (int) vh.addAndGet(array, 0, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            int x = (int) vh.addAndGet(0, 0, 1);
+            int x = (int) vh.addAndGet(0, 0, 0x01234567);
         });
         checkWMTE(() -> { // index reference class
-            int x = (int) vh.addAndGet(array, Void.class, 1);
+            int x = (int) vh.addAndGet(array, Void.class, 0x01234567);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.addAndGet(array, 0, 1);
+            Void r = (Void) vh.addAndGet(array, 0, 0x01234567);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.addAndGet(array, 0, 1);
+            boolean x = (boolean) vh.addAndGet(array, 0, 0x01234567);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             int x = (int) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            int x = (int) vh.addAndGet(array, 0, 1, Void.class);
+            int x = (int) vh.addAndGet(array, 0, 0x01234567, Void.class);
         });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
         int[] array = new int[10];
-        Arrays.fill(array, 1);
+        Arrays.fill(array, 0x01234567);
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
@@ -1950,11 +1950,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 hs.get(am, methodType(void.class, int[].class, int.class, int.class)).
-                    invokeExact((int[]) null, 0, 1);
+                    invokeExact((int[]) null, 0, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, int.class)).
-                    invokeExact(Void.class, 0, 1);
+                    invokeExact(Void.class, 0, 0x01234567);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, int[].class, int.class, Class.class)).
@@ -1962,11 +1962,11 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, int.class)).
-                    invokeExact(0, 0, 1);
+                    invokeExact(0, 0, 0x01234567);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, int[].class, Class.class, int.class)).
-                    invokeExact(array, Void.class, 1);
+                    invokeExact(array, Void.class, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1975,34 +1975,34 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, int[].class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class)).
-                    invokeExact((int[]) null, 0, 1, 1);
+                    invokeExact((int[]) null, 0, 0x01234567, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, int.class, int.class)).
-                    invokeExact(Void.class, 0, 1, 1);
+                    invokeExact(Void.class, 0, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, Class.class, int.class)).
-                    invokeExact(array, 0, Void.class, 1);
+                    invokeExact(array, 0, Void.class, 0x01234567);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, int.class, int.class)).
-                    invokeExact(0, 0, 1, 1);
+                    invokeExact(0, 0, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // index reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, Class.class, int.class, int.class)).
-                    invokeExact(array, Void.class, 1, 1);
+                    invokeExact(array, Void.class, 0x01234567, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2011,7 +2011,7 @@
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, 0x01234567, Void.class);
             });
         }
 
@@ -2019,36 +2019,36 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, int.class)).
-                    invokeExact((int[]) null, 0, 1, 1);
+                    invokeExact((int[]) null, 0, 0x01234567, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class, int.class)).
-                    invokeExact(Void.class, 0, 1, 1);
+                    invokeExact(Void.class, 0, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // expected reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class, int.class)).
-                    invokeExact(array, 0, Void.class, 1);
+                    invokeExact(array, 0, Void.class, 0x01234567);
             });
             checkWMTE(() -> { // actual reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class, int.class)).
-                    invokeExact(0, 0, 1, 1);
+                    invokeExact(0, 0, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class, int.class)).
-                    invokeExact(array, Void.class, 1, 1);
+                    invokeExact(array, Void.class, 0x01234567, 0x01234567);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class, int.class)).
-                    invokeExact(array, 0, 1, 1);
+                    invokeExact(array, 0, 0x01234567, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class, int.class)).
-                    invokeExact(array, 0, 1, 1);
+                    invokeExact(array, 0, 0x01234567, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2057,7 +2057,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, 0x01234567, Void.class);
             });
         }
 
@@ -2065,11 +2065,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class)).
-                    invokeExact((int[]) null, 0, 1);
+                    invokeExact((int[]) null, 0, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
-                    invokeExact(Void.class, 0, 1);
+                    invokeExact(Void.class, 0, 0x01234567);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
@@ -2077,20 +2077,20 @@
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
-                    invokeExact(0, 0, 1);
+                    invokeExact(0, 0, 0x01234567);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
-                    invokeExact(array, Void.class, 1);
+                    invokeExact(array, Void.class, 0x01234567);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
-                    invokeExact(array, 0, 1);
+                    invokeExact(array, 0, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
-                    invokeExact(array, 0, 1);
+                    invokeExact(array, 0, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2099,7 +2099,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, Void.class);
             });
         }
 
@@ -2107,11 +2107,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class)).
-                    invokeExact((int[]) null, 0, 1);
+                    invokeExact((int[]) null, 0, 0x01234567);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 int x = (int) hs.get(am, methodType(int.class, Class.class, int.class, int.class)).
-                    invokeExact(Void.class, 0, 1);
+                    invokeExact(Void.class, 0, 0x01234567);
             });
             checkWMTE(() -> { // value reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, Class.class)).
@@ -2119,20 +2119,20 @@
             });
             checkWMTE(() -> { // array primitive class
                 int x = (int) hs.get(am, methodType(int.class, int.class, int.class, int.class)).
-                    invokeExact(0, 0, 1);
+                    invokeExact(0, 0, 0x01234567);
             });
             checkWMTE(() -> { // index reference class
                 int x = (int) hs.get(am, methodType(int.class, int[].class, Class.class, int.class)).
-                    invokeExact(array, Void.class, 1);
+                    invokeExact(array, Void.class, 0x01234567);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, int[].class, int.class, int.class)).
-                    invokeExact(array, 0, 1);
+                    invokeExact(array, 0, 0x01234567);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, int[].class, int.class, int.class)).
-                    invokeExact(array, 0, 1);
+                    invokeExact(array, 0, 0x01234567);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2141,7 +2141,7 @@
             });
             checkWMTE(() -> { // >
                 int x = (int) hs.get(am, methodType(int.class, int[].class, int.class, int.class, Class.class)).
-                    invokeExact(array, 0, 1, Void.class);
+                    invokeExact(array, 0, 0x01234567, Void.class);
             });
         }
     }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeLong.java	Thu Jul 07 18:35:29 2016 +0000
@@ -43,13 +43,13 @@
 import static java.lang.invoke.MethodType.*;
 
 public class VarHandleTestMethodTypeLong extends VarHandleBaseTest {
-    static final long static_final_v = 1L;
+    static final long static_final_v = 0x0123456789ABCDEFL;
 
-    static long static_v = 1L;
+    static long static_v = 0x0123456789ABCDEFL;
 
-    final long final_v = 1L;
+    final long final_v = 0x0123456789ABCDEFL;
 
-    long v = 1L;
+    long v = 0x0123456789ABCDEFL;
 
     VarHandle vhFinalField;
 
@@ -154,23 +154,23 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.set(null, 1L);
+            vh.set(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            vh.set(Void.class, 1L);
+            vh.set(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.set(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 1L);
+            vh.set(0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(recv, 1L, Void.class);
+            vh.set(recv, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -204,23 +204,23 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setVolatile(null, 1L);
+            vh.setVolatile(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setVolatile(Void.class, 1L);
+            vh.setVolatile(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 1L);
+            vh.setVolatile(0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(recv, 1L, Void.class);
+            vh.setVolatile(recv, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -254,23 +254,23 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setOpaque(null, 1L);
+            vh.setOpaque(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setOpaque(Void.class, 1L);
+            vh.setOpaque(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 1L);
+            vh.setOpaque(0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(recv, 1L, Void.class);
+            vh.setOpaque(recv, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -304,341 +304,341 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setRelease(null, 1L);
+            vh.setRelease(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setRelease(Void.class, 1L);
+            vh.setRelease(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 1L);
+            vh.setRelease(0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(recv, 1L, Void.class);
+            vh.setRelease(recv, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.compareAndSet(null, 1L, 1L);
+            boolean r = vh.compareAndSet(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.compareAndSet(Void.class, 1L, 1L);
+            boolean r = vh.compareAndSet(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.compareAndSet(recv, Void.class, 1L);
+            boolean r = vh.compareAndSet(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.compareAndSet(recv, 1L, Void.class);
+            boolean r = vh.compareAndSet(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.compareAndSet(0, 1L, 1L);
+            boolean r = vh.compareAndSet(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.compareAndSet(recv, 1L, 1L, Void.class);
+            boolean r = vh.compareAndSet(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSet(null, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSet(Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSet(recv, Void.class, 1L);
+            boolean r = vh.weakCompareAndSet(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSet(recv, 1L, Void.class);
+            boolean r = vh.weakCompareAndSet(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSet(0, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSet(recv, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSet(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetVolatile(null, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetVolatile(0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetVolatile();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetVolatile(recv, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetAcquire(null, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetAcquire(0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetAcquire(recv, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetRelease(null, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetRelease(Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 1L);
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetRelease(recv, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetRelease(0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetRelease(recv, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.compareAndExchangeVolatile(null, 1L, 1L);
+            long x = (long) vh.compareAndExchange(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            long x = (long) vh.compareAndExchangeVolatile(Void.class, 1L, 1L);
+            long x = (long) vh.compareAndExchange(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeVolatile(recv, Void.class, 1L);
+            long x = (long) vh.compareAndExchange(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeVolatile(recv, 1L, Void.class);
+            long x = (long) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            long x = (long) vh.compareAndExchangeVolatile(0, 1L, 1L);
+            long x = (long) vh.compareAndExchange(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(recv, 1L, 1L);
+            Void r = (Void) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(recv, 1L, 1L);
+            boolean x = (boolean) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            long x = (long) vh.compareAndExchangeVolatile();
+            long x = (long) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeVolatile(recv, 1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchange(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
-        // CompareAndExchangeVolatileAcquire
+        // CompareAndExchangeAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.compareAndExchangeAcquire(null, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            long x = (long) vh.compareAndExchangeAcquire(Void.class, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeAcquire(recv, Void.class, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeAcquire(recv, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeAcquire(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            long x = (long) vh.compareAndExchangeAcquire(0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeAcquire(recv, 1L, 1L);
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 1L, 1L);
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeAcquire(recv, 1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeAcquire(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndExchangeRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.compareAndExchangeRelease(null, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            long x = (long) vh.compareAndExchangeRelease(Void.class, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeRelease(recv, Void.class, 1L);
+            long x = (long) vh.compareAndExchangeRelease(recv, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeRelease(recv, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeRelease(recv, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            long x = (long) vh.compareAndExchangeRelease(0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeRelease(recv, 1L, 1L);
+            Void r = (Void) vh.compareAndExchangeRelease(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeRelease(recv, 1L, 1L);
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeRelease(recv, 1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeRelease(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // GetAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.getAndSet(null, 1L);
+            long x = (long) vh.getAndSet(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            long x = (long) vh.getAndSet(Void.class, 1L);
+            long x = (long) vh.getAndSet(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             long x = (long) vh.getAndSet(recv, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            long x = (long) vh.getAndSet(0, 1L);
+            long x = (long) vh.getAndSet(0, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndSet(recv, 1L);
+            Void r = (Void) vh.getAndSet(recv, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndSet(recv, 1L);
+            boolean x = (boolean) vh.getAndSet(recv, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.getAndSet(recv, 1L, Void.class);
+            long x = (long) vh.getAndSet(recv, 0x0123456789ABCDEFL, Void.class);
         });
 
         // GetAndAdd
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.getAndAdd(null, 1L);
+            long x = (long) vh.getAndAdd(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            long x = (long) vh.getAndAdd(Void.class, 1L);
+            long x = (long) vh.getAndAdd(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             long x = (long) vh.getAndAdd(recv, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            long x = (long) vh.getAndAdd(0, 1L);
+            long x = (long) vh.getAndAdd(0, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndAdd(recv, 1L);
+            Void r = (Void) vh.getAndAdd(recv, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndAdd(recv, 1L);
+            boolean x = (boolean) vh.getAndAdd(recv, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.getAndAdd(recv, 1L, Void.class);
+            long x = (long) vh.getAndAdd(recv, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // AddAndGet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.addAndGet(null, 1L);
+            long x = (long) vh.addAndGet(null, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            long x = (long) vh.addAndGet(Void.class, 1L);
+            long x = (long) vh.addAndGet(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             long x = (long) vh.addAndGet(recv, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            long x = (long) vh.addAndGet(0, 1L);
+            long x = (long) vh.addAndGet(0, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.addAndGet(recv, 1L);
+            Void r = (Void) vh.addAndGet(recv, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.addAndGet(recv, 1L);
+            boolean x = (boolean) vh.addAndGet(recv, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.addAndGet(recv, 1L, Void.class);
+            long x = (long) vh.addAndGet(recv, 0x0123456789ABCDEFL, Void.class);
         });
     }
 
@@ -681,11 +681,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact((VarHandleTestMethodTypeLong) null, 1L);
+                    invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, long.class)).
-                    invokeExact(Void.class, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, Class.class)).
@@ -693,7 +693,7 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, long.class)).
-                    invokeExact(0, 1L);
+                    invokeExact(0, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -702,7 +702,7 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
-                    invokeExact(recv, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -710,23 +710,23 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, long.class)).
-                    invokeExact((VarHandleTestMethodTypeLong) null, 1L, 1L);
+                    invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, long.class, long.class)).
-                    invokeExact(Void.class, 1L, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, Class.class, long.class)).
-                    invokeExact(recv, Void.class, 1L);
+                    invokeExact(recv, Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
-                    invokeExact(recv, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , long.class, long.class)).
-                    invokeExact(0, 1L, 1L);
+                    invokeExact(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -735,39 +735,39 @@
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class, long.class, Class.class)).
-                    invokeExact(recv, 1L, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
             checkNPE(() -> { // null receiver
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, long.class)).
-                    invokeExact((VarHandleTestMethodTypeLong) null, 1L, 1L);
+                    invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class, long.class)).
-                    invokeExact(Void.class, 1L, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // expected reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class, long.class)).
-                    invokeExact(recv, Void.class, 1L);
+                    invokeExact(recv, Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // actual reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, Class.class)).
-                    invokeExact(recv, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
             });
             checkWMTE(() -> { // reciever primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class , long.class, long.class)).
-                    invokeExact(0, 1L, 1L);
+                    invokeExact(0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class , long.class, long.class)).
-                    invokeExact(recv, 1L, 1L);
+                    invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class , long.class, long.class)).
-                    invokeExact(recv, 1L, 1L);
+                    invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -776,18 +776,18 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class, long.class, Class.class)).
-                    invokeExact(recv, 1L, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
             checkNPE(() -> { // null receiver
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact((VarHandleTestMethodTypeLong) null, 1L);
+                    invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
-                    invokeExact(Void.class, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
@@ -795,16 +795,16 @@
             });
             checkWMTE(() -> { // reciever primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
-                    invokeExact(0, 1L);
+                    invokeExact(0, 0x0123456789ABCDEFL);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact(recv, 1L);
+                    invokeExact(recv, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact(recv, 1L);
+                    invokeExact(recv, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -813,18 +813,18 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact(recv, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
             checkNPE(() -> { // null receiver
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact((VarHandleTestMethodTypeLong) null, 1L);
+                    invokeExact((VarHandleTestMethodTypeLong) null, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
-                    invokeExact(Void.class, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, Class.class)).
@@ -832,16 +832,16 @@
             });
             checkWMTE(() -> { // reciever primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, long.class)).
-                    invokeExact(0, 1L);
+                    invokeExact(0, 0x0123456789ABCDEFL);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact(recv, 1L);
+                    invokeExact(recv, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact(recv, 1L);
+                    invokeExact(recv, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -850,7 +850,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, VarHandleTestMethodTypeLong.class, long.class)).
-                    invokeExact(recv, 1L, Void.class);
+                    invokeExact(recv, 0x0123456789ABCDEFL, Void.class);
             });
         }
     }
@@ -881,7 +881,7 @@
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(1L, Void.class);
+            vh.set(0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -908,7 +908,7 @@
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(1L, Void.class);
+            vh.setVolatile(0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -935,7 +935,7 @@
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(1L, Void.class);
+            vh.setOpaque(0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -962,164 +962,164 @@
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(1L, Void.class);
+            vh.setRelease(0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndSet
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.compareAndSet(Void.class, 1L);
+            boolean r = vh.compareAndSet(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.compareAndSet(1L, Void.class);
+            boolean r = vh.compareAndSet(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.compareAndSet(1L, 1L, Void.class);
+            boolean r = vh.compareAndSet(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSet
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSet(Void.class, 1L);
+            boolean r = vh.weakCompareAndSet(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSet(1L, Void.class);
+            boolean r = vh.weakCompareAndSet(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSet(1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSet(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetVolatile
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetVolatile(Void.class, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetVolatile(1L, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetVolatile();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetVolatile(1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetAcquire
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetAcquire(Void.class, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetAcquire(1L, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetAcquire(1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetRelease
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetRelease(Void.class, 1L);
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetRelease(1L, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetRelease(1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeVolatile(Void.class, 1L);
+            long x = (long) vh.compareAndExchange(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeVolatile(1L, Void.class);
+            long x = (long) vh.compareAndExchange(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(1L, 1L);
+            Void r = (Void) vh.compareAndExchange(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(1L, 1L);
+            boolean x = (boolean) vh.compareAndExchange(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            long x = (long) vh.compareAndExchangeVolatile();
+            long x = (long) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeVolatile(1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchange(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndExchangeAcquire
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeAcquire(Void.class, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeAcquire(1L, Void.class);
+            long x = (long) vh.compareAndExchangeAcquire(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeAcquire(1L, 1L);
+            Void r = (Void) vh.compareAndExchangeAcquire(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeAcquire(1L, 1L);
+            boolean x = (boolean) vh.compareAndExchangeAcquire(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeAcquire(1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeAcquire(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndExchangeRelease
         // Incorrect argument types
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeRelease(Void.class, 1L);
+            long x = (long) vh.compareAndExchangeRelease(Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeRelease(1L, Void.class);
+            long x = (long) vh.compareAndExchangeRelease(0x0123456789ABCDEFL, Void.class);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeRelease(1L, 1L);
+            Void r = (Void) vh.compareAndExchangeRelease(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeRelease(1L, 1L);
+            boolean x = (boolean) vh.compareAndExchangeRelease(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeRelease(1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeRelease(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -1130,17 +1130,17 @@
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndSet(1L);
+            Void r = (Void) vh.getAndSet(0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndSet(1L);
+            boolean x = (boolean) vh.getAndSet(0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.getAndSet(1L, Void.class);
+            long x = (long) vh.getAndSet(0x0123456789ABCDEFL, Void.class);
         });
 
         // GetAndAdd
@@ -1150,17 +1150,17 @@
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndAdd(1L);
+            Void r = (Void) vh.getAndAdd(0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndAdd(1L);
+            boolean x = (boolean) vh.getAndAdd(0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.getAndAdd(1L, Void.class);
+            long x = (long) vh.getAndAdd(0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -1171,17 +1171,17 @@
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.addAndGet(1L);
+            Void r = (Void) vh.addAndGet(0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.addAndGet(1L);
+            boolean x = (boolean) vh.addAndGet(0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.addAndGet(1L, Void.class);
+            long x = (long) vh.addAndGet(0x0123456789ABCDEFL, Void.class);
         });
     }
 
@@ -1217,18 +1217,18 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, long.class, Class.class)).
-                    invokeExact(1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, long.class)).
-                    invokeExact(Void.class, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long.class, Class.class)).
-                    invokeExact(1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, Void.class);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1237,7 +1237,7 @@
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long.class, long.class, Class.class)).
-                    invokeExact(1L, 1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -1245,20 +1245,20 @@
             // Incorrect argument types
             checkWMTE(() -> { // expected reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, long.class)).
-                    invokeExact(Void.class, 1L);
+                    invokeExact(Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // actual reference class
                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
-                    invokeExact(1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, Void.class);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long.class, long.class)).
-                    invokeExact(1L, 1L);
+                    invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class, long.class)).
-                    invokeExact(1L, 1L);
+                    invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1267,7 +1267,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long.class, long.class, Class.class)).
-                    invokeExact(1L, 1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -1280,11 +1280,11 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
-                    invokeExact(1L);
+                    invokeExact(0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
-                    invokeExact(1L);
+                    invokeExact(0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1293,7 +1293,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
-                    invokeExact(1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -1306,11 +1306,11 @@
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long.class)).
-                    invokeExact(1L);
+                    invokeExact(0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long.class)).
-                    invokeExact(1L);
+                    invokeExact(0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1319,7 +1319,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long.class, Class.class)).
-                    invokeExact(1L, Void.class);
+                    invokeExact(0x0123456789ABCDEFL, Void.class);
             });
         }
     }
@@ -1327,7 +1327,7 @@
 
     static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
         long[] array = new long[10];
-        Arrays.fill(array, 1L);
+        Arrays.fill(array, 0x0123456789ABCDEFL);
 
         // Get
         // Incorrect argument types
@@ -1362,26 +1362,26 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.set(null, 0, 1L);
+            vh.set(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            vh.set(Void.class, 0, 1L);
+            vh.set(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.set(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 0, 1L);
+            vh.set(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            vh.set(array, Void.class, 1L);
+            vh.set(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(array, 0, 1L, Void.class);
+            vh.set(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -1418,26 +1418,26 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setVolatile(null, 0, 1L);
+            vh.setVolatile(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            vh.setVolatile(Void.class, 0, 1L);
+            vh.setVolatile(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 0, 1L);
+            vh.setVolatile(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            vh.setVolatile(array, Void.class, 1L);
+            vh.setVolatile(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(array, 0, 1L, Void.class);
+            vh.setVolatile(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -1474,26 +1474,26 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setOpaque(null, 0, 1L);
+            vh.setOpaque(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            vh.setOpaque(Void.class, 0, 1L);
+            vh.setOpaque(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 0, 1L);
+            vh.setOpaque(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            vh.setOpaque(array, Void.class, 1L);
+            vh.setOpaque(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(array, 0, 1L, Void.class);
+            vh.setOpaque(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
 
 
@@ -1530,383 +1530,383 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setRelease(null, 0, 1L);
+            vh.setRelease(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            vh.setRelease(Void.class, 0, 1L);
+            vh.setRelease(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 0, 1L);
+            vh.setRelease(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            vh.setRelease(array, Void.class, 1L);
+            vh.setRelease(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(array, 0, 1L, Void.class);
+            vh.setRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.compareAndSet(null, 0, 1L, 1L);
+            boolean r = vh.compareAndSet(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.compareAndSet(Void.class, 0, 1L, 1L);
+            boolean r = vh.compareAndSet(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.compareAndSet(array, 0, Void.class, 1L);
+            boolean r = vh.compareAndSet(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.compareAndSet(array, 0, 1L, Void.class);
+            boolean r = vh.compareAndSet(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.compareAndSet(0, 0, 1L, 1L);
+            boolean r = vh.compareAndSet(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.compareAndSet(array, Void.class, 1L, 1L);
+            boolean r = vh.compareAndSet(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.compareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.compareAndSet(array, 0, 1L, 1L, Void.class);
+            boolean r = vh.compareAndSet(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSet
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSet(null, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSet(Void.class, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSet(array, 0, Void.class, 1L);
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSet(array, 0, 1L, Void.class);
+            boolean r = vh.weakCompareAndSet(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSet(0, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSet(array, Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSet(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSet();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSet(array, 0, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSet(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetVolatile(null, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetVolatile(0, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetVolatile();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetVolatile(array, 0, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetAcquire(null, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetAcquire(0, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetAcquire();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetAcquire(array, 0, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // WeakCompareAndSetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            boolean r = vh.weakCompareAndSetRelease(null, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // receiver reference class
-            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 1L);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            boolean r = vh.weakCompareAndSetRelease(array, 0, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            boolean r = vh.weakCompareAndSetRelease(0, 0, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            boolean r = vh.weakCompareAndSetRelease(array, Void.class, 1L, 1L);
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             boolean r = vh.weakCompareAndSetRelease();
         });
         checkWMTE(() -> { // >
-            boolean r = vh.weakCompareAndSetRelease(array, 0, 1L, 1L, Void.class);
+            boolean r = vh.weakCompareAndSetRelease(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.compareAndExchangeVolatile(null, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchange(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            long x = (long) vh.compareAndExchangeVolatile(Void.class, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchange(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeVolatile(array, 0, Void.class, 1L);
+            long x = (long) vh.compareAndExchange(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeVolatile(array, 0, 1L, Void.class);
+            long x = (long) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            long x = (long) vh.compareAndExchangeVolatile(0, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchange(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            long x = (long) vh.compareAndExchangeVolatile(array, Void.class, 1L, 1L);
+            long x = (long) vh.compareAndExchange(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(array, 0, 1L, 1L);
+            Void r = (Void) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, 1L, 1L);
+            boolean x = (boolean) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            long x = (long) vh.compareAndExchangeVolatile();
+            long x = (long) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeVolatile(array, 0, 1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchange(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndExchangeAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.compareAndExchangeAcquire(null, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            long x = (long) vh.compareAndExchangeAcquire(Void.class, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeAcquire(array, 0, Void.class, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeAcquire(array, 0, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeAcquire(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            long x = (long) vh.compareAndExchangeAcquire(0, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            long x = (long) vh.compareAndExchangeAcquire(array, Void.class, 1L, 1L);
+            long x = (long) vh.compareAndExchangeAcquire(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 1L, 1L);
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 1L, 1L);
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.compareAndExchangeAcquire();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeAcquire(array, 0, 1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeAcquire(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // CompareAndExchangeRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            long x = (long) vh.compareAndExchangeRelease(null, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            long x = (long) vh.compareAndExchangeRelease(Void.class, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // expected reference class
-            long x = (long) vh.compareAndExchangeRelease(array, 0, Void.class, 1L);
+            long x = (long) vh.compareAndExchangeRelease(array, 0, Void.class, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // actual reference class
-            long x = (long) vh.compareAndExchangeRelease(array, 0, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeRelease(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            long x = (long) vh.compareAndExchangeRelease(0, 0, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            long x = (long) vh.compareAndExchangeRelease(array, Void.class, 1L, 1L);
+            long x = (long) vh.compareAndExchangeRelease(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeRelease(array, 0, 1L, 1L);
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 1L, 1L);
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.compareAndExchangeRelease();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.compareAndExchangeRelease(array, 0, 1L, 1L, Void.class);
+            long x = (long) vh.compareAndExchangeRelease(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // GetAndSet
         // Incorrect argument types
         checkNPE(() -> { // null array
-            long x = (long) vh.getAndSet(null, 0, 1L);
+            long x = (long) vh.getAndSet(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            long x = (long) vh.getAndSet(Void.class, 0, 1L);
+            long x = (long) vh.getAndSet(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             long x = (long) vh.getAndSet(array, 0, Void.class);
         });
         checkWMTE(() -> { // reciarrayever primitive class
-            long x = (long) vh.getAndSet(0, 0, 1L);
+            long x = (long) vh.getAndSet(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            long x = (long) vh.getAndSet(array, Void.class, 1L);
+            long x = (long) vh.getAndSet(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndSet(array, 0, 1L);
+            Void r = (Void) vh.getAndSet(array, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndSet(array, 0, 1L);
+            boolean x = (boolean) vh.getAndSet(array, 0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.getAndSet();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.getAndSet(array, 0, 1L, Void.class);
+            long x = (long) vh.getAndSet(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
 
         // GetAndAdd
         // Incorrect argument types
         checkNPE(() -> { // null array
-            long x = (long) vh.getAndAdd(null, 0, 1L);
+            long x = (long) vh.getAndAdd(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            long x = (long) vh.getAndAdd(Void.class, 0, 1L);
+            long x = (long) vh.getAndAdd(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             long x = (long) vh.getAndAdd(array, 0, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            long x = (long) vh.getAndAdd(0, 0, 1L);
+            long x = (long) vh.getAndAdd(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            long x = (long) vh.getAndAdd(array, Void.class, 1L);
+            long x = (long) vh.getAndAdd(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.getAndAdd(array, 0, 1L);
+            Void r = (Void) vh.getAndAdd(array, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.getAndAdd(array, 0, 1L);
+            boolean x = (boolean) vh.getAndAdd(array, 0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.getAndAdd();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.getAndAdd(array, 0, 1L, Void.class);
+            long x = (long) vh.getAndAdd(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
 
 
         // AddAndGet
         // Incorrect argument types
         checkNPE(() -> { // null array
-            long x = (long) vh.addAndGet(null, 0, 1L);
+            long x = (long) vh.addAndGet(null, 0, 0x0123456789ABCDEFL);
         });
         checkCCE(() -> { // array reference class
-            long x = (long) vh.addAndGet(Void.class, 0, 1L);
+            long x = (long) vh.addAndGet(Void.class, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // value reference class
             long x = (long) vh.addAndGet(array, 0, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            long x = (long) vh.addAndGet(0, 0, 1L);
+            long x = (long) vh.addAndGet(0, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // index reference class
-            long x = (long) vh.addAndGet(array, Void.class, 1L);
+            long x = (long) vh.addAndGet(array, Void.class, 0x0123456789ABCDEFL);
         });
         // Incorrect return type
         checkWMTE(() -> { // reference class
-            Void r = (Void) vh.addAndGet(array, 0, 1L);
+            Void r = (Void) vh.addAndGet(array, 0, 0x0123456789ABCDEFL);
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.addAndGet(array, 0, 1L);
+            boolean x = (boolean) vh.addAndGet(array, 0, 0x0123456789ABCDEFL);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             long x = (long) vh.addAndGet();
         });
         checkWMTE(() -> { // >
-            long x = (long) vh.addAndGet(array, 0, 1L, Void.class);
+            long x = (long) vh.addAndGet(array, 0, 0x0123456789ABCDEFL, Void.class);
         });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
         long[] array = new long[10];
-        Arrays.fill(array, 1L);
+        Arrays.fill(array, 0x0123456789ABCDEFL);
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
@@ -1950,11 +1950,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 hs.get(am, methodType(void.class, long[].class, int.class, long.class)).
-                    invokeExact((long[]) null, 0, 1L);
+                    invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, long.class)).
-                    invokeExact(Void.class, 0, 1L);
+                    invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, long[].class, int.class, Class.class)).
@@ -1962,11 +1962,11 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, long.class)).
-                    invokeExact(0, 0, 1L);
+                    invokeExact(0, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, long[].class, Class.class, long.class)).
-                    invokeExact(array, Void.class, 1L);
+                    invokeExact(array, Void.class, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -1975,34 +1975,34 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, long[].class, int.class, Class.class)).
-                    invokeExact(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
             });
         }
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class)).
-                    invokeExact((long[]) null, 0, 1L, 1L);
+                    invokeExact((long[]) null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, long.class, long.class)).
-                    invokeExact(Void.class, 0, 1L, 1L);
+                    invokeExact(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // expected reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, Class.class, long.class)).
-                    invokeExact(array, 0, Void.class, 1L);
+                    invokeExact(array, 0, Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // actual reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, Class.class)).
-                    invokeExact(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
             });
             checkWMTE(() -> { // receiver primitive class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, long.class, long.class)).
-                    invokeExact(0, 0, 1L, 1L);
+                    invokeExact(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // index reference class
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, Class.class, long.class, long.class)).
-                    invokeExact(array, Void.class, 1L, 1L);
+                    invokeExact(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2011,7 +2011,7 @@
             });
             checkWMTE(() -> { // >
                 boolean r = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class, Class.class)).
-                    invokeExact(array, 0, 1L, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -2019,36 +2019,36 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, long.class)).
-                    invokeExact((long[]) null, 0, 1L, 1L);
+                    invokeExact((long[]) null, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class, long.class)).
-                    invokeExact(Void.class, 0, 1L, 1L);
+                    invokeExact(Void.class, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // expected reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class, long.class)).
-                    invokeExact(array, 0, Void.class, 1L);
+                    invokeExact(array, 0, Void.class, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // actual reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
-                    invokeExact(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class, long.class)).
-                    invokeExact(0, 0, 1L, 1L);
+                    invokeExact(0, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class, long.class)).
-                    invokeExact(array, Void.class, 1L, 1L);
+                    invokeExact(array, Void.class, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class, long.class)).
-                    invokeExact(array, 0, 1L, 1L);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class, long.class)).
-                    invokeExact(array, 0, 1L, 1L);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2057,7 +2057,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, long.class, Class.class)).
-                    invokeExact(array, 0, 1L, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -2065,11 +2065,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
-                    invokeExact((long[]) null, 0, 1L);
+                    invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
-                    invokeExact(Void.class, 0, 1L);
+                    invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
@@ -2077,20 +2077,20 @@
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
-                    invokeExact(0, 0, 1L);
+                    invokeExact(0, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
-                    invokeExact(array, Void.class, 1L);
+                    invokeExact(array, Void.class, 0x0123456789ABCDEFL);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
-                    invokeExact(array, 0, 1L);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
-                    invokeExact(array, 0, 1L);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2099,7 +2099,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
-                    invokeExact(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
             });
         }
 
@@ -2107,11 +2107,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class)).
-                    invokeExact((long[]) null, 0, 1L);
+                    invokeExact((long[]) null, 0, 0x0123456789ABCDEFL);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 long x = (long) hs.get(am, methodType(long.class, Class.class, int.class, long.class)).
-                    invokeExact(Void.class, 0, 1L);
+                    invokeExact(Void.class, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // value reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, Class.class)).
@@ -2119,20 +2119,20 @@
             });
             checkWMTE(() -> { // array primitive class
                 long x = (long) hs.get(am, methodType(long.class, int.class, int.class, long.class)).
-                    invokeExact(0, 0, 1L);
+                    invokeExact(0, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // index reference class
                 long x = (long) hs.get(am, methodType(long.class, long[].class, Class.class, long.class)).
-                    invokeExact(array, Void.class, 1L);
+                    invokeExact(array, Void.class, 0x0123456789ABCDEFL);
             });
             // Incorrect return type
             checkWMTE(() -> { // reference class
                 Void r = (Void) hs.get(am, methodType(Void.class, long[].class, int.class, long.class)).
-                    invokeExact(array, 0, 1L);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL);
             });
             checkWMTE(() -> { // primitive class
                 boolean x = (boolean) hs.get(am, methodType(boolean.class, long[].class, int.class, long.class)).
-                    invokeExact(array, 0, 1L);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -2141,7 +2141,7 @@
             });
             checkWMTE(() -> { // >
                 long x = (long) hs.get(am, methodType(long.class, long[].class, int.class, long.class, Class.class)).
-                    invokeExact(array, 0, 1L, Void.class);
+                    invokeExact(array, 0, 0x0123456789ABCDEFL, Void.class);
             });
         }
     }
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeShort.java	Thu Jul 07 18:35:29 2016 +0000
@@ -43,13 +43,13 @@
 import static java.lang.invoke.MethodType.*;
 
 public class VarHandleTestMethodTypeShort extends VarHandleBaseTest {
-    static final short static_final_v = (short)1;
+    static final short static_final_v = (short)0x0123;
 
-    static short static_v = (short)1;
+    static short static_v = (short)0x0123;
 
-    final short final_v = (short)1;
+    final short final_v = (short)0x0123;
 
-    short v = (short)1;
+    short v = (short)0x0123;
 
     VarHandle vhFinalField;
 
@@ -154,23 +154,23 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.set(null, (short)1);
+            vh.set(null, (short)0x0123);
         });
         checkCCE(() -> { // receiver reference class
-            vh.set(Void.class, (short)1);
+            vh.set(Void.class, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.set(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, (short)1);
+            vh.set(0, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(recv, (short)1, Void.class);
+            vh.set(recv, (short)0x0123, Void.class);
         });
 
 
@@ -204,23 +204,23 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setVolatile(null, (short)1);
+            vh.setVolatile(null, (short)0x0123);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setVolatile(Void.class, (short)1);
+            vh.setVolatile(Void.class, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, (short)1);
+            vh.setVolatile(0, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(recv, (short)1, Void.class);
+            vh.setVolatile(recv, (short)0x0123, Void.class);
         });
 
 
@@ -254,23 +254,23 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setOpaque(null, (short)1);
+            vh.setOpaque(null, (short)0x0123);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setOpaque(Void.class, (short)1);
+            vh.setOpaque(Void.class, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, (short)1);
+            vh.setOpaque(0, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(recv, (short)1, Void.class);
+            vh.setOpaque(recv, (short)0x0123, Void.class);
         });
 
 
@@ -304,27 +304,342 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            vh.setRelease(null, (short)1);
+            vh.setRelease(null, (short)0x0123);
         });
         checkCCE(() -> { // receiver reference class
-            vh.setRelease(Void.class, (short)1);
+            vh.setRelease(Void.class, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(recv, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, (short)1);
+            vh.setRelease(0, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(recv, (short)1, Void.class);
+            vh.setRelease(recv, (short)0x0123, Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(recv, (short)0x0123, (short)0x0123, Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.compareAndExchange(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            short x = (short) vh.compareAndExchange(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchange(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchange(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            short x = (short) vh.compareAndExchange(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchange(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.compareAndExchangeAcquire(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            short x = (short) vh.compareAndExchangeAcquire(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchangeAcquire(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchangeAcquire(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            short x = (short) vh.compareAndExchangeAcquire(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.compareAndExchangeRelease(null, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            short x = (short) vh.compareAndExchangeRelease(Void.class, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchangeRelease(recv, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchangeRelease(recv, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            short x = (short) vh.compareAndExchangeRelease(0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(recv, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(recv, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchangeRelease(recv, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.getAndSet(null, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            short x = (short) vh.getAndSet(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.getAndSet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            short x = (short) vh.getAndSet(0, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(recv, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(recv, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.getAndSet(recv, (short)0x0123, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.getAndAdd(null, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            short x = (short) vh.getAndAdd(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.getAndAdd(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            short x = (short) vh.getAndAdd(0, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(recv, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(recv, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.getAndAdd(recv, (short)0x0123, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.addAndGet(null, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            short x = (short) vh.addAndGet(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.addAndGet(recv, Void.class);
+        });
+        checkWMTE(() -> { // reciever primitive class
+            short x = (short) vh.addAndGet(0, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(recv, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(recv, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.addAndGet(recv, (short)0x0123, Void.class);
+        });
     }
 
     static void testInstanceFieldWrongMethodType(VarHandleTestMethodTypeShort recv, Handles hs) throws Throwable {
@@ -366,11 +681,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null receiver
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeShort.class, short.class)).
-                    invokeExact((VarHandleTestMethodTypeShort) null, (short)1);
+                    invokeExact((VarHandleTestMethodTypeShort) null, (short)0x0123);
             });
             hs.checkWMTEOrCCE(() -> { // receiver reference class
                 hs.get(am, methodType(void.class, Class.class, short.class)).
-                    invokeExact(Void.class, (short)1);
+                    invokeExact(Void.class, (short)0x0123);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeShort.class, Class.class)).
@@ -378,7 +693,7 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, short.class)).
-                    invokeExact(0, (short)1);
+                    invokeExact(0, (short)0x0123);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -387,11 +702,157 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, VarHandleTestMethodTypeShort.class, short.class, Class.class)).
-                    invokeExact(recv, (short)1, Void.class);
+                    invokeExact(recv, (short)0x0123, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, short.class, short.class)).
+                    invokeExact((VarHandleTestMethodTypeShort) null, (short)0x0123, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, short.class, short.class)).
+                    invokeExact(Void.class, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, Class.class, short.class)).
+                    invokeExact(recv, Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, short.class, Class.class)).
+                    invokeExact(recv, (short)0x0123, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , short.class, short.class)).
+                    invokeExact(0, (short)0x0123, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, short.class, short.class, Class.class)).
+                    invokeExact(recv, (short)0x0123, (short)0x0123, Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            checkNPE(() -> { // null receiver
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class, short.class)).
+                    invokeExact((VarHandleTestMethodTypeShort) null, (short)0x0123, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, short.class, short.class)).
+                    invokeExact(Void.class, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // expected reference class
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, Class.class, short.class)).
+                    invokeExact(recv, Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // actual reference class
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class, Class.class)).
+                    invokeExact(recv, (short)0x0123, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                short x = (short) hs.get(am, methodType(short.class, int.class , short.class, short.class)).
+                    invokeExact(0, (short)0x0123, (short)0x0123);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeShort.class , short.class, short.class)).
+                    invokeExact(recv, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class , short.class, short.class)).
+                    invokeExact(recv, (short)0x0123, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class, short.class, Class.class)).
+                    invokeExact(recv, (short)0x0123, (short)0x0123, Void.class);
+            });
+        }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            checkNPE(() -> { // null receiver
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact((VarHandleTestMethodTypeShort) null, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, short.class)).
+                    invokeExact(Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // value reference class
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                short x = (short) hs.get(am, methodType(short.class, int.class, short.class)).
+                    invokeExact(0, (short)0x0123);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact(recv, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact(recv, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact(recv, (short)0x0123, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            checkNPE(() -> { // null receiver
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact((VarHandleTestMethodTypeShort) null, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, short.class)).
+                    invokeExact(Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // value reference class
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, Class.class)).
+                    invokeExact(recv, Void.class);
+            });
+            checkWMTE(() -> { // reciever primitive class
+                short x = (short) hs.get(am, methodType(short.class, int.class, short.class)).
+                    invokeExact(0, (short)0x0123);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact(recv, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact(recv, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, VarHandleTestMethodTypeShort.class, short.class)).
+                    invokeExact(recv, (short)0x0123, Void.class);
+            });
+        }
     }
 
 
@@ -420,7 +881,7 @@
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set((short)1, Void.class);
+            vh.set((short)0x0123, Void.class);
         });
 
 
@@ -447,7 +908,7 @@
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile((short)1, Void.class);
+            vh.setVolatile((short)0x0123, Void.class);
         });
 
 
@@ -474,7 +935,7 @@
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque((short)1, Void.class);
+            vh.setOpaque((short)0x0123, Void.class);
         });
 
 
@@ -501,11 +962,227 @@
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease((short)1, Void.class);
+            vh.setRelease((short)0x0123, Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet((short)0x0123, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet((short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet((short)0x0123, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet((short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile((short)0x0123, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile((short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire((short)0x0123, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire((short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease((short)0x0123, Void.class);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease((short)0x0123, (short)0x0123, Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchange(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchange((short)0x0123, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange((short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange((short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchange((short)0x0123, (short)0x0123, Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchangeAcquire(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchangeAcquire((short)0x0123, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire((short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire((short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchangeAcquire((short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchangeRelease(Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchangeRelease((short)0x0123, Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease((short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease((short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchangeRelease((short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.getAndSet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet((short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet((short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.getAndSet((short)0x0123, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.getAndAdd(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd((short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd((short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.getAndAdd((short)0x0123, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.addAndGet(Void.class);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet((short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet((short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.addAndGet((short)0x0123, Void.class);
+        });
     }
 
     static void testStaticFieldWrongMethodType(Handles hs) throws Throwable {
@@ -540,16 +1217,117 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, short.class, Class.class)).
-                    invokeExact((short)1, Void.class);
+                    invokeExact((short)0x0123, Void.class);
+            });
+        }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, short.class)).
+                    invokeExact(Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short.class, Class.class)).
+                    invokeExact((short)0x0123, Void.class);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short.class, short.class, Class.class)).
+                    invokeExact((short)0x0123, (short)0x0123, Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // expected reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, short.class)).
+                    invokeExact(Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // actual reference class
+                short x = (short) hs.get(am, methodType(short.class, short.class, Class.class)).
+                    invokeExact((short)0x0123, Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, short.class, short.class)).
+                    invokeExact((short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, short.class, short.class)).
+                    invokeExact((short)0x0123, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, short.class, short.class, Class.class)).
+                    invokeExact((short)0x0123, (short)0x0123, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, short.class)).
+                    invokeExact((short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, short.class)).
+                    invokeExact((short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, short.class, Class.class)).
+                    invokeExact((short)0x0123, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkWMTE(() -> { // value reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class)).
+                    invokeExact(Void.class);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, short.class)).
+                    invokeExact((short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, short.class)).
+                    invokeExact((short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, short.class, Class.class)).
+                    invokeExact((short)0x0123, Void.class);
+            });
+        }
     }
 
 
     static void testArrayWrongMethodType(VarHandle vh) throws Throwable {
         short[] array = new short[10];
-        Arrays.fill(array, (short)1);
+        Arrays.fill(array, (short)0x0123);
 
         // Get
         // Incorrect argument types
@@ -584,26 +1362,26 @@
         // Set
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.set(null, 0, (short)1);
+            vh.set(null, 0, (short)0x0123);
         });
         checkCCE(() -> { // array reference class
-            vh.set(Void.class, 0, (short)1);
+            vh.set(Void.class, 0, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.set(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.set(0, 0, (short)1);
+            vh.set(0, 0, (short)0x0123);
         });
         checkWMTE(() -> { // index reference class
-            vh.set(array, Void.class, (short)1);
+            vh.set(array, Void.class, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.set();
         });
         checkWMTE(() -> { // >
-            vh.set(array, 0, (short)1, Void.class);
+            vh.set(array, 0, (short)0x0123, Void.class);
         });
 
 
@@ -640,26 +1418,26 @@
         // SetVolatile
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setVolatile(null, 0, (short)1);
+            vh.setVolatile(null, 0, (short)0x0123);
         });
         checkCCE(() -> { // array reference class
-            vh.setVolatile(Void.class, 0, (short)1);
+            vh.setVolatile(Void.class, 0, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.setVolatile(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setVolatile(0, 0, (short)1);
+            vh.setVolatile(0, 0, (short)0x0123);
         });
         checkWMTE(() -> { // index reference class
-            vh.setVolatile(array, Void.class, (short)1);
+            vh.setVolatile(array, Void.class, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setVolatile();
         });
         checkWMTE(() -> { // >
-            vh.setVolatile(array, 0, (short)1, Void.class);
+            vh.setVolatile(array, 0, (short)0x0123, Void.class);
         });
 
 
@@ -696,26 +1474,26 @@
         // SetOpaque
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setOpaque(null, 0, (short)1);
+            vh.setOpaque(null, 0, (short)0x0123);
         });
         checkCCE(() -> { // array reference class
-            vh.setOpaque(Void.class, 0, (short)1);
+            vh.setOpaque(Void.class, 0, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.setOpaque(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setOpaque(0, 0, (short)1);
+            vh.setOpaque(0, 0, (short)0x0123);
         });
         checkWMTE(() -> { // index reference class
-            vh.setOpaque(array, Void.class, (short)1);
+            vh.setOpaque(array, Void.class, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setOpaque();
         });
         checkWMTE(() -> { // >
-            vh.setOpaque(array, 0, (short)1, Void.class);
+            vh.setOpaque(array, 0, (short)0x0123, Void.class);
         });
 
 
@@ -752,35 +1530,383 @@
         // SetRelease
         // Incorrect argument types
         checkNPE(() -> { // null array
-            vh.setRelease(null, 0, (short)1);
+            vh.setRelease(null, 0, (short)0x0123);
         });
         checkCCE(() -> { // array reference class
-            vh.setRelease(Void.class, 0, (short)1);
+            vh.setRelease(Void.class, 0, (short)0x0123);
         });
         checkWMTE(() -> { // value reference class
             vh.setRelease(array, 0, Void.class);
         });
         checkWMTE(() -> { // receiver primitive class
-            vh.setRelease(0, 0, (short)1);
+            vh.setRelease(0, 0, (short)0x0123);
         });
         checkWMTE(() -> { // index reference class
-            vh.setRelease(array, Void.class, (short)1);
+            vh.setRelease(array, Void.class, (short)0x0123);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
             vh.setRelease();
         });
         checkWMTE(() -> { // >
-            vh.setRelease(array, 0, (short)1, Void.class);
+            vh.setRelease(array, 0, (short)0x0123, Void.class);
+        });
+
+
+        // CompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.compareAndSet(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.compareAndSet(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.compareAndSet(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.compareAndSet(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.compareAndSet(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.compareAndSet(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.compareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.compareAndSet(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSet(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSet(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSet(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSet(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSet(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSet(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSet();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSet(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetVolatile
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetVolatile(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetVolatile(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetVolatile(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetVolatile(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetVolatile();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetVolatile(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetAcquire(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetAcquire(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetAcquire(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetAcquire();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetAcquire(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // WeakCompareAndSetRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            boolean r = vh.weakCompareAndSetRelease(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // receiver reference class
+            boolean r = vh.weakCompareAndSetRelease(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            boolean r = vh.weakCompareAndSetRelease(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // receiver primitive class
+            boolean r = vh.weakCompareAndSetRelease(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            boolean r = vh.weakCompareAndSetRelease(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            boolean r = vh.weakCompareAndSetRelease();
+        });
+        checkWMTE(() -> { // >
+            boolean r = vh.weakCompareAndSetRelease(array, 0, (short)0x0123, (short)0x0123, Void.class);
         });
 
 
+        // CompareAndExchange
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.compareAndExchange(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // array reference class
+            short x = (short) vh.compareAndExchange(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchange(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchange(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            short x = (short) vh.compareAndExchange(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            short x = (short) vh.compareAndExchange(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchange(array, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchange(array, 0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchange();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchange(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
 
+
+        // CompareAndExchangeAcquire
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.compareAndExchangeAcquire(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // array reference class
+            short x = (short) vh.compareAndExchangeAcquire(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchangeAcquire(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchangeAcquire(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            short x = (short) vh.compareAndExchangeAcquire(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            short x = (short) vh.compareAndExchangeAcquire(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeAcquire(array, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeAcquire(array, 0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchangeAcquire();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchangeAcquire(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // CompareAndExchangeRelease
+        // Incorrect argument types
+        checkNPE(() -> { // null receiver
+            short x = (short) vh.compareAndExchangeRelease(null, 0, (short)0x0123, (short)0x0123);
+        });
+        checkCCE(() -> { // array reference class
+            short x = (short) vh.compareAndExchangeRelease(Void.class, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // expected reference class
+            short x = (short) vh.compareAndExchangeRelease(array, 0, Void.class, (short)0x0123);
+        });
+        checkWMTE(() -> { // actual reference class
+            short x = (short) vh.compareAndExchangeRelease(array, 0, (short)0x0123, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            short x = (short) vh.compareAndExchangeRelease(0, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            short x = (short) vh.compareAndExchangeRelease(array, Void.class, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.compareAndExchangeRelease(array, 0, (short)0x0123, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.compareAndExchangeRelease(array, 0, (short)0x0123, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.compareAndExchangeRelease();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.compareAndExchangeRelease(array, 0, (short)0x0123, (short)0x0123, Void.class);
+        });
+
+
+        // GetAndSet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            short x = (short) vh.getAndSet(null, 0, (short)0x0123);
+        });
+        checkCCE(() -> { // array reference class
+            short x = (short) vh.getAndSet(Void.class, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.getAndSet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // reciarrayever primitive class
+            short x = (short) vh.getAndSet(0, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            short x = (short) vh.getAndSet(array, Void.class, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndSet(array, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndSet(array, 0, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.getAndSet();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.getAndSet(array, 0, (short)0x0123, Void.class);
+        });
+
+        // GetAndAdd
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            short x = (short) vh.getAndAdd(null, 0, (short)0x0123);
+        });
+        checkCCE(() -> { // array reference class
+            short x = (short) vh.getAndAdd(Void.class, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.getAndAdd(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            short x = (short) vh.getAndAdd(0, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            short x = (short) vh.getAndAdd(array, Void.class, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.getAndAdd(array, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.getAndAdd(array, 0, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.getAndAdd();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.getAndAdd(array, 0, (short)0x0123, Void.class);
+        });
+
+
+        // AddAndGet
+        // Incorrect argument types
+        checkNPE(() -> { // null array
+            short x = (short) vh.addAndGet(null, 0, (short)0x0123);
+        });
+        checkCCE(() -> { // array reference class
+            short x = (short) vh.addAndGet(Void.class, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // value reference class
+            short x = (short) vh.addAndGet(array, 0, Void.class);
+        });
+        checkWMTE(() -> { // array primitive class
+            short x = (short) vh.addAndGet(0, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // index reference class
+            short x = (short) vh.addAndGet(array, Void.class, (short)0x0123);
+        });
+        // Incorrect return type
+        checkWMTE(() -> { // reference class
+            Void r = (Void) vh.addAndGet(array, 0, (short)0x0123);
+        });
+        checkWMTE(() -> { // primitive class
+            boolean x = (boolean) vh.addAndGet(array, 0, (short)0x0123);
+        });
+        // Incorrect arity
+        checkWMTE(() -> { // 0
+            short x = (short) vh.addAndGet();
+        });
+        checkWMTE(() -> { // >
+            short x = (short) vh.addAndGet(array, 0, (short)0x0123, Void.class);
+        });
     }
 
     static void testArrayWrongMethodType(Handles hs) throws Throwable {
         short[] array = new short[10];
-        Arrays.fill(array, (short)1);
+        Arrays.fill(array, (short)0x0123);
 
         for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) {
             // Incorrect argument types
@@ -824,11 +1950,11 @@
             // Incorrect argument types
             checkNPE(() -> { // null array
                 hs.get(am, methodType(void.class, short[].class, int.class, short.class)).
-                    invokeExact((short[]) null, 0, (short)1);
+                    invokeExact((short[]) null, 0, (short)0x0123);
             });
             hs.checkWMTEOrCCE(() -> { // array reference class
                 hs.get(am, methodType(void.class, Class.class, int.class, short.class)).
-                    invokeExact(Void.class, 0, (short)1);
+                    invokeExact(Void.class, 0, (short)0x0123);
             });
             checkWMTE(() -> { // value reference class
                 hs.get(am, methodType(void.class, short[].class, int.class, Class.class)).
@@ -836,11 +1962,11 @@
             });
             checkWMTE(() -> { // receiver primitive class
                 hs.get(am, methodType(void.class, int.class, int.class, short.class)).
-                    invokeExact(0, 0, (short)1);
+                    invokeExact(0, 0, (short)0x0123);
             });
             checkWMTE(() -> { // index reference class
                 hs.get(am, methodType(void.class, short[].class, Class.class, short.class)).
-                    invokeExact(array, Void.class, (short)1);
+                    invokeExact(array, Void.class, (short)0x0123);
             });
             // Incorrect arity
             checkWMTE(() -> { // 0
@@ -849,10 +1975,175 @@
             });
             checkWMTE(() -> { // >
                 hs.get(am, methodType(void.class, short[].class, int.class, Class.class)).
-                    invokeExact(array, 0, (short)1, Void.class);
+                    invokeExact(array, 0, (short)0x0123, Void.class);
+            });
+        }
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class, short.class)).
+                    invokeExact((short[]) null, 0, (short)0x0123, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // receiver reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, short.class, short.class)).
+                    invokeExact(Void.class, 0, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // expected reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, Class.class, short.class)).
+                    invokeExact(array, 0, Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // actual reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class, Class.class)).
+                    invokeExact(array, 0, (short)0x0123, Void.class);
+            });
+            checkWMTE(() -> { // receiver primitive class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, short.class, short.class)).
+                    invokeExact(0, 0, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // index reference class
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short[].class, Class.class, short.class, short.class)).
+                    invokeExact(array, Void.class, (short)0x0123, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                boolean r = (boolean) hs.get(am, methodType(boolean.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                boolean r = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class, short.class, Class.class)).
+                    invokeExact(array, 0, (short)0x0123, (short)0x0123, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null receiver
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class, short.class)).
+                    invokeExact((short[]) null, 0, (short)0x0123, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, int.class, short.class, short.class)).
+                    invokeExact(Void.class, 0, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // expected reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, Class.class, short.class)).
+                    invokeExact(array, 0, Void.class, (short)0x0123);
+            });
+            checkWMTE(() -> { // actual reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class, Class.class)).
+                    invokeExact(array, 0, (short)0x0123, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                short x = (short) hs.get(am, methodType(short.class, int.class, int.class, short.class, short.class)).
+                    invokeExact(0, 0, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // index reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, Class.class, short.class, short.class)).
+                    invokeExact(array, Void.class, (short)0x0123, (short)0x0123);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, short[].class, int.class, short.class, short.class)).
+                    invokeExact(array, 0, (short)0x0123, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class, short.class)).
+                    invokeExact(array, 0, (short)0x0123, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class, short.class, Class.class)).
+                    invokeExact(array, 0, (short)0x0123, (short)0x0123, Void.class);
             });
         }
 
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class)).
+                    invokeExact((short[]) null, 0, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, int.class, short.class)).
+                    invokeExact(Void.class, 0, (short)0x0123);
+            });
+            checkWMTE(() -> { // value reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                short x = (short) hs.get(am, methodType(short.class, int.class, int.class, short.class)).
+                    invokeExact(0, 0, (short)0x0123);
+            });
+            checkWMTE(() -> { // index reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, Class.class, short.class)).
+                    invokeExact(array, Void.class, (short)0x0123);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, short[].class, int.class, short.class)).
+                    invokeExact(array, 0, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class)).
+                    invokeExact(array, 0, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class, Class.class)).
+                    invokeExact(array, 0, (short)0x0123, Void.class);
+            });
+        }
+
+        for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) {
+            // Incorrect argument types
+            checkNPE(() -> { // null array
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class)).
+                    invokeExact((short[]) null, 0, (short)0x0123);
+            });
+            hs.checkWMTEOrCCE(() -> { // array reference class
+                short x = (short) hs.get(am, methodType(short.class, Class.class, int.class, short.class)).
+                    invokeExact(Void.class, 0, (short)0x0123);
+            });
+            checkWMTE(() -> { // value reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, Class.class)).
+                    invokeExact(array, 0, Void.class);
+            });
+            checkWMTE(() -> { // array primitive class
+                short x = (short) hs.get(am, methodType(short.class, int.class, int.class, short.class)).
+                    invokeExact(0, 0, (short)0x0123);
+            });
+            checkWMTE(() -> { // index reference class
+                short x = (short) hs.get(am, methodType(short.class, short[].class, Class.class, short.class)).
+                    invokeExact(array, Void.class, (short)0x0123);
+            });
+            // Incorrect return type
+            checkWMTE(() -> { // reference class
+                Void r = (Void) hs.get(am, methodType(Void.class, short[].class, int.class, short.class)).
+                    invokeExact(array, 0, (short)0x0123);
+            });
+            checkWMTE(() -> { // primitive class
+                boolean x = (boolean) hs.get(am, methodType(boolean.class, short[].class, int.class, short.class)).
+                    invokeExact(array, 0, (short)0x0123);
+            });
+            // Incorrect arity
+            checkWMTE(() -> { // 0
+                short x = (short) hs.get(am, methodType(short.class)).
+                    invokeExact();
+            });
+            checkWMTE(() -> { // >
+                short x = (short) hs.get(am, methodType(short.class, short[].class, int.class, short.class, Class.class)).
+                    invokeExact(array, 0, (short)0x0123, Void.class);
+            });
+        }
     }
 }
 
--- a/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/VarHandleTestMethodTypeString.java	Thu Jul 07 18:35:29 2016 +0000
@@ -454,40 +454,40 @@
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            String x = (String) vh.compareAndExchangeVolatile(null, "foo", "foo");
+            String x = (String) vh.compareAndExchange(null, "foo", "foo");
         });
         checkCCE(() -> { // receiver reference class
-            String x = (String) vh.compareAndExchangeVolatile(Void.class, "foo", "foo");
+            String x = (String) vh.compareAndExchange(Void.class, "foo", "foo");
         });
         checkCCE(() -> { // expected reference class
-            String x = (String) vh.compareAndExchangeVolatile(recv, Void.class, "foo");
+            String x = (String) vh.compareAndExchange(recv, Void.class, "foo");
         });
         checkCCE(() -> { // actual reference class
-            String x = (String) vh.compareAndExchangeVolatile(recv, "foo", Void.class);
+            String x = (String) vh.compareAndExchange(recv, "foo", Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            String x = (String) vh.compareAndExchangeVolatile(0, "foo", "foo");
+            String x = (String) vh.compareAndExchange(0, "foo", "foo");
         });
         // Incorrect return type
         checkCCE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(recv, "foo", "foo");
+            Void r = (Void) vh.compareAndExchange(recv, "foo", "foo");
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(recv, "foo", "foo");
+            boolean x = (boolean) vh.compareAndExchange(recv, "foo", "foo");
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            String x = (String) vh.compareAndExchangeVolatile();
+            String x = (String) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            String x = (String) vh.compareAndExchangeVolatile(recv, "foo", "foo", Void.class);
+            String x = (String) vh.compareAndExchange(recv, "foo", "foo", Void.class);
         });
 
 
-        // CompareAndExchangeVolatileAcquire
+        // CompareAndExchangeAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
             String x = (String) vh.compareAndExchangeAcquire(null, "foo", "foo");
@@ -957,27 +957,27 @@
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkCCE(() -> { // expected reference class
-            String x = (String) vh.compareAndExchangeVolatile(Void.class, "foo");
+            String x = (String) vh.compareAndExchange(Void.class, "foo");
         });
         checkCCE(() -> { // actual reference class
-            String x = (String) vh.compareAndExchangeVolatile("foo", Void.class);
+            String x = (String) vh.compareAndExchange("foo", Void.class);
         });
         // Incorrect return type
         checkCCE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile("foo", "foo");
+            Void r = (Void) vh.compareAndExchange("foo", "foo");
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile("foo", "foo");
+            boolean x = (boolean) vh.compareAndExchange("foo", "foo");
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            String x = (String) vh.compareAndExchangeVolatile();
+            String x = (String) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            String x = (String) vh.compareAndExchangeVolatile("foo", "foo", Void.class);
+            String x = (String) vh.compareAndExchange("foo", "foo", Void.class);
         });
 
 
@@ -1539,39 +1539,39 @@
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            String x = (String) vh.compareAndExchangeVolatile(null, 0, "foo", "foo");
+            String x = (String) vh.compareAndExchange(null, 0, "foo", "foo");
         });
         checkCCE(() -> { // array reference class
-            String x = (String) vh.compareAndExchangeVolatile(Void.class, 0, "foo", "foo");
+            String x = (String) vh.compareAndExchange(Void.class, 0, "foo", "foo");
         });
         checkCCE(() -> { // expected reference class
-            String x = (String) vh.compareAndExchangeVolatile(array, 0, Void.class, "foo");
+            String x = (String) vh.compareAndExchange(array, 0, Void.class, "foo");
         });
         checkCCE(() -> { // actual reference class
-            String x = (String) vh.compareAndExchangeVolatile(array, 0, "foo", Void.class);
+            String x = (String) vh.compareAndExchange(array, 0, "foo", Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            String x = (String) vh.compareAndExchangeVolatile(0, 0, "foo", "foo");
+            String x = (String) vh.compareAndExchange(0, 0, "foo", "foo");
         });
         checkWMTE(() -> { // index reference class
-            String x = (String) vh.compareAndExchangeVolatile(array, Void.class, "foo", "foo");
+            String x = (String) vh.compareAndExchange(array, Void.class, "foo", "foo");
         });
         // Incorrect return type
         checkCCE(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(array, 0, "foo", "foo");
+            Void r = (Void) vh.compareAndExchange(array, 0, "foo", "foo");
         });
         checkWMTE(() -> { // primitive class
-            boolean x = (boolean) vh.compareAndExchangeVolatile(array, 0, "foo", "foo");
+            boolean x = (boolean) vh.compareAndExchange(array, 0, "foo", "foo");
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            String x = (String) vh.compareAndExchangeVolatile();
+            String x = (String) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            String x = (String) vh.compareAndExchangeVolatile(array, 0, "foo", "foo", Void.class);
+            String x = (String) vh.compareAndExchange(array, 0, "foo", "foo", Void.class);
         });
 
 
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestAccess.java.template	Thu Jul 07 18:35:29 2016 +0000
@@ -101,7 +101,7 @@
 
 #if[CAS]
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -111,7 +111,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 #else[CAS]
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -283,7 +283,7 @@
         });
 
         checkUOE(() -> {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, $value2$);
+            $type$ r = ($type$) vh.compareAndExchange(recv, $value1$, $value2$);
         });
 
         checkUOE(() -> {
@@ -377,7 +377,7 @@
         });
 
         checkUOE(() -> {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile($value1$, $value2$);
+            $type$ r = ($type$) vh.compareAndExchange($value1$, $value2$);
         });
 
         checkUOE(() -> {
@@ -470,17 +470,17 @@
         }
 
         {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value2$, $value1$);
-            assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) vh.compareAndExchange(recv, $value2$, $value1$);
+            assertEquals(r, $value2$, "success compareAndExchange $type$");
             $type$ x = ($type$) vh.get(recv);
-            assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "success compareAndExchange $type$ value");
         }
 
         {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value2$, $value3$);
-            assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) vh.compareAndExchange(recv, $value2$, $value3$);
+            assertEquals(r, $value1$, "failing compareAndExchange $type$");
             $type$ x = ($type$) vh.get(recv);
-            assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
         }
 
         {
@@ -568,7 +568,7 @@
             $type$ o = ($type$) vh.getAndAdd(recv, $value3$);
             assertEquals(o, $value1$, "getAndAdd $type$");
             $type$ c = ($type$) vh.addAndGet(recv, $value3$);
-            assertEquals(c, $value1$ + $value3$ + $value3$, "getAndAdd $type$ value");
+            assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
         }
 #end[AtomicAdd]
     }
@@ -580,7 +580,7 @@
         });
 
         checkUOE(() -> {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, $value2$);
+            $type$ r = ($type$) vh.compareAndExchange(recv, $value1$, $value2$);
         });
 
         checkUOE(() -> {
@@ -673,17 +673,17 @@
         }
 
         {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile($value2$, $value1$);
-            assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) vh.compareAndExchange($value2$, $value1$);
+            assertEquals(r, $value2$, "success compareAndExchange $type$");
             $type$ x = ($type$) vh.get();
-            assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "success compareAndExchange $type$ value");
         }
 
         {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile($value2$, $value3$);
-            assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) vh.compareAndExchange($value2$, $value3$);
+            assertEquals(r, $value1$, "failing compareAndExchange $type$");
             $type$ x = ($type$) vh.get();
-            assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
         }
 
         {
@@ -771,7 +771,7 @@
             $type$ o = ($type$) vh.getAndAdd( $value3$);
             assertEquals(o, $value1$, "getAndAdd $type$");
             $type$ c = ($type$) vh.addAndGet($value3$);
-            assertEquals(c, $value1$ + $value3$ + $value3$, "getAndAdd $type$ value");
+            assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
         }
 #end[AtomicAdd]
     }
@@ -783,7 +783,7 @@
         });
 
         checkUOE(() -> {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile($value1$, $value2$);
+            $type$ r = ($type$) vh.compareAndExchange($value1$, $value2$);
         });
 
         checkUOE(() -> {
@@ -879,17 +879,17 @@
             }
 
             {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, $value2$, $value1$);
-                assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
+                $type$ r = ($type$) vh.compareAndExchange(array, i, $value2$, $value1$);
+                assertEquals(r, $value2$, "success compareAndExchange $type$");
                 $type$ x = ($type$) vh.get(array, i);
-                assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
+                assertEquals(x, $value1$, "success compareAndExchange $type$ value");
             }
 
             {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, $value2$, $value3$);
-                assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
+                $type$ r = ($type$) vh.compareAndExchange(array, i, $value2$, $value3$);
+                assertEquals(r, $value1$, "failing compareAndExchange $type$");
                 $type$ x = ($type$) vh.get(array, i);
-                assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
+                assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
             }
 
             {
@@ -977,7 +977,7 @@
                 $type$ o = ($type$) vh.getAndAdd(array, i, $value3$);
                 assertEquals(o, $value1$, "getAndAdd $type$");
                 $type$ c = ($type$) vh.addAndGet(array, i, $value3$);
-                assertEquals(c, $value1$ + $value3$ + $value3$, "getAndAdd $type$ value");
+                assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
             }
 #end[AtomicAdd]
         }
@@ -993,7 +993,7 @@
         });
 
         checkUOE(() -> {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, $value1$, $value2$);
+            $type$ r = ($type$) vh.compareAndExchange(array, i, $value1$, $value2$);
         });
 
         checkUOE(() -> {
@@ -1080,7 +1080,7 @@
             });
 
             checkIOOBE(() -> {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, $value2$, $value1$);
+                $type$ r = ($type$) vh.compareAndExchange(array, ci, $value2$, $value1$);
             });
 
             checkIOOBE(() -> {
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestByteArrayView.java.template	Thu Jul 07 18:35:29 2016 +0000
@@ -90,7 +90,7 @@
 
 #if[CAS]
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -100,7 +100,7 @@
         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 #else[CAS]
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
-        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
+        assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
@@ -207,7 +207,7 @@
         });
 
         checkUOE(() -> {
-            $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+            $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
         });
 
         checkUOE(() -> {
@@ -281,7 +281,7 @@
             });
 
             checkROBE(() -> {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkROBE(() -> {
@@ -318,7 +318,7 @@
             });
 
             checkUOE(() -> {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkUOE(() -> {
@@ -375,7 +375,7 @@
             });
 
             checkUOE(() -> {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkUOE(() -> {
@@ -465,7 +465,7 @@
             });
 
             checkIOOBE(() -> {
-                $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
             });
 
             checkIOOBE(() -> {
@@ -561,7 +561,7 @@
                 });
 
                 checkIOOBE(() -> {
-                    $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkIOOBE(() -> {
@@ -648,7 +648,7 @@
                 });
 
                 checkISE(() -> {
-                    $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                    $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                 });
 
                 checkISE(() -> {
@@ -738,7 +738,7 @@
                     });
 
                     checkISE(() -> {
-                        $type$ r = ($type$) vh.compareAndExchangeVolatile(array, ci, VALUE_2, VALUE_1);
+                        $type$ r = ($type$) vh.compareAndExchange(array, ci, VALUE_2, VALUE_1);
                     });
 
                     checkISE(() -> {
@@ -844,17 +844,17 @@
                 }
 
                 {
-                    $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile $type$");
+                    $type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange $type$");
                     $type$ x = ($type$) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile $type$ value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange $type$ value");
                 }
 
                 {
-                    $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile $type$");
+                    $type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange $type$");
                     $type$ x = ($type$) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile $type$ value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange $type$ value");
                 }
 
                 {
@@ -1006,17 +1006,17 @@
                 }
 
                 {
-                    $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_1);
-                    assertEquals(r, VALUE_2, "success compareAndExchangeVolatile $type$");
+                    $type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_1);
+                    assertEquals(r, VALUE_2, "success compareAndExchange $type$");
                     $type$ x = ($type$) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "success compareAndExchangeVolatile $type$ value");
+                    assertEquals(x, VALUE_1, "success compareAndExchange $type$ value");
                 }
 
                 {
-                    $type$ r = ($type$) vh.compareAndExchangeVolatile(array, i, VALUE_2, VALUE_3);
-                    assertEquals(r, VALUE_1, "failing compareAndExchangeVolatile $type$");
+                    $type$ r = ($type$) vh.compareAndExchange(array, i, VALUE_2, VALUE_3);
+                    assertEquals(r, VALUE_1, "failing compareAndExchange $type$");
                     $type$ x = ($type$) vh.get(array, i);
-                    assertEquals(x, VALUE_1, "failing compareAndExchangeVolatile $type$ value");
+                    assertEquals(x, VALUE_1, "failing compareAndExchange $type$ value");
                 }
 
                 {
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodHandleAccess.java.template	Thu Jul 07 18:35:29 2016 +0000
@@ -167,17 +167,17 @@
         }
 
         {
-            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, $value2$, $value1$);
-            assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, $value2$, $value1$);
+            assertEquals(r, $value2$, "success compareAndExchange $type$");
             $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "success compareAndExchange $type$ value");
         }
 
         {
-            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(recv, $value2$, $value3$);
-            assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(recv, $value2$, $value3$);
+            assertEquals(r, $value1$, "failing compareAndExchange $type$");
             $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(recv);
-            assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
         }
 
         {
@@ -265,7 +265,7 @@
             $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(recv, $value3$);
             assertEquals(o, $value1$, "getAndAdd $type$");
             $type$ c = ($type$) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(recv, $value3$);
-            assertEquals(c, $value1$ + $value3$ + $value3$, "getAndAdd $type$ value");
+            assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
         }
 #end[AtomicAdd]
     }
@@ -350,17 +350,17 @@
         }
 
         {
-            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact($value2$, $value1$);
-            assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact($value2$, $value1$);
+            assertEquals(r, $value2$, "success compareAndExchange $type$");
             $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "success compareAndExchange $type$ value");
         }
 
         {
-            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact($value2$, $value3$);
-            assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
+            $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact($value2$, $value3$);
+            assertEquals(r, $value1$, "failing compareAndExchange $type$");
             $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact();
-            assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
+            assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
         }
 
         {
@@ -448,7 +448,7 @@
             $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact( $value3$);
             assertEquals(o, $value1$, "getAndAdd $type$");
             $type$ c = ($type$) hs.get(TestAccessMode.ADD_AND_GET).invokeExact($value3$);
-            assertEquals(c, $value1$ + $value3$ + $value3$, "getAndAdd $type$ value");
+            assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
         }
 #end[AtomicAdd]
     }
@@ -536,17 +536,17 @@
             }
 
             {
-                $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, $value2$, $value1$);
-                assertEquals(r, $value2$, "success compareAndExchangeVolatile $type$");
+                $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, $value2$, $value1$);
+                assertEquals(r, $value2$, "success compareAndExchange $type$");
                 $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, $value1$, "success compareAndExchangeVolatile $type$ value");
+                assertEquals(x, $value1$, "success compareAndExchange $type$ value");
             }
 
             {
-                $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE_VOLATILE).invokeExact(array, i, $value2$, $value3$);
-                assertEquals(r, $value1$, "failing compareAndExchangeVolatile $type$");
+                $type$ r = ($type$) hs.get(TestAccessMode.COMPARE_AND_EXCHANGE).invokeExact(array, i, $value2$, $value3$);
+                assertEquals(r, $value1$, "failing compareAndExchange $type$");
                 $type$ x = ($type$) hs.get(TestAccessMode.GET).invokeExact(array, i);
-                assertEquals(x, $value1$, "failing compareAndExchangeVolatile $type$ value");
+                assertEquals(x, $value1$, "failing compareAndExchange $type$ value");
             }
 
             {
@@ -634,7 +634,7 @@
                 $type$ o = ($type$) hs.get(TestAccessMode.GET_AND_ADD).invokeExact(array, i, $value3$);
                 assertEquals(o, $value1$, "getAndAdd $type$");
                 $type$ c = ($type$) hs.get(TestAccessMode.ADD_AND_GET).invokeExact(array, i, $value3$);
-                assertEquals(c, $value1$ + $value3$ + $value3$, "getAndAdd $type$ value");
+                assertEquals(c, ($type$)($value1$ + $value3$ + $value3$), "getAndAdd $type$ value");
             }
 #end[AtomicAdd]
         }
--- a/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodType.java.template	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/X-VarHandleTestMethodType.java.template	Thu Jul 07 18:35:29 2016 +0000
@@ -455,40 +455,40 @@
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(null, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(null, $value1$, $value1$);
         });
         checkCCE(() -> { // receiver reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(Void.class, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(Void.class, $value1$, $value1$);
         });
         check{#if[String]?CCE:WMTE}(() -> { // expected reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(recv, Void.class, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(recv, Void.class, $value1$);
         });
         check{#if[String]?CCE:WMTE}(() -> { // actual reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, Void.class);
+            $type$ x = ($type$) vh.compareAndExchange(recv, $value1$, Void.class);
         });
         checkWMTE(() -> { // reciever primitive class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(0, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(0, $value1$, $value1$);
         });
         // Incorrect return type
         check{#if[String]?CCE:WMTE}(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(recv, $value1$, $value1$);
+            Void r = (Void) vh.compareAndExchange(recv, $value1$, $value1$);
         });
         checkWMTE(() -> { // primitive class
-            $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeVolatile(recv, $value1$, $value1$);
+            $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange(recv, $value1$, $value1$);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            $type$ x = ($type$) vh.compareAndExchangeVolatile();
+            $type$ x = ($type$) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(recv, $value1$, $value1$, Void.class);
+            $type$ x = ($type$) vh.compareAndExchange(recv, $value1$, $value1$, Void.class);
         });
 
 
-        // CompareAndExchangeVolatileAcquire
+        // CompareAndExchangeAcquire
         // Incorrect argument types
         checkNPE(() -> { // null receiver
             $type$ x = ($type$) vh.compareAndExchangeAcquire(null, $value1$, $value1$);
@@ -1060,27 +1060,27 @@
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         check{#if[String]?CCE:WMTE}(() -> { // expected reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(Void.class, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(Void.class, $value1$);
         });
         check{#if[String]?CCE:WMTE}(() -> { // actual reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile($value1$, Void.class);
+            $type$ x = ($type$) vh.compareAndExchange($value1$, Void.class);
         });
         // Incorrect return type
         check{#if[String]?CCE:WMTE}(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile($value1$, $value1$);
+            Void r = (Void) vh.compareAndExchange($value1$, $value1$);
         });
         checkWMTE(() -> { // primitive class
-            $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeVolatile($value1$, $value1$);
+            $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange($value1$, $value1$);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            $type$ x = ($type$) vh.compareAndExchangeVolatile();
+            $type$ x = ($type$) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            $type$ x = ($type$) vh.compareAndExchangeVolatile($value1$, $value1$, Void.class);
+            $type$ x = ($type$) vh.compareAndExchange($value1$, $value1$, Void.class);
         });
 
 
@@ -1715,39 +1715,39 @@
         });
 
 
-        // CompareAndExchangeVolatile
+        // CompareAndExchange
         // Incorrect argument types
         checkNPE(() -> { // null receiver
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(null, 0, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(null, 0, $value1$, $value1$);
         });
         checkCCE(() -> { // array reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(Void.class, 0, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(Void.class, 0, $value1$, $value1$);
         });
         check{#if[String]?CCE:WMTE}(() -> { // expected reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(array, 0, Void.class, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(array, 0, Void.class, $value1$);
         });
         check{#if[String]?CCE:WMTE}(() -> { // actual reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(array, 0, $value1$, Void.class);
+            $type$ x = ($type$) vh.compareAndExchange(array, 0, $value1$, Void.class);
         });
         checkWMTE(() -> { // array primitive class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(0, 0, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(0, 0, $value1$, $value1$);
         });
         checkWMTE(() -> { // index reference class
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(array, Void.class, $value1$, $value1$);
+            $type$ x = ($type$) vh.compareAndExchange(array, Void.class, $value1$, $value1$);
         });
         // Incorrect return type
         check{#if[String]?CCE:WMTE}(() -> { // reference class
-            Void r = (Void) vh.compareAndExchangeVolatile(array, 0, $value1$, $value1$);
+            Void r = (Void) vh.compareAndExchange(array, 0, $value1$, $value1$);
         });
         checkWMTE(() -> { // primitive class
-            $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeVolatile(array, 0, $value1$, $value1$);
+            $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange(array, 0, $value1$, $value1$);
         });
         // Incorrect arity
         checkWMTE(() -> { // 0
-            $type$ x = ($type$) vh.compareAndExchangeVolatile();
+            $type$ x = ($type$) vh.compareAndExchange();
         });
         checkWMTE(() -> { // >
-            $type$ x = ($type$) vh.compareAndExchangeVolatile(array, 0, $value1$, $value1$, Void.class);
+            $type$ x = ($type$) vh.compareAndExchange(array, 0, $value1$, $value1$, Void.class);
         });
 
 
--- a/jdk/test/java/lang/invoke/VarHandles/generate-vh-tests.sh	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/java/lang/invoke/VarHandles/generate-vh-tests.sh	Thu Jul 07 18:35:29 2016 +0000
@@ -14,14 +14,10 @@
   Type="$(tr '[:lower:]' '[:upper:]' <<< ${type:0:1})${type:1}"
   args="-K$type -Dtype=$type -DType=$Type"
 
-  case $type in
-    String|int|long)
-      args="$args -KCAS"
-      ;;
-  esac
+  args="$args -KCAS"
 
   case $type in
-    int|long)
+    byte|short|char|int|long|float|double)
       args="$args -KAtomicAdd"
       ;;
   esac
@@ -36,29 +32,29 @@
       wrong_primitive_type=int
       ;;
     byte)
-      value1=(byte)1
-      value2=(byte)2
-      value3=(byte)3
+      value1=(byte)0x01
+      value2=(byte)0x23
+      value3=(byte)0x45
       ;;
     short)
-      value1=(short)1
-      value2=(short)2
-      value3=(short)3
+      value1=(short)0x0123
+      value2=(short)0x4567
+      value3=(short)0x89AB
       ;;
     char)
-      value1=\'a\'
-      value2=\'b\'
-      value3=\'c\'
+      value1=\'\\\\u0123\'
+      value2=\'\\\\u4567\'
+      value3=\'\\\\u89AB\'
       ;;
     int)
-      value1=1
-      value2=2
-      value3=3
+      value1=0x01234567
+      value2=0x89ABCDEF
+      value3=0xCAFEBABE
       ;;
     long)
-      value1=1L
-      value2=2L
-      value3=3L
+      value1=0x0123456789ABCDEFL
+      value2=0xCAFEBABECAFEBABEL
+      value3=0xDEADBEEFDEADBEEFL
       ;;
     float)
       value1=1.0f
--- a/jdk/test/javax/net/ssl/HttpsURLConnection/Equals.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/javax/net/ssl/HttpsURLConnection/Equals.java	Thu Jul 07 18:35:29 2016 +0000
@@ -23,17 +23,14 @@
 
 /**
  * @test
+ * @bug 8055299
  * @library /lib/testlibrary
  * @modules jdk.httpserver
  * @build jdk.testlibrary.SimpleSSLContext
- * @run main Equals
- * @bug 8055299
+ * @run main/othervm -Djavax.net.debug=ssl,handshake,record Equals
  */
-
 import com.sun.net.httpserver.*;
-
 import java.net.*;
-import java.util.*;
 import java.io.*;
 import javax.net.ssl.*;
 import java.util.concurrent.*;
@@ -43,54 +40,59 @@
 
     static SSLContext ctx;
 
-    public static void main (String[] args) throws Exception {
+    public static void main(String[] args) throws Exception {
         HttpsServer s2 = null;
-        ExecutorService executor=null;
+        ExecutorService executor = null;
         try {
-            InetSocketAddress addr = new InetSocketAddress (0);
-            s2 = HttpsServer.create (addr, 0);
-            HttpHandler h = new Handler ();
-            HttpContext c2 = s2.createContext ("/test1", h);
+            InetSocketAddress addr = new InetSocketAddress(0);
+            s2 = HttpsServer.create(addr, 0);
+            HttpHandler h = new Handler();
+            HttpContext c2 = s2.createContext("/test1", h);
             executor = Executors.newCachedThreadPool();
-            s2.setExecutor (executor);
+            s2.setExecutor(executor);
             ctx = new SimpleSSLContext().get();
-            s2.setHttpsConfigurator(new HttpsConfigurator (ctx));
+            s2.setHttpsConfigurator(new HttpsConfigurator(ctx));
             s2.start();
-
             int httpsport = s2.getAddress().getPort();
+            System.out.printf("%nServer address: %s%n", s2.getAddress());
             test(httpsport);
-            System.out.println ("OK");
+            System.out.println("OK");
         } finally {
-            if (s2 != null)
+            if (s2 != null) {
                 s2.stop(2);
-            if (executor != null)
-                executor.shutdown ();
+            }
+            if (executor != null) {
+                executor.shutdown();
+            }
         }
     }
 
     static class Handler implements HttpHandler {
+
         int invocation = 1;
-        public void handle (HttpExchange t)
-            throws IOException
-        {
+
+        public void handle(HttpExchange t)
+                throws IOException {
             InputStream is = t.getRequestBody();
-            while (is.read () != -1) {
+            while (is.read() != -1) {
             }
             is.close();
-            t.sendResponseHeaders (200, 0);
+            t.sendResponseHeaders(200, 0);
             t.close();
         }
     }
 
-    static void test (int port) throws Exception {
-        URL url = new URL ("https://localhost:"+port+"/test1/");
+    static void test(int port) throws Exception {
+        System.out.printf("%nClient using port number: %s%n", port);
+        String spec = String.format("https://localhost:%s/test1/", port);
+        URL url = new URL(spec);
         HttpsURLConnection urlcs = (HttpsURLConnection) url.openConnection();
-        urlcs.setHostnameVerifier (new HostnameVerifier () {
-            public boolean verify (String s, SSLSession s1) {
+        urlcs.setHostnameVerifier(new HostnameVerifier() {
+            public boolean verify(String s, SSLSession s1) {
                 return true;
             }
         });
-        urlcs.setSSLSocketFactory (ctx.getSocketFactory());
+        urlcs.setSSLSocketFactory(ctx.getSocketFactory());
 
         InputStream is = urlcs.getInputStream();
         while (is.read() != -1) {
--- a/jdk/test/javax/net/ssl/TLSv12/ShortRSAKey512.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/javax/net/ssl/TLSv12/ShortRSAKey512.java	Thu Jul 07 18:35:29 2016 +0000
@@ -33,7 +33,6 @@
  *
  *     SunJSSE does not support dynamic system properties, no way to re-use
  *     system properties in samevm/agentvm mode.
- * @key intermittent
  * @run main/othervm ShortRSAKey512 PKIX
  * @run main/othervm ShortRSAKey512 SunX509
  */
--- a/jdk/test/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java	Thu Jul 07 18:35:29 2016 +0000
@@ -31,7 +31,6 @@
  * @bug 7105780
  * @summary Add SSLSocket client/SSLEngine server to templates directory.
  * @run main/othervm SSLSocketSSLEngineTemplate
- * @key intermittent
  */
 
 /**
--- a/jdk/test/sun/security/krb5/auto/KDC.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/KDC.java	Thu Jul 07 18:35:29 2016 +0000
@@ -246,7 +246,7 @@
      * @throws java.io.IOException for any socket creation error
      */
     public static KDC create(String realm) throws IOException {
-        return create(realm, "kdc." + realm.toLowerCase(), 0, true);
+        return create(realm, "kdc." + realm.toLowerCase(Locale.US), 0, true);
     }
 
     public static KDC existing(String realm, String kdc, int port) {
--- a/jdk/test/sun/security/krb5/auto/NewSalt.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/NewSalt.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
  * @run main/othervm -Donlyonepreauth NewSalt
  */
 
+import java.util.Locale;
 import sun.security.jgss.GSSUtil;
 import sun.security.krb5.Config;
 
@@ -51,9 +52,9 @@
         }
 
         // Use a different case of name. KDC will return correct salt
-        Context c1 = Context.fromUserPass(OneKDC.USER.toUpperCase(),
+        Context c1 = Context.fromUserPass(OneKDC.USER.toUpperCase(Locale.US),
                 OneKDC.PASS, true);
-        Context c2 = Context.fromUserPass(OneKDC.USER2.toUpperCase(),
+        Context c2 = Context.fromUserPass(OneKDC.USER2.toUpperCase(Locale.US),
                 OneKDC.PASS2, true);
 
         c1.startAsClient(OneKDC.USER2, GSSUtil.GSS_KRB5_MECH_OID);
--- a/jdk/test/sun/security/krb5/auto/OneKDC.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/OneKDC.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.security.Security;
+import java.util.Locale;
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.NameCallback;
@@ -52,9 +53,10 @@
     public static final String KTAB = "localkdc.ktab";
     public static final String JAAS_CONF = "localkdc-jaas.conf";
     public static final String REALM = "RABBIT.HOLE";
-    public static String SERVER = "server/host." + REALM.toLowerCase();
-    public static String BACKEND = "backend/host." + REALM.toLowerCase();
-    public static String KDCHOST = "kdc." + REALM.toLowerCase();
+    public static final String REALM_LOWER_CASE = REALM.toLowerCase(Locale.US);
+    public static String SERVER = "server/host." + REALM_LOWER_CASE;
+    public static String BACKEND = "backend/host." + REALM_LOWER_CASE;
+    public static String KDCHOST = "kdc." + REALM_LOWER_CASE;
     /**
      * Creates the KDC and starts it.
      * @param etype Encryption type, null if not specified
--- a/jdk/test/sun/security/krb5/auto/SSL.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/SSL.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,8 @@
         ServicePermission p = (ServicePermission)perm;
         // ServicePermissions required to create GSSName are ignored
         if (!p.getActions().isEmpty()) {
-            permChecks = permChecks + p.getActions().toUpperCase().charAt(0);
+            permChecks = permChecks
+                + p.getActions().toUpperCase(Locale.US).charAt(0);
         }
     }
 
@@ -94,7 +95,7 @@
         System.setSecurityManager(new SSL());
 
         KDC kdc = KDC.create(OneKDC.REALM);
-        server = "host." + OneKDC.REALM.toLowerCase(Locale.US);
+        server = "host." + OneKDC.REALM_LOWER_CASE;
 
         if (args.length > 2) {
             sniHostname = "test." + server;
--- a/jdk/test/sun/security/krb5/auto/SaslBasic.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/SaslBasic.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.Locale;
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
@@ -46,7 +45,7 @@
     public static void main(String[] args) throws Exception {
 
         boolean bound = args[0].equals("bound");
-        String name = "host." + OneKDC.REALM.toLowerCase(Locale.US);
+        String name = "host." + OneKDC.REALM_LOWER_CASE;
 
         new OneKDC(null).writeJAASConf();
         System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
--- a/jdk/test/sun/security/krb5/auto/SaslGSS.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/SaslGSS.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,6 @@
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.HashMap;
-import java.util.Locale;
 import java.util.logging.ConsoleHandler;
 import java.util.logging.Handler;
 import java.util.logging.Level;
@@ -54,7 +53,7 @@
 
     public static void main(String[] args) throws Exception {
 
-        String name = "host." + OneKDC.REALM.toLowerCase(Locale.US);
+        String name = "host." + OneKDC.REALM_LOWER_CASE;
 
         new OneKDC(null).writeJAASConf();
         System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
--- a/jdk/test/sun/security/provider/NSASuiteB/TestDSAGenParameterSpec.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/provider/NSASuiteB/TestDSAGenParameterSpec.java	Thu Jul 07 18:35:29 2016 +0000
@@ -35,7 +35,6 @@
 /*
  * @test
  * @bug 8075286
- * @key intermittent
  * @summary Verify that DSAGenParameterSpec can and can only be used to generate
  *          DSA within some certain range of key sizes as described in the class
  *          specification (L, N) as (1024, 160), (2048, 224), (2048, 256) and
--- a/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/tools/keytool/DefaultSignatureAlgorithm.java	Thu Jul 07 18:35:29 2016 +0000
@@ -26,6 +26,17 @@
  * @bug 8138766
  * @summary New default -sigalg for keytool
  * @modules java.base/sun.security.tools.keytool
+ * @run main/othervm DefaultSignatureAlgorithm RSA 1024 SHA256withRSA
+ * @run main/othervm DefaultSignatureAlgorithm RSA 3072 SHA256withRSA
+ * @run main/othervm DefaultSignatureAlgorithm RSA 3073 SHA384withRSA
+ * @run main/othervm DefaultSignatureAlgorithm DSA 1024 SHA256withDSA
+ * @run main/othervm/timeout=700 DefaultSignatureAlgorithm DSA 3072
+ *      SHA256withDSA
+ * @run main/othervm DefaultSignatureAlgorithm EC 192 SHA256withECDSA
+ * @run main/othervm DefaultSignatureAlgorithm EC 384 SHA384withECDSA
+ * @run main/othervm DefaultSignatureAlgorithm EC 571 SHA512withECDSA
+ * @run main/othervm DefaultSignatureAlgorithm EC 571 SHA256withECDSA
+ *      SHA256withECDSA
  */
 
 import sun.security.tools.keytool.Main;
@@ -36,29 +47,17 @@
 
 public class DefaultSignatureAlgorithm {
 
-    private static int counter = 0;
-
     public static void main(String[] args) throws Exception {
-
-        // Calculating large RSA keys are too slow.
-        run("RSA", 1024, null, "SHA256withRSA");
-        run("RSA", 3072, null, "SHA256withRSA");
-        run("RSA", 3073, null, "SHA384withRSA");
-
-        run("DSA", 1024, null, "SHA256withDSA");
-        run("DSA", 3072, null, "SHA256withDSA");
-
-        run("EC", 192, null, "SHA256withECDSA");
-        run("EC", 384, null, "SHA384withECDSA");
-        run("EC", 571, null, "SHA512withECDSA");
-
-        // If you specify one, it will be used.
-        run("EC", 571, "SHA256withECDSA", "SHA256withECDSA");
+        if(args == null || args.length < 3) {
+            throw new RuntimeException("Invalid arguments provided.");
+        }
+        String sigAlg = (args.length == 4) ? args[3] : null;
+        run(args[0], Integer.valueOf(args[1]), args[2], sigAlg);
     }
 
     private static void run(String keyAlg, int keySize,
-                    String sigAlg, String expectedSigAlg) throws Exception {
-        String alias = keyAlg + keySize + (counter++);
+                    String expectedSigAlg, String sigAlg) throws Exception {
+        String alias = keyAlg + keySize + System.currentTimeMillis();
         String cmd = "-keystore ks -storepass changeit" +
                 " -keypass changeit -alias " + alias +
                 " -keyalg " + keyAlg + " -keysize " + keySize +
--- a/jdk/test/sun/security/tools/keytool/PrintSSL.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/tools/keytool/PrintSSL.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,36 +21,74 @@
  * questions.
  */
 
-// Read printssl.sh, this Java program starts an SSL server
+/*
+ * @test
+ * @bug 6480981 8160624
+ * @modules java.base/sun.security.tools.keytool
+ * @summary keytool should be able to import certificates from remote SSL server
+ * @run main/othervm PrintSSL
+ */
 
+import java.io.IOException;
 import java.net.ServerSocket;
+import java.util.concurrent.CountDownLatch;
 import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.SSLSocket;
 
 public class PrintSSL {
+
     public static void main(String[] args) throws Exception {
-        System.setProperty("javax.net.ssl.keyStorePassword", "passphrase");
-        System.setProperty("javax.net.ssl.keyStore",
-                           System.getProperty("test.src", "./")
-                               + "/../../../../javax/net/ssl/etc/keystore");
-        SSLServerSocketFactory sslssf =
-                (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
-        final ServerSocket server = sslssf.createServerSocket(0);
-        System.out.println(server.getLocalPort());
-        System.out.flush();
-        Thread t = new Thread() {
-            public void run() {
-                try {
-                    Thread.sleep(30000);
-                    server.close();
-                } catch (Exception e) {
-                    ;
-                }
-                throw new RuntimeException("Timeout");
+
+        int port = new Server().start();
+        if(port == -1) {
+            throw new RuntimeException("Unable start ssl server.");
+        }
+        String vmOpt = System.getProperty("TESTTOOLVMOPTS");
+        String cmd = String.format(
+                "-debug %s -printcert -sslserver localhost:%s",
+                ((vmOpt == null) ? "" : vmOpt ), port);
+        sun.security.tools.keytool.Main.main(cmd.split("\\s+"));
+    }
+
+    private static class Server implements Runnable {
+
+        private volatile int serverPort = -1;
+        private final CountDownLatch untilServerReady = new CountDownLatch(1);
+
+        public int start() throws InterruptedException {
+
+            Thread server = new Thread(this);
+            server.setDaemon(true);
+            server.start();
+            untilServerReady.await();
+            return this.getServerPort();
+        }
+
+        @Override
+        public void run() {
+
+            System.setProperty("javax.net.ssl.keyStorePassword", "passphrase");
+            System.setProperty("javax.net.ssl.keyStore",
+                    System.getProperty("test.src", "./")
+                    + "/../../../../javax/net/ssl/etc/keystore");
+            SSLServerSocketFactory sslssf =
+                    (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
+            try (ServerSocket server = sslssf.createServerSocket(0)) {
+                this.serverPort = server.getLocalPort();
+                System.out.printf("%nServer started on: %s%n", getServerPort());
+                untilServerReady.countDown();
+                ((SSLSocket)server.accept()).startHandshake();
+            } catch (Throwable e) {
+                e.printStackTrace(System.out);
+                untilServerReady.countDown();
             }
-        };
-        t.setDaemon(true);
-        t.start();
-        ((SSLSocket)server.accept()).startHandshake();
+
+        }
+
+        public int getServerPort() {
+            return this.serverPort;
+        }
+
     }
+
 }
--- a/jdk/test/sun/security/tools/keytool/printssl.sh	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#
-# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# @test
-# @bug 6480981
-# @summary keytool should be able to import certificates from remote SSL servers
-
-if [ "${TESTSRC}" = "" ] ; then
-  TESTSRC="."
-fi
-if [ "${TESTJAVA}" = "" ] ; then
-  echo "TESTJAVA not set.  Test cannot execute."
-  echo "FAILED!!!"
-  exit 1
-fi
-if [ "${COMPILEJAVA}" = "" ]; then
-  COMPILEJAVA="${TESTJAVA}"
-fi
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
-  SunOS | Linux | Darwin | AIX )
-    FS="/"
-    ;;
-  CYGWIN* )
-    FS="/"
-    ;;
-  Windows_* )
-    FS="\\"
-    ;;
-  * )
-    echo "Unrecognized operating system!"
-    exit 1;
-    ;;
-esac
-
-${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}PrintSSL.java || exit 10
-${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=$TESTSRC PrintSSL | (
-      read PORT
-      if [ "$PORT" = "" ]; then
-          echo "Server not started"
-          exit 2
-      else
-          ${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -sslserver localhost:$PORT
-      fi
-)
-status=$?
-
-rm PrintSSL*.class
-
-exit $status
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/x509/URICertStore/AIA	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,1 @@
+127.0.0.1 ldap.host.for.aia
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/x509/URICertStore/CRLDP	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,1 @@
+127.0.0.1 ldap.host.for.crldp
\ No newline at end of file
--- a/jdk/test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java	Thu Jul 07 18:21:23 2016 +0000
+++ b/jdk/test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java	Thu Jul 07 18:35:29 2016 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,33 +23,34 @@
  * questions.
  */
 
+import java.io.ByteArrayInputStream;
+import java.io.File;
 import java.io.IOException;
-import java.io.StringBufferInputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.security.cert.CertPath;
 import java.security.cert.CertPathValidator;
 import java.security.cert.CertPathValidatorException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
 import java.security.cert.PKIXParameters;
 import java.security.cert.TrustAnchor;
 import java.security.cert.X509Certificate;
-import java.text.DateFormat;
-import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Locale;
 import java.util.Set;
+import java.util.function.Consumer;
 
 /*
  * @test
  * @bug 8134708
  * @summary Check if LDAP resources from CRLDP and AIA extensions can be loaded
- * @run main/othervm ExtensionsWithLDAP
+ * @run main/othervm ExtensionsWithLDAP CRLDP ldap.host.for.crldp
+ * @run main/othervm ExtensionsWithLDAP AIA ldap.host.for.aia
  */
 public class ExtensionsWithLDAP {
 
@@ -125,29 +126,18 @@
         + "hnxn9+e0Ah+t8dS5EKfn44w5bI5PCu2bqxs6RCTxNjcY\n"
         + "-----END CERTIFICATE-----";
 
-
-    private static final String LDAP_HOST_CRLDP = "ldap.host.for.crldp";
-    private static final String LDAP_HOST_AIA = "ldap.host.for.aia";
+    public static void main(String[] args) throws Exception {
+        String extension = args[0];
+        String targetHost = args[1];
 
-    // a date within the certificates validity period
-    static final Date validationDate;
-    static {
-        try {
-            validationDate = DateFormat.getDateInstance(
-                    DateFormat.MEDIUM, Locale.US).parse("Sep 02, 2015");
-        } catch (ParseException e) {
-            throw new RuntimeException("Couldn't parse date", e);
-        }
-    }
-
-    public static void main(String[] args) throws Exception {
         // enable CRLDP and AIA extensions
         System.setProperty("com.sun.security.enableCRLDP", "true");
         System.setProperty("com.sun.security.enableAIAcaIssuers", "true");
 
-        // register a local name service
-        String hostsFileName = System.getProperty("test.src", ".") + "/ExtensionsWithLDAPHosts";
-        System.setProperty("jdk.net.hosts.file", hostsFileName);
+        Path hostsFilePath = Paths.get(System.getProperty("test.src", ".")
+                + File.separator + extension);
+        System.setProperty("jdk.net.hosts.file",
+                hostsFilePath.toFile().getAbsolutePath());
 
         X509Certificate trustedCert = loadCertificate(CA_CERT);
         X509Certificate eeCert = loadCertificate(EE_CERT);
@@ -158,31 +148,29 @@
         CertPath cp = (CertPath) CertificateFactory.getInstance("X509")
                 .generateCertPath(Arrays.asList(eeCert));
 
-        PKIXParameters params = new PKIXParameters(trustedCertsSet);
-        params.setDate(validationDate);
-
-        // certpath validator should try to parse CRLDP and AIA extensions,
-        // and load CRLs/certs which they point to
-        // if a local name service catched requests for resolving host names
-        // which extensions contain, then it means that certpath validator
-        // tried to load CRLs/certs which they point to
-        try {
-            CertPathValidator.getInstance("PKIX").validate(cp, params);
+        // CertPath validator should try to parse CRLDP and AIA extensions,
+        // and load CRLs/certs which they point to.
+        // If proxy server catches requests for resolving host names
+        // which extensions contain, then it means that CertPath validator
+        // tried to load CRLs/certs which they point to.
+        List<String> hosts = new ArrayList<>();
+        Consumer<Socket> socketConsumer = (Socket socket) -> {
+            InetSocketAddress remoteAddress
+                    = (InetSocketAddress) socket.getRemoteSocketAddress();
+            hosts.add(remoteAddress.getHostName());
+        };
+        try (SocksProxy proxy = SocksProxy.startProxy(socketConsumer)) {
+            CertPathValidator.getInstance("PKIX").validate(cp,
+                    new PKIXParameters(trustedCertsSet));
             throw new RuntimeException("CertPathValidatorException not thrown");
         } catch (CertPathValidatorException cpve) {
             System.out.println("Expected exception: " + cpve);
         }
 
-        // check if it tried to resolve a host name from CRLDP extension
-        if (!LocalNameService.requestedHosts.contains(LDAP_HOST_CRLDP)) {
+        if (!hosts.contains(targetHost)) {
             throw new RuntimeException(
-                    "A hostname from CRLDP extension not requested");
-        }
-
-        // check if it tried to resolve a host name from AIA extension
-        if (!LocalNameService.requestedHosts.contains(LDAP_HOST_AIA)) {
-            throw new RuntimeException(
-                    "A hostname from AIA extension not requested");
+                    String.format("The %s from %s extension is not requested",
+                            targetHost, extension));
         }
 
         System.out.println("Test passed");
@@ -192,15 +180,9 @@
     public static X509Certificate loadCertificate(String s)
             throws IOException, CertificateException {
 
-        try (StringBufferInputStream is = new StringBufferInputStream(s)) {
+        try (ByteArrayInputStream is = new ByteArrayInputStream(s.getBytes())) {
             return (X509Certificate) CertificateFactory.getInstance("X509")
                     .generateCertificate(is);
         }
     }
-
-    // a local name service which log requested host names
-    public static class LocalNameService {
-
-        static final List<String> requestedHosts = new ArrayList<>();
-                }
-                }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/x509/URICertStore/SocksProxy.java	Thu Jul 07 18:35:29 2016 +0000
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.Objects;
+import java.util.function.Consumer;
+
+import javax.net.ServerSocketFactory;
+
+/*
+ * A simple socks4 proxy for traveling socket.
+ */
+class SocksProxy implements Runnable, AutoCloseable {
+
+    private ServerSocket server;
+    private Consumer<Socket> socketConsumer;
+
+    private SocksProxy(ServerSocket server, Consumer<Socket> socketConsumer) {
+        this.server = server;
+        this.socketConsumer = socketConsumer;
+    }
+
+    static SocksProxy startProxy(Consumer<Socket> socketConsumer)
+            throws IOException {
+        Objects.requireNonNull(socketConsumer, "socketConsumer cannot be null");
+
+        ServerSocket server
+                = ServerSocketFactory.getDefault().createServerSocket(0);
+
+        System.setProperty("socksProxyHost", "127.0.0.1");
+        System.setProperty("socksProxyPort",
+                String.valueOf(server.getLocalPort()));
+        System.setProperty("socksProxyVersion", "4");
+
+        SocksProxy proxy = new SocksProxy(server, socketConsumer);
+        Thread proxyThread = new Thread(proxy, "Proxy");
+        proxyThread.setDaemon(true);
+        proxyThread.start();
+
+        return proxy;
+    }
+
+    @Override
+    public void run() {
+        while (!server.isClosed()) {
+            try(Socket socket = server.accept()) {
+                System.out.println("Server: accepted connection");
+                if (socketConsumer != null) {
+                    socketConsumer.accept(socket);
+                }
+            } catch (IOException e) {
+                if (!server.isClosed()) {
+                    throw new RuntimeException(
+                            "Server: accept connection failed", e);
+                } else {
+                    System.out.println("Server is closed.");
+                }
+            }
+        }
+    }
+
+    @Override
+    public void close() throws Exception {
+        if (!server.isClosed()) {
+            server.close();
+        }
+    }
+
+    int getPort() {
+        return server.getLocalPort();
+    }
+}
--- a/jdk/test/tools/jlink/JLinkOptimTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Stream;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.tree.AbstractInsnNode;
-import jdk.internal.org.objectweb.asm.tree.ClassNode;
-import jdk.internal.org.objectweb.asm.tree.MethodInsnNode;
-import jdk.internal.org.objectweb.asm.tree.MethodNode;
-import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
-import jdk.tools.jlink.internal.PluginRepository;
-import jdk.tools.jlink.internal.ModulePoolImpl;
-import jdk.tools.jlink.internal.plugins.OptimizationPlugin;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPlugin;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.tools.jlink.internal.plugins.optim.ControlFlow;
-import jdk.tools.jlink.internal.plugins.optim.ControlFlow.Block;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-import tests.Helper;
-import tests.JImageGenerator;
-
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
- /*
- * @test
- * @summary Test image creation with class optimization
- * @author Jean-Francois Denise
- * @library ../lib
- * @modules java.base/jdk.internal.jimage
- *          jdk.jdeps/com.sun.tools.classfile
- *          jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jmod
- *          jdk.jlink/jdk.tools.jimage
- *          jdk.jlink/jdk.tools.jlink.internal.plugins
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.optim
- *          java.base/jdk.internal.org.objectweb.asm
- *          java.base/jdk.internal.org.objectweb.asm.tree
- *          java.base/jdk.internal.org.objectweb.asm.util
- *          jdk.compiler
- * @build tests.*
- * @run main JLinkOptimTest
- */
-public class JLinkOptimTest {
-
-    private static final String EXPECTED = "expected";
-    private static Helper helper;
-
-    public static class ControlFlowPlugin extends AsmPlugin {
-
-        private boolean called;
-        private int numMethods;
-        private int numBlocks;
-
-        private static final String NAME = "test-optim";
-
-        private ControlFlowPlugin() {
-        }
-
-        @Override
-        public void visit(AsmPools pools) {
-            called = true;
-            for (AsmModulePool p : pools.getModulePools()) {
-
-                p.visitClassReaders((reader) -> {
-                    ClassNode cn = new ClassNode();
-                    if ((reader.getAccess() & Opcodes.ACC_INTERFACE) == 0) {
-                        reader.accept(cn, ClassReader.EXPAND_FRAMES);
-                        for (MethodNode m : cn.methods) {
-                            if ((m.access & Opcodes.ACC_ABSTRACT) == 0
-                                    && (m.access & Opcodes.ACC_NATIVE) == 0) {
-                                numMethods += 1;
-                                try {
-                                    ControlFlow f
-                                            = ControlFlow.createControlFlow(cn.name, m);
-                                    for (Block b : f.getBlocks()) {
-                                        numBlocks += 1;
-                                        f.getClosure(b);
-                                    }
-                                } catch (Throwable ex) {
-                                    //ex.printStackTrace();
-                                    throw new RuntimeException("Exception in "
-                                            + cn.name + "." + m.name, ex);
-                                }
-                            }
-                        }
-                    }
-                    return null;
-                });
-            }
-        }
-
-        @Override
-        public String getName() {
-            return NAME;
-        }
-    }
-
-    private static void testForName() throws Exception {
-        String moduleName = "optimplugin";
-        Path src = Paths.get(System.getProperty("test.src")).resolve(moduleName);
-        Path classes = helper.getJmodClassesDir().resolve(moduleName);
-        JImageGenerator.compile(src, classes);
-
-        FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
-        Path root = fs.getPath("/modules/java.base");
-        // Access module-info.class to be reused as fake module-info.class
-        List<ModuleEntry> javabaseResources = new ArrayList<>();
-        try (Stream<Path> stream = Files.walk(root)) {
-            for (Iterator<Path> iterator = stream.iterator(); iterator.hasNext();) {
-                Path p = iterator.next();
-                if (Files.isRegularFile(p)) {
-                    try {
-                        javabaseResources.add(ModuleEntry.create(p.toString().
-                                substring("/modules".length()), Files.readAllBytes(p)));
-                    } catch (Exception ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-        }
-
-        //forName folding
-        ModulePoolImpl pool = new ModulePoolImpl();
-        byte[] content = Files.readAllBytes(classes.
-                resolve("optim").resolve("ForNameTestCase.class"));
-        byte[] content2 = Files.readAllBytes(classes.
-                resolve("optim").resolve("AType.class"));
-        byte[] mcontent = Files.readAllBytes(classes.resolve("module-info.class"));
-
-        pool.add(ModuleEntry.create("/optimplugin/optim/ForNameTestCase.class", content));
-        pool.add(ModuleEntry.create("/optimplugin/optim/AType.class", content2));
-        pool.add(ModuleEntry.create("/optimplugin/module-info.class", mcontent));
-
-        for (ModuleEntry r : javabaseResources) {
-            pool.add(r);
-        }
-
-        OptimizationPlugin plugin = new OptimizationPlugin();
-        Map<String, String> optional = new HashMap<>();
-        optional.put(OptimizationPlugin.NAME, OptimizationPlugin.FORNAME_REMOVAL);
-        optional.put(OptimizationPlugin.LOG, "forName.log");
-        plugin.configure(optional);
-        ModulePool out = new ModulePoolImpl();
-        plugin.visit(pool, out);
-
-        ModuleEntry result = out.entries().iterator().next();
-
-        ClassReader optimReader = new ClassReader(result.getBytes());
-        ClassNode optimClass = new ClassNode();
-        optimReader.accept(optimClass, ClassReader.EXPAND_FRAMES);
-
-        if (!optimClass.name.equals("optim/ForNameTestCase")) {
-            throw new Exception("Invalid class " + optimClass.name);
-        }
-        if (optimClass.methods.size() < 2) {
-            throw new Exception("Not enough methods in new class");
-        }
-        for (MethodNode mn : optimClass.methods) {
-            if (!mn.name.contains("forName") && !mn.name.contains("<clinit>")) {
-                continue;
-            }
-            if (mn.name.startsWith("negative")) {
-                checkForName(mn);
-            } else {
-                checkNoForName(mn);
-            }
-        }
-        Map<String, byte[]> newClasses = new HashMap<>();
-        newClasses.put("optim.ForNameTestCase", result.getBytes());
-        newClasses.put("optim.AType", content2);
-        MemClassLoader loader = new MemClassLoader(newClasses);
-        Class<?> loaded = loader.loadClass("optim.ForNameTestCase");
-        if (loaded.getDeclaredMethods().length < 2) {
-            throw new Exception("Not enough methods in new class");
-        }
-        for (Method m : loaded.getDeclaredMethods()) {
-            if (m.getName().contains("Exception")) {
-                try {
-                    m.invoke(null);
-                } catch (Exception ex) {
-                    //ex.getCause().printStackTrace();
-                    if (!ex.getCause().getMessage().equals(EXPECTED)) {
-                        throw new Exception("Unexpected exception " + ex);
-                    }
-                }
-            } else if (!m.getName().startsWith("negative")) {
-                Class<?> clazz = (Class<?>) m.invoke(null);
-                if (clazz != String.class && clazz != loader.findClass("optim.AType")) {
-                    throw new Exception("Invalid class " + clazz);
-                }
-            }
-        }
-    }
-
-    private static void checkNoForName(MethodNode m) throws Exception {
-        Iterator<AbstractInsnNode> it = m.instructions.iterator();
-        while (it.hasNext()) {
-            AbstractInsnNode n = it.next();
-            if (n instanceof MethodInsnNode) {
-                MethodInsnNode met = (MethodInsnNode) n;
-                if (met.name.equals("forName")
-                        && met.owner.equals("java/lang/Class")
-                        && met.desc.equals("(Ljava/lang/String;)Ljava/lang/Class;")) {
-                    throw new Exception("forName not removed in " + m.name);
-                }
-            }
-        }
-        for (TryCatchBlockNode tcb : m.tryCatchBlocks) {
-            if (tcb.type.equals(ClassNotFoundException.class.getName().replaceAll("\\.", "/"))) {
-                throw new Exception("ClassNotFoundException Block not removed for " + m.name);
-            }
-        }
-    }
-
-    private static void checkForName(MethodNode m) throws Exception {
-        Iterator<AbstractInsnNode> it = m.instructions.iterator();
-        boolean found = false;
-        while (it.hasNext()) {
-            AbstractInsnNode n = it.next();
-            if (n instanceof MethodInsnNode) {
-                MethodInsnNode met = (MethodInsnNode) n;
-                if (met.name.equals("forName")
-                        && met.owner.equals("java/lang/Class")
-                        && met.desc.equals("(Ljava/lang/String;)Ljava/lang/Class;")) {
-                    found = true;
-                    break;
-                }
-            }
-        }
-        if (!found) {
-            throw new Exception("forName removed but shouldn't have");
-        }
-        found = false;
-        for (TryCatchBlockNode tcb : m.tryCatchBlocks) {
-            if (tcb.type.equals(ClassNotFoundException.class.getName().replaceAll("\\.", "/"))) {
-                found = true;
-                break;
-            }
-        }
-        if (!found) {
-            throw new Exception("tryCatchBlocks removed but shouldn't have");
-        }
-    }
-
-    static class MemClassLoader extends ClassLoader {
-
-        private final Map<String, byte[]> classes;
-        private final Map<String, Class<?>> cache = new HashMap<>();
-
-        MemClassLoader(Map<String, byte[]> classes) {
-            super(null);
-            this.classes = classes;
-        }
-
-        @Override
-        public Class findClass(String name) throws ClassNotFoundException {
-            Class<?> clazz = cache.get(name);
-            if (clazz == null) {
-                byte[] b = classes.get(name);
-                if (b == null) {
-                    return super.findClass(name);
-                } else {
-                    clazz = defineClass(name, b, 0, b.length);
-                    cache.put(name, clazz);
-                }
-            }
-            return clazz;
-        }
-    }
-
-    public static void main(String[] args) throws Exception {
-        helper = Helper.newHelper();
-        if (helper == null) {
-            System.err.println("Test not run");
-            return;
-        }
-
-        testForName();
-
-        helper.generateDefaultModules();
-        helper.generateDefaultJModule("optim1", "java.se");
-        {
-            String[] userOptions = {"--class-optim=all:log=./class-optim-log.txt"};
-
-            Path imageDir = helper.generateDefaultImage(userOptions, "optim1").assertSuccess();
-            helper.checkImage(imageDir, "optim1", null, null);
-        }
-
-        {
-            String[] userOptions = {"--class-optim=forName-folding:log=./class-optim-log.txt"};
-            Path imageDir = helper.generateDefaultImage(userOptions, "optim1").assertSuccess();
-            helper.checkImage(imageDir, "optim1", null, null);
-        }
-
-        {
-            ControlFlowPlugin plugin = new ControlFlowPlugin();
-            PluginRepository.registerPlugin(plugin);
-            String[] userOptions = {"--test-optim"};
-            Path imageDir = helper.generateDefaultImage(userOptions, "optim1").assertSuccess();
-            helper.checkImage(imageDir, "optim1", null, null);
-            //System.out.println("Num methods analyzed " + provider.numMethods
-            //        + "num blocks " + provider.numBlocks);
-            if (!plugin.called) {
-                throw new Exception("Plugin not called");
-            }
-            if (plugin.numMethods < 1000) {
-                throw new Exception("Not enough method called,  should be "
-                        + "around 10000 but is " + plugin.numMethods);
-            }
-            if (plugin.numBlocks < 100000) {
-                throw new Exception("Not enough blocks,  should be "
-                        + "around 640000 but is " + plugin.numMethods);
-            }
-        }
-    }
-
-}
--- a/jdk/test/tools/jlink/asmplugin/AddForgetResourcesTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test resource transformation.
- * @author Andrei Eremeev
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- *          jdk.jdeps/com.sun.tools.classfile
- * @build AsmPluginTestBase
- * @run main AddForgetResourcesTest
-*/
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import com.sun.tools.classfile.ClassFile;
-import com.sun.tools.classfile.Method;
-import java.io.UncheckedIOException;
-import java.util.Set;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.tools.jlink.internal.plugins.asm.AsmGlobalPool;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.ResourceFile;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.WritableClassPool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.WritableResourcePool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class AddForgetResourcesTest extends AsmPluginTestBase {
-
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new AddForgetResourcesTest().test();
-    }
-
-    @Override
-    public void test() throws Exception {
-        TestPlugin[] plugins = new TestPlugin[] {
-                new AddClassesPlugin(),
-                new AddResourcesPlugin(),
-                new ReplaceClassesPlugin(),
-                new ReplaceResourcesPlugin(),
-                new ForgetClassesPlugin(),
-                new ForgetResourcesPlugin(),
-                new AddForgetClassesPlugin(),
-                new AddForgetResourcesPlugin(),
-                new ComboPlugin()
-        };
-        for (TestPlugin p : plugins) {
-            ModulePool out = p.visit(getPool());
-            p.test(getPool(), out);
-        }
-    }
-
-    private static final String SUFFIX = "HELLOWORLD";
-
-    private static class RenameClassVisitor extends ClassVisitor {
-
-        public RenameClassVisitor(ClassWriter cv) {
-            super(Opcodes.ASM5, cv);
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            super.visit(version, access, name + SUFFIX, signature, superName, interfaces);
-        }
-    }
-
-    private static class AddMethodClassVisitor extends ClassVisitor {
-
-        public AddMethodClassVisitor(ClassWriter cv) {
-            super(Opcodes.ASM5, cv);
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            this.visitMethod(0, SUFFIX, "()V", null, null);
-            super.visit(version, access, name, signature, superName, interfaces);
-        }
-    }
-
-    private class AddClassesPlugin extends TestPlugin {
-
-        private int expected = 0;
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            WritableClassPool transformedClasses = globalPool.getTransformedClasses();
-            expected = globalPool.getClasses().size();
-            for (ModuleEntry res : globalPool.getClasses()) {
-                ClassReader reader = globalPool.getClassReader(res);
-                String className = reader.getClassName();
-                if (!className.endsWith("module-info")) {
-                    ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                    reader.accept(new RenameClassVisitor(writer), ClassReader.EXPAND_FRAMES);
-                    transformedClasses.addClass(writer);
-                    ++expected;
-                }
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) {
-            Collection<ModuleEntry> inClasses = extractClasses(inResources);
-            Collection<ModuleEntry> outClasses = extractClasses(outResources);
-            if (expected != outClasses.size()) {
-                throw new AssertionError("Classes were not added. Expected: " + expected
-                        + ", got: " + outClasses.size());
-            }
-            for (ModuleEntry in : inClasses) {
-                String path = in.getPath();
-                if (!outClasses.contains(in)) {
-                    throw new AssertionError("Class not found: " + path);
-                }
-                if (path.endsWith("module-info.class")) {
-                    continue;
-                }
-                String modifiedPath = path.replace(".class", SUFFIX + ".class");
-                if (!outClasses.contains(ModuleEntry.create(modifiedPath, new byte[0]))) {
-                    throw new AssertionError("Class not found: " + modifiedPath);
-                }
-            }
-        }
-    }
-
-    private class AddResourcesPlugin extends TestPlugin {
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            for (ModuleEntry res : globalPool.getResourceFiles()) {
-                String path = res.getPath();
-                String moduleName = getModule(path);
-                AsmModulePool modulePool = pools.getModulePool(moduleName);
-                WritableResourcePool resourcePool = modulePool.getTransformedResourceFiles();
-                resourcePool.addResourceFile(new ResourceFile(removeModule(res.getPath()) + SUFFIX,
-                        res.getBytes()));
-            }
-        }
-
-        @Override
-        public void test(ModulePool in, ModulePool out) throws Exception {
-            Collection<ModuleEntry> inResources = extractResources(in);
-            Collection<ModuleEntry> outResources = extractResources(out);
-            if (2 * inResources.size() != outResources.size()) {
-                throw new AssertionError("Classes were not added. Expected: " + (2 * inResources.size())
-                        + ", got: " + outResources.size());
-            }
-            for (ModuleEntry r : inResources) {
-                String path = r.getPath();
-                if (!outResources.contains(r)) {
-                    throw new AssertionError("Class not found: " + path);
-                }
-                String modifiedPath = path + SUFFIX;
-                if (!outResources.contains(ModuleEntry.create(modifiedPath, new byte[0]))) {
-                    throw new AssertionError("Class not found: " + modifiedPath);
-                }
-            }
-        }
-    }
-
-    private class ReplaceClassesPlugin extends TestPlugin {
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            WritableClassPool transformedClasses = globalPool.getTransformedClasses();
-            for (ModuleEntry res : globalPool.getClasses()) {
-                ClassReader reader = globalPool.getClassReader(res);
-                ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                reader.accept(new AddMethodClassVisitor(writer), ClassReader.EXPAND_FRAMES);
-                transformedClasses.addClass(writer);
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            Collection<ModuleEntry> inClasses = extractClasses(inResources);
-            Collection<ModuleEntry> outClasses = extractClasses(outResources);
-            if (inClasses.size() != outClasses.size()) {
-                throw new AssertionError("Number of classes. Expected: " + (inClasses.size())
-                        + ", got: " + outClasses.size());
-            }
-            for (ModuleEntry out : outClasses) {
-                String path = out.getPath();
-                if (!inClasses.contains(out)) {
-                    throw new AssertionError("Class not found: " + path);
-                }
-                ClassFile cf = ClassFile.read(new ByteArrayInputStream(out.getBytes()));
-                if (path.endsWith("module-info.class")) {
-                    continue;
-                }
-                boolean failed = true;
-                for (Method m : cf.methods) {
-                    if (m.getName(cf.constant_pool).equals(SUFFIX)) {
-                        failed = false;
-                    }
-                }
-                if (failed) {
-                    throw new AssertionError("Not found method with name " + SUFFIX + " in class " + path);
-                }
-            }
-        }
-    }
-
-    private class ReplaceResourcesPlugin extends TestPlugin {
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            for (ModuleEntry res : globalPool.getResourceFiles()) {
-                String path = res.getPath();
-                AsmModulePool modulePool = pools.getModulePool(getModule(path));
-                modulePool.getTransformedResourceFiles().addResourceFile(new ResourceFile(removeModule(path),
-                        "HUI".getBytes()));
-            }
-        }
-
-        @Override
-        public void test(ModulePool in, ModulePool out) throws Exception {
-            Collection<ModuleEntry> inResources = extractResources(in);
-            Collection<ModuleEntry> outResources = extractResources(out);
-            if (inResources.size() != outResources.size()) {
-                throw new AssertionError("Number of resources. Expected: " + inResources.size()
-                        + ", got: " + outResources.size());
-            }
-            for (ModuleEntry r : outResources) {
-                String path = r.getPath();
-                if (!inResources.contains(r)) {
-                    throw new AssertionError("Resource not found: " + path);
-                }
-                String content = new String(r.getBytes());
-                if (!"HUI".equals(content)) {
-                    throw new AssertionError("Content expected: 'HUI', got: " + content);
-                }
-            }
-        }
-    }
-
-    private class ForgetClassesPlugin extends TestPlugin {
-
-        private int expected = 0;
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            WritableClassPool transformedClasses = globalPool.getTransformedClasses();
-            int i = 0;
-            for (ModuleEntry res : globalPool.getClasses()) {
-                String path = removeModule(res.getPath());
-                String className = path.replace(".class", "");
-                if ((i & 1) == 0 && !className.endsWith("module-info")) {
-                    transformedClasses.forgetClass(className);
-                } else {
-                    ++expected;
-                }
-                i ^= 1;
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            Collection<ModuleEntry> outClasses = extractClasses(outResources);
-            if (expected != outClasses.size()) {
-                throw new AssertionError("Number of classes. Expected: " + expected +
-                        ", got: " + outClasses.size());
-            }
-        }
-    }
-
-    private class ForgetResourcesPlugin extends TestPlugin {
-
-        private int expectedAmount = 0;
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            int i = 0;
-            for (ModuleEntry res : globalPool.getResourceFiles()) {
-                String path = res.getPath();
-                if (!path.contains("META-INF/services")) {
-                    if ((i & 1) == 0) {
-                        AsmModulePool modulePool = pools.getModulePool(getModule(path));
-                        modulePool.getTransformedResourceFiles().forgetResourceFile(removeModule(res.getPath()));
-                    } else {
-                        ++expectedAmount;
-                    }
-                    i ^= 1;
-                } else {
-                    ++expectedAmount;
-                }
-            }
-        }
-
-        @Override
-        public void test(ModulePool in, ModulePool out) throws Exception {
-            Collection<ModuleEntry> outResources = extractResources(out);
-            if (expectedAmount != outResources.size()) {
-                throw new AssertionError("Number of classes. Expected: " + expectedAmount
-                        + ", got: " + outResources.size());
-            }
-        }
-    }
-
-    private class AddForgetClassesPlugin extends TestPlugin {
-
-        private int expected = 0;
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            WritableClassPool transformedClasses = globalPool.getTransformedClasses();
-            int i = 0;
-            for (ModuleEntry res : globalPool.getClasses()) {
-                ClassReader reader = globalPool.getClassReader(res);
-                String className = reader.getClassName();
-                ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                if (!className.endsWith("module-info")) {
-                    reader.accept(new RenameClassVisitor(writer), ClassReader.EXPAND_FRAMES);
-                    transformedClasses.addClass(writer);
-                    ++expected;
-                }
-
-                if ((i & 1) == 0 && !className.endsWith("module-info")) {
-                    transformedClasses.forgetClass(className);
-                } else {
-                    ++expected;
-                }
-                i ^= 1;
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            Collection<ModuleEntry> outClasses = extractClasses(outResources);
-            if (expected != outClasses.size()) {
-                throw new AssertionError("Number of classes. Expected: " + expected
-                        + ", got: " + outClasses.size());
-            }
-        }
-    }
-
-    private class AddForgetResourcesPlugin extends TestPlugin {
-
-        private int expectedAmount = 0;
-
-        @Override
-        public void visit() {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            int i = 0;
-            for (ModuleEntry res : globalPool.getResourceFiles()) {
-                String path = res.getPath();
-                String moduleName = getModule(path);
-                if (!path.contains("META-INF")) {
-                    AsmModulePool modulePool = pools.getModulePool(moduleName);
-                    WritableResourcePool transformedResourceFiles = modulePool.getTransformedResourceFiles();
-                    String newPath = removeModule(path) + SUFFIX;
-                    transformedResourceFiles.addResourceFile(new ResourceFile(newPath, res.getBytes()));
-                    if ((i & 1) == 0) {
-                        transformedResourceFiles.forgetResourceFile(newPath);
-                    } else {
-                        ++expectedAmount;
-                    }
-                    i ^= 1;
-                }
-                ++expectedAmount;
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool out) throws Exception {
-            Collection<ModuleEntry> outResources = extractResources(out);
-            if (expectedAmount != outResources.size()) {
-                throw new AssertionError("Number of classes. Expected: " + expectedAmount
-                        + ", got: " + outResources.size());
-            }
-        }
-    }
-
-    private class ComboPlugin extends TestPlugin {
-
-        private class RenameClassVisitor extends ClassVisitor {
-
-            public RenameClassVisitor(ClassWriter cv) {
-                super(Opcodes.ASM5, cv);
-            }
-
-            @Override
-            public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-                super.visit(version, access, name + SUFFIX, signature, superName, interfaces);
-            }
-        }
-
-        @Override
-        public void visit() {
-            try {
-                renameClasses();
-                renameResources();
-            } catch (IOException ex) {
-                throw new UncheckedIOException(ex);
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            if (!isVisitCalled()) {
-                throw new AssertionError("Resources not visited");
-            }
-            AsmGlobalPool globalPool = getPools().getGlobalPool();
-            if (globalPool.getTransformedClasses().getClasses().size() != getClasses().size()) {
-                throw new AssertionError("Number of transformed classes not equal to expected");
-            }
-            // Check that only renamed classes and resource files are in the result.
-            outResources.entries().forEach(r -> {
-                String resourceName = r.getPath();
-                if (resourceName.endsWith(".class") && !resourceName.endsWith("module-info.class")) {
-                    if (!resourceName.endsWith(SUFFIX + ".class")) {
-                        throw new AssertionError("Class not renamed " + resourceName);
-                    }
-                } else if (resourceName.contains("META-INF/services/") && MODULES.containsKey(r.getModule())) {
-                    String newClassName = new String(r.getBytes());
-                    if(!newClassName.endsWith(SUFFIX)) {
-                        throw new AssertionError("Resource file not renamed " + resourceName);
-                    }
-                }
-            });
-        }
-
-        private void renameResources() throws IOException {
-            AsmPools pools = getPools();
-            // Rename the resource Files
-            for (Map.Entry<String, List<String>> mod : MODULES.entrySet()) {
-                String moduleName = mod.getKey();
-                AsmModulePool modulePool = pools.getModulePool(moduleName);
-                for (ModuleEntry res : modulePool.getResourceFiles()) {
-                    ResourceFile resFile = modulePool.getResourceFile(res);
-                    if (resFile.getPath().startsWith("META-INF/services/")) {
-                        String newContent = new String(resFile.getContent()) + SUFFIX;
-                        ResourceFile newResourceFile = new ResourceFile(resFile.getPath(),
-                                newContent.getBytes());
-                        modulePool.getTransformedResourceFiles().addResourceFile(newResourceFile);
-                    }
-                }
-            }
-        }
-
-        private void renameClasses() throws IOException {
-            AsmPools pools = getPools();
-            AsmGlobalPool globalPool = pools.getGlobalPool();
-            WritableClassPool transformedClasses = globalPool.getTransformedClasses();
-            for (ModuleEntry res : globalPool.getClasses()) {
-                if (res.getPath().endsWith("module-info.class")) {
-                    continue;
-                }
-                ClassReader reader = globalPool.getClassReader(res);
-                ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                RenameClassVisitor visitor = new RenameClassVisitor(writer);
-                reader.accept(visitor, ClassReader.EXPAND_FRAMES);
-
-                transformedClasses.forgetClass(reader.getClassName());
-                transformedClasses.addClass(writer);
-            }
-        }
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/AsmPluginTestBase.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-import java.io.IOException;
-import java.net.URI;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import jdk.tools.jlink.internal.ModulePoolImpl;
-import jdk.tools.jlink.internal.StringTable;
-
-import jdk.tools.jlink.internal.plugins.asm.AsmPlugin;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public abstract class AsmPluginTestBase {
-
-    protected static final String TEST_MODULE = "jlink.test";
-    protected static final Map<String, List<String>> MODULES;
-
-    private static final Predicate<ModuleEntry> isClass = r -> r.getPath().endsWith(".class");
-    private final List<String> classes;
-    private final List<String> resources;
-    private final ModulePool pool;
-
-    static {
-        Map<String, List<String>> map = new HashMap<>();
-        map.put("jdk.localedata", new ArrayList<>());
-        map.put("java.base", new ArrayList<>());
-        map.put(TEST_MODULE, new ArrayList<>());
-        MODULES = Collections.unmodifiableMap(map);
-    }
-
-    public static boolean isImageBuild() {
-        Path javaHome = Paths.get(System.getProperty("test.jdk"));
-        Path jmods = javaHome.resolve("jmods");
-        return Files.exists(jmods);
-    }
-
-    public AsmPluginTestBase() {
-        try {
-            List<String> classes = new ArrayList<>();
-            List<String> resources = new ArrayList<>();
-
-            pool = new ModulePoolImpl();
-
-            FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
-            Path root = fs.getPath("/modules");
-
-            List<byte[]> moduleInfos = new ArrayList<>();
-            try (Stream<Path> stream = Files.walk(root)) {
-                for (Iterator<Path> iterator = stream.iterator(); iterator.hasNext(); ) {
-                    Path p = iterator.next();
-                    if (Files.isRegularFile(p)) {
-                        String module = p.toString().substring("/modules/".length());
-                        module = module.substring(0, module.indexOf("/"));
-                        if (MODULES.keySet().contains(module)) {
-                            try {
-                                boolean isModuleInfo = p.endsWith("module-info.class");
-                                if (isModuleInfo) {
-                                    moduleInfos.add(Files.readAllBytes(p));
-                                }
-                                byte[] content = Files.readAllBytes(p);
-                                if (p.toString().endsWith(".class") && !isModuleInfo) {
-                                    classes.add(toClassName(p));
-                                } else if (!isModuleInfo) {
-                                    MODULES.get(module).add(toResourceFile(p));
-                                }
-                                resources.add(toPath(p.toString()));
-                                ModuleEntry res = ModuleEntry.create(toPath(p.toString()), content);
-                                pool.add(res);
-                            } catch (Exception ex) {
-                                throw new RuntimeException(ex);
-                            }
-                        }
-                    }
-                }
-            }
-            // There is more than 10 classes in java.base...
-            if (classes.size() < 10 || pool.getEntryCount() < 10) {
-                throw new AssertionError("Not expected resource or class number");
-            }
-
-            //Add a fake resource file
-            String content = "java.lang.Object";
-            String path = "META-INF/services/com.foo.BarProvider";
-            ModuleEntry resFile = ModuleEntry.create("/" + TEST_MODULE + "/" +
-                    path, content.getBytes());
-            pool.add(resFile);
-            ModuleEntry fakeInfoFile = ModuleEntry.create("/" + TEST_MODULE
-                    + "/module-info.class", moduleInfos.get(0));
-            pool.add(fakeInfoFile);
-            MODULES.get(TEST_MODULE).add(path);
-            for(Map.Entry<String, List<String>> entry : MODULES.entrySet()) {
-                if (entry.getValue().isEmpty()) {
-                    throw new AssertionError("No resource file for " + entry.getKey());
-                }
-            }
-            this.classes = Collections.unmodifiableList(classes);
-            this.resources = Collections.unmodifiableList(resources);
-        } catch (Exception e) {
-            throw new ExceptionInInitializerError(e);
-        }
-    }
-
-    public List<String> getClasses() {
-        return classes;
-    }
-
-    public List<String> getResources() {
-        return resources;
-    }
-
-    public ModulePool getPool() {
-        return pool;
-    }
-
-    public abstract void test() throws Exception;
-
-    public Collection<ModuleEntry> extractClasses(ModulePool pool) {
-        return pool.entries()
-                .filter(isClass)
-                .collect(Collectors.toSet());
-    }
-
-    public Collection<ModuleEntry> extractResources(ModulePool pool) {
-        return pool.entries()
-                .filter(isClass.negate())
-                .collect(Collectors.toSet());
-    }
-
-    public String getModule(String path) {
-        int index = path.indexOf("/", 1);
-        return path.substring(1, index);
-    }
-
-    public String removeModule(String path) {
-        int index = path.indexOf("/", 1);
-        return path.substring(index + 1);
-    }
-
-    private String toPath(String p) {
-        return p.substring("/modules".length());
-    }
-
-    private String toClassName(Path p) {
-        String path = p.toString();
-        path = path.substring("/modules/".length());
-        // remove module
-        if (!path.endsWith("module-info.class")) {
-            path = path.substring(path.indexOf("/") + 1);
-        }
-        path = path.substring(0, path.length() - ".class".length());
-
-        return path;
-    }
-
-    private String toResourceFile(Path p) {
-        String path = p.toString();
-        path = path.substring("/modules/".length());
-        // remove module
-        path = path.substring(path.indexOf("/") + 1);
-
-        return path;
-    }
-
-    public abstract class TestPlugin extends AsmPlugin {
-
-        private AsmPools pools;
-
-        public AsmPools getPools() {
-            return pools;
-        }
-
-        public boolean isVisitCalled() {
-            return pools != null;
-        }
-
-        public ModulePool visit(ModulePool inResources) throws IOException {
-            try {
-                ModulePool outResources = new ModulePoolImpl(inResources.getByteOrder(), new StringTable() {
-                    @Override
-                    public int addString(String str) {
-                        return -1;
-                    }
-
-                    @Override
-                    public String getString(int id) {
-                        return null;
-                    }
-                });
-                visit(inResources, outResources);
-                return outResources;
-            } catch (Exception e) {
-                throw new IOException(e);
-            }
-        }
-
-        @Override
-        public void visit(AsmPools pools) {
-            if (isVisitCalled()) {
-                throw new AssertionError("Visit was called twice");
-            }
-            this.pools = pools;
-            visit();
-        }
-
-        public abstract void visit();
-        public abstract void test(ModulePool inResources, ModulePool outResources) throws Exception;
-
-        @Override
-        public String getName() {
-            return "test-plugin";
-        }
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/BasicTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test basic functionality.
- * @author Jean-Francois Denise
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- * @build AsmPluginTestBase
- * @run main BasicTest
- */
-
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class BasicTest extends AsmPluginTestBase {
-
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new BasicTest().test();
-    }
-
-    @Override
-    public void test() throws Exception {
-        BasicPlugin basicPlugin = new BasicPlugin(getClasses());
-        ModulePool res = basicPlugin.visit(getPool());
-        basicPlugin.test(getPool(), res);
-    }
-
-    private class BasicPlugin extends TestPlugin {
-
-        private final List<String> classes;
-
-        public BasicPlugin(List<String> classes) {
-            this.classes = classes;
-        }
-
-        @Override
-        public void visit() {
-            for (String m : MODULES.keySet()) {
-                AsmModulePool pool = getPools().getModulePool(m);
-                if (pool == null) {
-                    throw new AssertionError(m + " pool not found");
-                }
-                if(!pool.getModuleName().equals(m)) {
-                    throw new AssertionError("Invalid module name " +
-                            pool.getModuleName() + " should be "+ m);
-                }
-                if (pool.getClasses().size() == 0 && !m.equals(TEST_MODULE)) {
-                    throw new AssertionError("Empty pool " + m);
-                }
-                pool.addPackage("toto");
-                if (!pool.getTransformedClasses().getClasses().isEmpty()) {
-                    throw new AssertionError("Should be empty");
-                }
-                for(String res : MODULES.get(m)) {
-                    AsmPool.ResourceFile resFile = pool.getResourceFile(res);
-                    if(resFile == null) {
-                        throw new AssertionError("No resource file for " + res);
-                    }
-                }
-            }
-            try {
-                testPools();
-                testVisitor();
-            } catch (IOException ex) {
-                throw new UncheckedIOException(ex);
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            if (!isVisitCalled()) {
-                throw new AssertionError("Resources not visited");
-            }
-            if (inResources.getEntryCount() != outResources.getEntryCount()) {
-                throw new AssertionError("Input size " + inResources.getEntryCount() +
-                        " != to " + outResources.getEntryCount());
-            }
-        }
-
-        private void testVisitor() throws IOException {
-            List<String> seen = new ArrayList<>();
-            getPools().getGlobalPool().visitClassReaders((reader) -> {
-                String className = reader.getClassName();
-                // Wrong naming of module-info.class in ASM
-                if (className.endsWith("module-info")) {
-                    return null;
-                }
-                if (!classes.contains(className)) {
-                    throw new AssertionError("Class is not expected " + className);
-                }
-                if (getPools().getGlobalPool().getClassReader(className) == null) {
-                    throw new AssertionError("Class not found in pool " + className);
-                }
-                seen.add(className);
-                return null;
-            });
-
-            if (!seen.equals(classes)) {
-                throw new AssertionError("Expected and seen are not equal");
-            }
-        }
-
-        private void testPools() throws IOException {
-            Set<String> remain = new HashSet<>(classes);
-            for (ModuleEntry res : getPools().getGlobalPool().getClasses()) {
-                ClassReader reader = getPools().getGlobalPool().getClassReader(res);
-                String className = reader.getClassName();
-                // Wrong naming of module-info.class in ASM
-                if (className.endsWith("module-info")) {
-                    continue;
-                }
-                if (!classes.contains(className)) {
-                    throw new AssertionError("Class is not expected " + className);
-                }
-                if (getPools().getGlobalPool().getClassReader(className) == null) {
-                    throw new AssertionError("Class " + className + " not found in pool ");
-                }
-                // Check the module pool
-                boolean found = false;
-                for(AsmModulePool mp : getPools().getModulePools()) {
-                    if(mp.getClassReader(className) != null) {
-                        found = true;
-                        break;
-                    }
-                }
-                if(!found) {
-                    throw new AssertionError("No modular pool for " +
-                            className);
-                }
-                remain.remove(className);
-            }
-            if (!remain.isEmpty()) {
-                throw new AssertionError("Remaining classes " + remain);
-            }
-        }
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/IdentityPluginTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test basic functionality.
- * @author Jean-Francois Denise
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- * @build AsmPluginTestBase
- * @run main IdentityPluginTest
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.UncheckedIOException;
-
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.WritableClassPool;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class IdentityPluginTest extends AsmPluginTestBase {
-
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new IdentityPluginTest().test();
-    }
-
-    public void test() throws Exception {
-        IdentityPlugin asm = new IdentityPlugin();
-        ModulePool resourcePool = asm.visit(getPool());
-        asm.test(getPool(), resourcePool);
-    }
-
-    private class IdentityPlugin extends TestPlugin {
-
-        @Override
-        public void visit() {
-            for (ModuleEntry res : getPools().getGlobalPool().getClasses()) {
-                if (res.getPath().endsWith("module-info.class")) {
-                    continue;
-                }
-                ClassReader reader = getPools().getGlobalPool().getClassReader(res);
-                ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                IdentityClassVisitor visitor = new IdentityClassVisitor(writer);
-                reader.accept(visitor, ClassReader.EXPAND_FRAMES);
-                getPools().getGlobalPool().getTransformedClasses().addClass(writer);
-            }
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws IOException {
-            if (outResources.isEmpty()) {
-                throw new AssertionError("Empty result");
-            }
-            if (!isVisitCalled()) {
-                throw new AssertionError("Resources not visited");
-            }
-            WritableClassPool transformedClasses = getPools().getGlobalPool().getTransformedClasses();
-            if (transformedClasses.getClasses().size() != getClasses().size()) {
-                throw new AssertionError("Number of transformed classes not equal to expected");
-            }
-            for (String className : getClasses()) {
-                if (transformedClasses.getClassReader(className) == null) {
-                    throw new AssertionError("Class not transformed " + className);
-                }
-            }
-            outResources.entries().forEach(r -> {
-                if (r.getPath().endsWith(".class") && !r.getPath().endsWith("module-info.class")) {
-                    try {
-                        ClassReader reader = new ClassReader(new ByteArrayInputStream(r.getBytes()));
-                        ClassWriter w = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                        reader.accept(w, ClassReader.EXPAND_FRAMES);
-                    } catch (IOException exp) {
-                        throw new UncheckedIOException(exp);
-                    }
-                }
-            });
-        }
-
-        @Override
-        public String getName() {
-            return "identity-plugin";
-        }
-    }
-
-    private static class IdentityClassVisitor extends ClassVisitor {
-        public IdentityClassVisitor(ClassWriter cv) {
-            super(Opcodes.ASM5, cv);
-        }
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/NegativeTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test basic functionality.
- * @author Andrei Eremeev
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- * @build AsmPluginTestBase
- * @run main NegativeTest
- */
-
-import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.nio.ByteOrder;
-import java.util.Map;
-import java.util.Set;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.tools.jlink.plugin.Plugin;
-import jdk.tools.jlink.internal.ModulePoolImpl;
-import jdk.tools.jlink.internal.StringTable;
-import jdk.tools.jlink.internal.plugins.asm.AsmGlobalPool;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPlugin;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.ResourceFile;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class NegativeTest extends AsmPluginTestBase {
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new NegativeTest().test();
-    }
-
-    @Override
-    public void test() throws Exception {
-        testNull();
-        testUnknownPackage();
-    }
-
-    private void testUnknownPackage() throws Exception {
-        AsmPlugin t = new AsmPlugin() {
-            @Override
-            public void visit(AsmPools pools) {
-                try {
-                    AsmGlobalPool globalPool = pools.getGlobalPool();
-                    AsmModulePool javabase = pools.getModulePool("java.base");
-                    ClassReader cr = new ClassReader(NegativeTest.class.getResourceAsStream("NegativeTest.class"));
-                    ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES);
-                    cr.accept(new RenameClassVisitor(cw), ClassReader.EXPAND_FRAMES);
-                    action(() -> globalPool.getTransformedClasses().addClass(cw),
-                            "Unknown package", PluginException.class);
-                    action(() -> javabase.getTransformedClasses().addClass(cw),
-                            "Unknown package", PluginException.class);
-
-                    ResourceFile newResFile = new ResourceFile("java/aaa/file", new byte[0]);
-                    action(() -> globalPool.getTransformedResourceFiles().addResourceFile(newResFile),
-                            "Unknown package", PluginException.class);
-                    action(() -> javabase.getTransformedResourceFiles().addResourceFile(newResFile),
-                            "Unknown package", PluginException.class);
-
-                    action(() -> globalPool.getTransformedClasses().forgetClass("java/aaa/file"),
-                            "Unknown package", PluginException.class);
-                    action(() -> javabase.getTransformedClasses().forgetClass("java/aaa/file"),
-                            "Unknown package", PluginException.class);
-                    action(() -> globalPool.getTransformedResourceFiles().forgetResourceFile("java/aaa/file"),
-                            "Unknown package", PluginException.class);
-                    action(() -> javabase.getTransformedResourceFiles().forgetResourceFile("java/aaa/file"),
-                            "Unknown package", PluginException.class);
-                } catch (IOException ex) {
-                   throw new UncheckedIOException(ex);
-                }
-            }
-        };
-        ModulePool resources = new ModulePoolImpl(ByteOrder.BIG_ENDIAN, new StringTable() {
-            @Override
-            public int addString(String str) {
-                return -1;
-            }
-
-            @Override
-            public String getString(int id) {
-                throw new UnsupportedOperationException("Not supported yet.");
-            }
-        });
-        t.visit(getPool(), resources);
-    }
-
-    private static class RenameClassVisitor extends ClassVisitor {
-
-        public RenameClassVisitor(ClassWriter cv) {
-            super(Opcodes.ASM5, cv);
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            super.visit(version, access, "RENAMED", signature, superName, interfaces);
-        }
-    }
-
-    private void testNull() throws Exception {
-        AsmPlugin t = new AsmPlugin() {
-            @Override
-            public void visit(AsmPools pools) {
-                action(() -> pools.getModulePool(null), "Module name is null", NullPointerException.class);
-                action(() -> pools.fillOutputResources(null), "Output resource is null", NullPointerException.class);
-            }
-        };
-        ModulePool resources = new ModulePoolImpl(ByteOrder.BIG_ENDIAN, new StringTable() {
-            @Override
-            public int addString(String str) {
-                return -1;
-            }
-
-            @Override
-            public String getString(int id) {
-                throw new UnsupportedOperationException("Not supported yet.");
-            }
-        });
-        action(() -> t.visit(null, resources), "Input resource is null", NullPointerException.class);
-        action(() -> t.visit(resources, null), "Output resource is null", NullPointerException.class);
-        t.visit(resources, resources);
-    }
-
-    private void action(Action action, String message, Class<? extends Exception> expected) {
-        try {
-            System.err.println("Testing: " + message);
-            action.call();
-            throw new AssertionError(message + ": should have failed");
-        } catch (Exception e) {
-            if (!expected.isInstance(e)) {
-                throw new RuntimeException(e);
-            } else {
-                System.err.println("Got exception as expected: " + e);
-            }
-        }
-    }
-
-    private interface Action {
-        void call() throws Exception;
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/PackageMappingTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test plugins
- * @author Andrei Eremeev
- * @modules jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- * @run main PackageMappingTest
- */
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import jdk.tools.jlink.internal.plugins.asm.AsmGlobalPool;
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.ResourceFile;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.WritableResourcePool;
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class PackageMappingTest extends AsmPluginTestBase {
-
-    private final List<String> newFiles = Arrays.asList(
-            "/java.base/a1/bbb/c",
-            "/" + TEST_MODULE + "/a2/bbb/d"
-    );
-
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new PackageMappingTest().test();
-    }
-
-    public void test() throws Exception {
-        TestPlugin[] plugins = new TestPlugin[]{
-            new PackageMappingPlugin(newFiles, false),
-            new PackageMappingPlugin(newFiles, true)
-        };
-        for (TestPlugin p : plugins) {
-            ModulePool pool = p.visit(getPool());
-            p.test(getPool(), pool);
-        }
-    }
-
-    public class PackageMappingPlugin extends TestPlugin {
-
-        private final Map<String, List<ResourceFile>> newFiles;
-        private final boolean testGlobal;
-
-        private String getModuleName(String res) {
-            return res.substring(1, res.indexOf("/", 1));
-        }
-
-        private PackageMappingPlugin(List<String> files, boolean testGlobal) {
-            this.newFiles = new HashMap<>();
-            this.testGlobal = testGlobal;
-            for (String file : files) {
-                String moduleName = getModuleName(file);
-                String path = file.substring(1 + moduleName.length() + 1);
-                newFiles.computeIfAbsent(moduleName, $ -> new ArrayList<>()).add(
-                        new ResourceFile(path, new byte[0]));
-            }
-        }
-
-        @Override
-        public void visit() {
-            testMapToUnknownModule();
-            testMapPackageTwice();
-            testPackageMapping();
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) {
-            Set<String> in = getPools().getGlobalPool().getResourceFiles().stream()
-                    .map(ModuleEntry::getPath)
-                    .collect(Collectors.toSet());
-            Set<String> out = extractResources(outResources).stream()
-                    .map(ModuleEntry::getPath)
-                    .collect(Collectors.toSet());
-            in.addAll(PackageMappingTest.this.newFiles);
-            if (!Objects.equals(in, out)) {
-                throw new AssertionError("Expected: " + in + ", got: " + outResources);
-            }
-        }
-
-        private void testPackageMapping() {
-            AsmGlobalPool globalPool = getPools().getGlobalPool();
-            try {
-                Map<String, Set<String>> mappedPackages = new HashMap<>();
-                Function<String, Set<String>> produceSet = $ -> new HashSet<>();
-                for (Map.Entry<String, List<ResourceFile>> entry : newFiles.entrySet()) {
-                    String moduleName = entry.getKey();
-                    Set<String> module = mappedPackages.computeIfAbsent(moduleName, produceSet);
-                    AsmModulePool modulePool = getPools().getModulePool(moduleName);
-                    for (ResourceFile r : entry.getValue()) {
-                        String name = r.getPath();
-                        String packageName = name.substring(0, name.lastIndexOf('/'));
-                        if (module.add(packageName)) {
-                            globalPool.addPackageModuleMapping(packageName, moduleName);
-                        }
-                        WritableResourcePool transformedResourceFiles = testGlobal
-                                ? globalPool.getTransformedResourceFiles()
-                                : modulePool.getTransformedResourceFiles();
-                        transformedResourceFiles.addResourceFile(r);
-                    }
-                    try {
-                        modulePool.getTransformedResourceFiles().addResourceFile(
-                                new ResourceFile("a3/bbb", new byte[0]));
-                        throw new AssertionError("Exception expected");
-                    } catch (Exception ex) {
-                        // expected
-                    }
-                }
-                try {
-                    globalPool.getTransformedResourceFiles().addResourceFile(
-                            new ResourceFile("a3/bbb", new byte[0]));
-                    throw new AssertionError("Exception expected");
-                } catch (Exception ex) {
-                    // expected
-                }
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        private void testMapPackageTwice() {
-            try {
-                AsmGlobalPool globalPool = getPools().getGlobalPool();
-                globalPool.addPackageModuleMapping("a/p1", TEST_MODULE);
-                globalPool.addPackageModuleMapping("a/p1", TEST_MODULE);
-                throw new AssertionError("Exception expected after mapping a package twice to the same module");
-            } catch (Exception e) {
-                if (e instanceof PluginException) {
-                    // expected
-                    String message = e.getMessage();
-                    if (!(TEST_MODULE + " module already contains package a.p1").equals(message)) {
-                        throw new AssertionError(e);
-                    }
-                } else {
-                    throw new AssertionError(e);
-                }
-            }
-        }
-
-        private void testMapToUnknownModule() {
-            AsmModulePool unknownModule = getPools().getModulePool("UNKNOWN");
-            if (unknownModule != null) {
-                throw new AssertionError("getModulePool returned not null value: " + unknownModule.getModuleName());
-            }
-            try {
-                AsmGlobalPool globalPool = getPools().getGlobalPool();
-                globalPool.addPackageModuleMapping("a/b", "UNKNOWN");
-                throw new AssertionError("Exception expected after mapping a package to unknown module");
-            } catch (Exception e) {
-                String message = e.getMessage();
-                if (message == null || !message.startsWith("Unknown module UNKNOWN")) {
-                    throw new AssertionError(e);
-                }
-            }
-        }
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/SortingTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test resource sorting.
- * @author Jean-Francois Denise
- * @modules jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- * @build AsmPluginTestBase
- * @run main SortingTest
- */
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import jdk.tools.jlink.internal.plugins.asm.AsmModulePool;
-import jdk.tools.jlink.plugin.PluginException;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class SortingTest extends AsmPluginTestBase {
-
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new SortingTest().test();
-    }
-
-    @Override
-    public void test() {
-        try {
-            classSorting();
-            moduleSorting();
-        } catch (Exception ex) {
-            throw new PluginException(ex);
-        }
-    }
-
-    private void classSorting() throws Exception {
-        List<String> sorted = new ArrayList<>(getResources());
-        sorted.sort(null);
-        ClassSorterPlugin sorterPlugin = new ClassSorterPlugin(sorted);
-        ModulePool resourcePool = sorterPlugin.visit(getPool());
-        sorterPlugin.test(getPool(), resourcePool);
-    }
-
-    private String getModuleName(String p) {
-        return p.substring(1, p.indexOf('/', 1));
-    }
-
-    private void moduleSorting() throws Exception {
-        List<String> sorted = new ArrayList<>(getResources());
-        sorted.sort((s1, s2) -> -getModuleName(s1).compareTo(getModuleName(s2)));
-        ModuleSorterPlugin sorterPlugin = new ModuleSorterPlugin();
-        ModulePool resourcePool = sorterPlugin.visit(getPool());
-        sorterPlugin.test(getPool(), resourcePool);
-    }
-
-    private class ModuleSorterPlugin extends TestPlugin {
-
-        @Override
-        public void visit() {
-            for (AsmModulePool modulePool : getPools().getModulePools()) {
-                modulePool.setSorter(resources -> {
-                    List<String> sort = resources.entries()
-                            .map(ModuleEntry::getPath)
-                            .collect(Collectors.toList());
-                    sort.sort(null);
-                    return sort;
-                });
-            }
-            getPools().setModuleSorter(modules -> {
-                modules.sort((s1, s2) -> -s1.compareTo(s2));
-                return modules;
-            });
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            if (!isVisitCalled()) {
-                throw new AssertionError("Resources not visited");
-            }
-            List<String> sortedResourcePaths = outResources.entries()
-                    .map(ModuleEntry::getPath)
-                    .collect(Collectors.toList());
-
-            List<String> defaultResourceOrder = new ArrayList<>();
-            inResources.entries().forEach(r -> {
-                if (!inResources.contains(r)) {
-                    throw new AssertionError("Resource " + r.getPath() + " not in result pool");
-                }
-                defaultResourceOrder.add(r.getPath());
-            });
-            // Check that default sorting is not equal to sorted one
-            if (defaultResourceOrder.equals(sortedResourcePaths)) {
-                throw new AssertionError("Sorting not applied, default ordering");
-            }
-            // Check module order.
-            for (int i = 0; i < sortedResourcePaths.size() - 1; ++i) {
-                String first = sortedResourcePaths.get(i);
-                String p1 = getModuleName(first);
-                String second = sortedResourcePaths.get(i + 1);
-                String p2 = getModuleName(second);
-                if (p1.compareTo(p2) < 0 || p1.compareTo(p2) == 0 &&
-                        removeModule(first).compareTo(removeModule(second)) >= 0) {
-                    throw new AssertionError("Modules are not sorted properly: resources: " + first + " " + second);
-                }
-            }
-        }
-    }
-
-    private class ClassSorterPlugin extends TestPlugin {
-
-        private final List<String> expectedClassesOrder;
-
-        private ClassSorterPlugin(List<String> expectedClassesOrder) {
-            this.expectedClassesOrder = expectedClassesOrder;
-        }
-
-        @Override
-        public void visit() {
-            getPools().getGlobalPool().setSorter(
-                    (resources) -> expectedClassesOrder.stream()
-                            .map(resources::findEntry)
-                            .map(Optional::get)
-                            .map(ModuleEntry::getPath)
-                            .collect(Collectors.toList()));
-        }
-
-        @Override
-        public void test(ModulePool inResources, ModulePool outResources) throws Exception {
-            if (!isVisitCalled()) {
-                throw new AssertionError("Resources not visited");
-            }
-            List<String> sortedResourcePaths = outResources.entries()
-                    .map(ModuleEntry::getPath)
-                    .collect(Collectors.toList());
-
-            List<String> defaultResourceOrder = new ArrayList<>();
-            getPool().entries().forEach(r -> {
-                if (!getPool().contains(r)) {
-                    throw new AssertionError("Resource " + r.getPath() + " not in result pool");
-                }
-                defaultResourceOrder.add(r.getPath());
-            });
-            // Check that default sorting is not equal to sorted one
-            if (defaultResourceOrder.equals(sortedResourcePaths)) {
-                throw new AssertionError("Sorting not applied, default ordering");
-            }
-            // Check that sorted is equal to result.
-            if (!expectedClassesOrder.equals(sortedResourcePaths)) {
-                throw new AssertionError("Sorting not properly applied");
-            }
-        }
-    }
-}
--- a/jdk/test/tools/jlink/asmplugin/VisitorTest.java	Thu Jul 07 18:21:23 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Asm plugin testing.
- * @test
- * @summary Test visitors.
- * @author Andrei Eremeev
- * @modules java.base/jdk.internal.org.objectweb.asm
- *          jdk.jlink/jdk.tools.jlink.internal
- *          jdk.jlink/jdk.tools.jlink.internal.plugins.asm
- * @build AsmPluginTestBase
- * @run main VisitorTest
- */
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.function.Function;
-
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.ClassReaderVisitor;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.ResourceFile;
-import jdk.tools.jlink.internal.plugins.asm.AsmPool.ResourceFileVisitor;
-import jdk.tools.jlink.internal.plugins.asm.AsmPools;
-import jdk.tools.jlink.plugin.ModuleEntry;
-import jdk.tools.jlink.plugin.ModulePool;
-
-public class VisitorTest extends AsmPluginTestBase {
-
-    public static void main(String[] args) throws Exception {
-        if (!isImageBuild()) {
-            System.err.println("Test not run. Not image build.");
-            return;
-        }
-        new VisitorTest().test();
-    }
-
-    @Override
-    public void test() throws Exception {
-        TestPlugin[] plugins = new TestPlugin[] {
-                new ClassVisitorPlugin("Class-global-pool", AsmPools::getGlobalPool),
-                new ClassVisitorPlugin("Class-module-pool", pools -> pools.getModulePool("java.base")),
-                new ResourceVisitorPlugin("Resource-global-pool", AsmPools::getGlobalPool),
-                new ResourceVisitorPlugin("Resource-module-pool", pools -> pools.getModulePool("java.base"))
-        };
-        for (TestPlugin p : plugins) {
-            System.err.println("Testing: " + p.getName());
-            ModulePool out = p.visit(getPool());
-            p.test(getPool(), out);
-        }
-    }
-
-    private static class CustomClassReaderVisitor implements ClassReaderVisitor {
-        private int amount = 0;
-        private int changed = 0;
-
-        @Override
-        public ClassWriter visit(ClassReader reader) {
-            if ((amount++ % 2) == 0) {
-                String className = reader.getClassName();
-                if (className.endsWith("module-info")) {
-                    return null;
-                }
-                ClassWriter cw = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);
-                reader.accept(new ClassVisitor(Opcodes.ASM5, cw) {
-                    @Override
-                    public void visit(int i, int i1, String s, String s1, String s2, String[] strings) {
-                        super.visit(i, i1, s + "Changed", s1, s2, strings);
-                    }
-                }, ClassReader.EXPAND_FRAMES);
-                ++changed;
-                return cw;
-            } else {
-                return null;
-            }
-        }
-
-        public int getAmount() {
-            return amount;
-        }
-
-        public int getNumberOfChanged() {
-            return changed;
-        }
-    }
-
-    private static class CustomResourceFileVisitor implements ResourceFileVisitor {
-        private int amount = 0;
-        private int changed = 0;
-
-        @Override
-        public ResourceFile visit(ResourceFile resourceFile) {
-            if ((amount++ % 2) == 0) {
-                ++changed;
-                return new ResourceFile(resourceFile.getPath() + "Changed", resourceFile.getContent());
-            } else {
-                return null;
-            }
-        }
-
-        public int getAmount() {
-            return amount;
-        }
-
-        public int getNumberOfChanged() {
-            return changed;
-        }
-    }
-
-    public class ClassVisitorPlugin extends TestPlugin {
-
-        private final String name;
-        private final Function<AsmPools, AsmPool> getPool;
-        private final CustomClassReaderVisitor classReaderVisitor = new CustomClassReaderVisitor();
-
-        public ClassVisitorPlugin(String name, Function<AsmPools, AsmPool> getPool) {
-            this.name = name;
-            this.getPool = getPool;
-        }
-
-        @Override
-        public void visit() {
-            AsmPool pool = getPool.apply(getPools());
-            pool.visitClassReaders(classReaderVisitor);
-        }
-
-        @Override
-        public void test(ModulePool in, ModulePool out) throws Exception {
-            Collection<ModuleEntry> inClasses = getPool.apply(getPools()).getClasses();
-            if (inClasses.size() != classReaderVisitor.getAmount()) {
-                throw new AssertionError("Testing " + name + ". Number of visited classes. Expected: " +
-                        inClasses.size() + ", got: " + classReaderVisitor.getAmount());
-            }
-            Collection<ModuleEntry> outClasses = extractClasses(out);
-            int changedClasses = 0;
-            for (ModuleEntry r : outClasses) {
-                if (r.getPath().endsWith("Changed.class")) {
-                    ++changedClasses;
-                }
-            }
-            if (changedClasses != classReaderVisitor.getNumberOfChanged()) {
-                throw new AssertionError("Testing " + name + ". Changed classes. Expected: " + changedClasses +
-                        ", got: " + classReaderVisitor.getNumberOfChanged());
-            }
-        }
-
-        @Override
-        public String getName() {
-            return name;
-        }
-    }
-
-    public class ResourceVisitorPlugin extends TestPlugin {
-
-        private final String name;
-        private final Function<AsmPools, AsmPool> getPool;
-        private final CustomResourceFileVisitor resourceFileVisitor = new CustomResourceFileVisitor();
-
-        public ResourceVisitorPlugin(String name, Function<AsmPools, AsmPool> getPool) {
-            this.name = name;
-            this.getPool = getPool;
-        }
-
-        @Override
-        public void visit() {
-            AsmPool pool = getPool.apply(getPools());
-            pool.visitResourceFiles(resourceFileVisitor);
-        }
-
-        @Override
-        public void test(ModulePool in, ModulePool out) throws Exception {
-            Collection<ModuleEntry> inResources = getPool.apply(getPools()).getResourceFiles();
-            if (inResources.size() != resourceFileVisitor.getAmount()) {
-                throw new AssertionError("Testing " + name + ". Number of visited resources. Expected: " +
-                        inResources.size() + ", got: " + resourceFileVisitor.getAmount());
-            }
-            Collection<ModuleEntry> outResources = extractResources(out);
-            int changedClasses = 0;
-            for (ModuleEntry r : outResources) {
-                if (r.getPath().endsWith("Changed")) {
-                    ++changedClasses;
-                }
-            }
-            if (changedClasses != resourceFileVisitor.getNumberOfChanged()) {
-                throw new AssertionError("Testing " + name + ". Changed classes. Expected: " + changedClasses +
-                        ", got: " + resourceFileVisitor.getNumberOfChanged());
-            }
-        }
-
-        @Override
-        public String getName() {
-            return name;
-        }
-    }
-}