Lines Matching refs:unsafe
18 import sun.misc.Unsafe;
39 private static Unsafe getUnsafe() throws Exception {
40 Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
43 return (Unsafe) f.get(null);
47 Unsafe unsafe = getUnsafe();
48 check(unsafe.arrayBaseOffset(boolean[].class), vmArrayBaseOffset(boolean[].class),
49 "Unsafe.arrayBaseOffset(boolean[])");
50 check(unsafe.arrayBaseOffset(byte[].class), vmArrayBaseOffset(byte[].class),
51 "Unsafe.arrayBaseOffset(byte[])");
52 check(unsafe.arrayBaseOffset(char[].class), vmArrayBaseOffset(char[].class),
53 "Unsafe.arrayBaseOffset(char[])");
54 check(unsafe.arrayBaseOffset(double[].class), vmArrayBaseOffset(double[].class),
55 "Unsafe.arrayBaseOffset(double[])");
56 check(unsafe.arrayBaseOffset(float[].class), vmArrayBaseOffset(float[].class),
57 "Unsafe.arrayBaseOffset(float[])");
58 check(unsafe.arrayBaseOffset(int[].class), vmArrayBaseOffset(int[].class),
59 "Unsafe.arrayBaseOffset(int[])");
60 check(unsafe.arrayBaseOffset(long[].class), vmArrayBaseOffset(long[].class),
61 "Unsafe.arrayBaseOffset(long[])");
62 check(unsafe.arrayBaseOffset(Object[].class), vmArrayBaseOffset(Object[].class),
63 "Unsafe.arrayBaseOffset(Object[])");
65 check(unsafe.arrayIndexScale(boolean[].class), vmArrayIndexScale(boolean[].class),
66 "Unsafe.arrayIndexScale(boolean[])");
67 check(unsafe.arrayIndexScale(byte[].class), vmArrayIndexScale(byte[].class),
68 "Unsafe.arrayIndexScale(byte[])");
69 check(unsafe.arrayIndexScale(char[].class), vmArrayIndexScale(char[].class),
70 "Unsafe.arrayIndexScale(char[])");
71 check(unsafe.arrayIndexScale(double[].class), vmArrayIndexScale(double[].class),
72 "Unsafe.arrayIndexScale(double[])");
73 check(unsafe.arrayIndexScale(float[].class), vmArrayIndexScale(float[].class),
74 "Unsafe.arrayIndexScale(float[])");
75 check(unsafe.arrayIndexScale(int[].class), vmArrayIndexScale(int[].class),
76 "Unsafe.arrayIndexScale(int[])");
77 check(unsafe.arrayIndexScale(long[].class), vmArrayIndexScale(long[].class),
78 "Unsafe.arrayIndexScale(long[])");
79 check(unsafe.arrayIndexScale(Object[].class), vmArrayIndexScale(Object[].class),
80 "Unsafe.arrayIndexScale(Object[])");
85 long intOffset = unsafe.objectFieldOffset(intField);
86 check(unsafe.getInt(t, intOffset), 0, "Unsafe.getInt(Object, long) - initial");
87 unsafe.putInt(t, intOffset, intValue);
88 check(t.intVar, intValue, "Unsafe.putInt(Object, long, int)");
89 check(unsafe.getInt(t, intOffset), intValue, "Unsafe.getInt(Object, long)");
91 long longOffset = unsafe.objectFieldOffset(longField);
93 check(unsafe.getLong(t, longOffset), 0, "Unsafe.getLong(Object, long) - initial");
94 unsafe.putLong(t, longOffset, longValue);
95 check(t.longVar, longValue, "Unsafe.putLong(Object, long, long)");
96 check(unsafe.getLong(t, longOffset), longValue, "Unsafe.getLong(Object, long)");