+1 Let public Unsafe die (at least partially)! :-)
Uwe ----- Uwe Schindler uschind...@apache.org ASF Member, Apache Lucene PMC / Committer Bremen, Germany http://lucene.apache.org/ > -----Original Message----- > From: core-libs-dev [mailto:core-libs-dev-boun...@openjdk.java.net] On > Behalf Of Chris Hegarty > Sent: Wednesday, May 25, 2016 12:43 PM > To: core-libs-dev <core-libs-dev@openjdk.java.net> > Subject: RFR [9] 8157825: Remove JDK 9 specific methods from > sun.misc.Unsafe > > sun.misc.Unsafe, in the jdk.unsupported module, should not have any new > public > methods that were not already part of its API in JDK 8. This issue will remove > three > such methods, getUncompressedObject, getJavaMirror, and > getKlassPointer, that > were added by JDK-8022853, in JDK 9. > > diff --git a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java > b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java > --- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java > +++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java > @@ -296,45 +296,6 @@ > theInternalUnsafe.putDouble(o, offset, x); > } > > - > - // These read VM internal data. > - > - /** > - * Fetches an uncompressed reference value from a given native variable > - * ignoring the VM's compressed references mode. > - * > - * @param address a memory address locating the variable > - * @return the value fetched from the indicated native variable > - */ > - @ForceInline > - public Object getUncompressedObject(long address) { > - return theInternalUnsafe.getUncompressedObject(address); > - } > - > - /** > - * Fetches the {@link java.lang.Class} Java mirror for the given native > - * metaspace {@code Klass} pointer. > - * > - * @param metaspaceKlass a native metaspace {@code Klass} pointer > - * @return the {@link java.lang.Class} Java mirror > - */ > - @ForceInline > - public Class<?> getJavaMirror(long metaspaceKlass) { > - return theInternalUnsafe.getJavaMirror(metaspaceKlass); > - } > - > - /** > - * Fetches a native metaspace {@code Klass} pointer for the given Java > - * object. > - * > - * @param o Java heap object for which to fetch the class pointer > - * @return a native metaspace {@code Klass} pointer > - */ > - @ForceInline > - public long getKlassPointer(Object o) { > - return theInternalUnsafe.getKlassPointer(o); > - } > - > // These work on values in the C heap. > > /** > > -Chris.=