RFR [9] 8157825: Remove JDK 9 specific methods from sun.misc.Unsafe

Mandy Chung mandy.chung at oracle.com
Wed May 25 17:52:38 UTC 2016


+1
Mandy

> On May 25, 2016, at 3:43 AM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> 
> 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.




More information about the core-libs-dev mailing list