> On 2 Dec 2015, at 22:24, Mandy Chung <mandy.ch...@oracle.com> wrote: > > >> On Nov 26, 2015, at 1:55 AM, Paul Sandoz <paul.san...@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? >
That’s my preferred back up plan :-) Something to ponder while waiting for 8143930 (C1 LinearScan...) to be integrated. > 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 } I could remove empty lines in the template between #if/#end blocks but i find it harder to read. So i would prefer to leave this as is. Thanks, Paul.