equal
deleted
inserted
replaced
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) { |