< prev index next >

test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8136473
  28  * @summary Mismatched stores on same slice possible with Unsafe.Put*Unaligned methods

  29  * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestUnsafeUnalignedMismatchedAccesses
  30  * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses TestUnsafeUnalignedMismatchedAccesses
  31  *
  32  */
  33 
  34 import java.lang.reflect.*;
  35 import jdk.internal.misc.Unsafe;
  36 
  37 public class TestUnsafeUnalignedMismatchedAccesses {
  38 
  39     private static final Unsafe UNSAFE;
  40 
  41     static {
  42         try {
  43             Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
  44             unsafeField.setAccessible(true);
  45             UNSAFE = (Unsafe) unsafeField.get(null);
  46         }
  47         catch (Exception e) {
  48             throw new AssertionError(e);
  49         }
  50     }
  51 




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8136473
  28  * @summary Mismatched stores on same slice possible with Unsafe.Put*Unaligned methods
  29  * @modules java.base/jdk.internal.misc
  30  * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestUnsafeUnalignedMismatchedAccesses
  31  * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses TestUnsafeUnalignedMismatchedAccesses

  32  */
  33 
  34 import java.lang.reflect.*;
  35 import jdk.internal.misc.Unsafe;
  36 
  37 public class TestUnsafeUnalignedMismatchedAccesses {
  38 
  39     private static final Unsafe UNSAFE;
  40 
  41     static {
  42         try {
  43             Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
  44             unsafeField.setAccessible(true);
  45             UNSAFE = (Unsafe) unsafeField.get(null);
  46         }
  47         catch (Exception e) {
  48             throw new AssertionError(e);
  49         }
  50     }
  51 


< prev index next >