RFR 8143628: Fork sun.misc.Unsafe and jdk.internal.misc.Unsafe native method tables
Mandy Chung
mandy.chung at oracle.com
Wed Dec 2 21:24:22 UTC 2015
> On Nov 26, 2015, at 1:55 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
> Hi,
>
> This is a request for an optimistic review to fork the sun.misc.Unsafe and jdk.internal.misc.Unsafe native method tables so that we can evolve the latter e.g. for VarHandles unsafe work
>
> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8143628-unsafe-native-jdk/
> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8143628-unsafe-native-hotspot/
Looks good. About the tests, would it be better for these tests be placed in the jdk repo?
Nit: extra lines in the testAccess method in several new tests can be removed.
144 static void testAccess(Object base, long offset) {
145 // Plain
146 {
147 UNSAFE.putDouble(base, offset, 1.0d);
148 double x = UNSAFE.getDouble(base, offset);
149 assertEquals(x, 1.0d, "set double value");
150 }
151
152 // Volatile
153 {
154 UNSAFE.putDoubleVolatile(base, offset, 2.0d);
155 double x = UNSAFE.getDoubleVolatile(base, offset);
156 assertEquals(x, 2.0d, "putVolatile double value");
157 }
158
159
160
161
162 }
More information about the hotspot-compiler-dev
mailing list