hotspot/test/compiler/c2/8004867/TestIntUnsafeVolatile.java
changeset 38152 80e5da81fb2c
parent 36851 03e2f4d0a421
equal deleted inserted replaced
38151:fffedc5e5cf8 38152:80e5da81fb2c
    30  * @modules java.base/jdk.internal.misc
    30  * @modules java.base/jdk.internal.misc
    31  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeVolatile
    31  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeVolatile
    32  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeVolatile
    32  * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeVolatile
    33  */
    33  */
    34 
    34 
    35 import sun.misc.Unsafe;
    35 import jdk.internal.misc.Unsafe;
    36 import java.lang.reflect.*;
    36 import java.lang.reflect.*;
    37 
    37 
    38 public class TestIntUnsafeVolatile {
    38 public class TestIntUnsafeVolatile {
    39   private static final int ARRLEN = 97;
    39   private static final int ARRLEN = 97;
    40   private static final int ITERS  = 11000;
    40   private static final int ITERS  = 11000;
    45 
    45 
    46   private static final Unsafe unsafe;
    46   private static final Unsafe unsafe;
    47   private static final int BASE;
    47   private static final int BASE;
    48   static {
    48   static {
    49     try {
    49     try {
    50       Class c = TestIntUnsafeVolatile.class.getClassLoader().loadClass("sun.misc.Unsafe");
    50       Class c = TestIntUnsafeVolatile.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe");
    51       Field f = c.getDeclaredField("theUnsafe");
    51       Field f = c.getDeclaredField("theUnsafe");
    52       f.setAccessible(true);
    52       f.setAccessible(true);
    53       unsafe = (Unsafe)f.get(c);
    53       unsafe = (Unsafe)f.get(c);
    54       BASE = unsafe.arrayBaseOffset(int[].class);
    54       BASE = unsafe.arrayBaseOffset(int[].class);
    55     } catch (Exception e) {
    55     } catch (Exception e) {