8153737: Unsupported Module
authorchegar
Sat, 09 Apr 2016 20:12:13 +0100
changeset 36966 4209c9e19c45
parent 36965 3b5edcd35ae8
child 36967 d041d2e80712
8153737: Unsupported Module Reviewed-by: alanb, mchung, psandoz
jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java
jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java
jdk/src/java.base/share/classes/module-info.java
jdk/src/java.base/share/classes/sun/misc/CRC16.java
jdk/src/java.base/share/classes/sun/misc/Cache.java
jdk/src/java.base/share/classes/sun/misc/ManagedLocalsThread.java
jdk/src/java.base/share/classes/sun/misc/Signal.java
jdk/src/java.base/share/classes/sun/misc/SignalHandler.java
jdk/src/java.base/share/classes/sun/misc/SoftCache.java
jdk/src/java.base/share/classes/sun/misc/Unsafe.java
jdk/src/java.base/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java
jdk/src/java.base/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java
jdk/src/java.base/unix/classes/sun/misc/GThreadHelper.java
jdk/src/java.base/unix/classes/sun/nio/ch/PollArrayWrapper.java
jdk/src/java.desktop/share/classes/module-info.java
jdk/src/java.logging/share/classes/module-info.java
jdk/src/java.management/share/classes/module-info.java
jdk/src/jdk.crypto.pkcs11/share/classes/module-info.java
jdk/src/jdk.httpserver/share/classes/module-info.java
jdk/src/jdk.unsupported/share/classes/module-info.java
jdk/src/jdk.unsupported/share/classes/sun/misc/ManagedLocalsThread.java
jdk/src/jdk.unsupported/share/classes/sun/misc/Signal.java
jdk/src/jdk.unsupported/share/classes/sun/misc/SignalHandler.java
jdk/src/jdk.unsupported/share/classes/sun/misc/SoftCache.java
jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
jdk/src/jdk.unsupported/unix/classes/sun/misc/GThreadHelper.java
jdk/test/com/sun/jdi/cds/CDSBreakpointTest.java
jdk/test/com/sun/jdi/cds/CDSDeleteAllBkptsTest.java
jdk/test/com/sun/jdi/cds/CDSFieldWatchpoints.java
jdk/test/java/lang/ProcessBuilder/Basic.java
jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java
jdk/test/java/lang/ProcessHandle/Basic.java
jdk/test/java/lang/ProcessHandle/InfoTest.java
jdk/test/java/lang/ProcessHandle/OnExitTest.java
jdk/test/java/lang/ProcessHandle/TreeTest.java
jdk/test/java/lang/invoke/VMAnonymousClass.java
jdk/test/javax/net/ssl/DTLS/TEST.properties
jdk/test/javax/net/ssl/DTLSv10/TEST.properties
jdk/test/javax/net/ssl/ServerName/SSLEngineExplorer.java
jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerMatchedSNI.java
jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerUnmatchedSNI.java
jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerWithCli.java
jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerWithSrv.java
jdk/test/javax/net/ssl/ServerName/SSLSocketExplorer.java
jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java
jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerMatchedSNI.java
jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerUnmatchedSNI.java
jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerWithCliSNI.java
jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerWithSrvSNI.java
jdk/test/javax/security/auth/Subject/SubjectNullTests.java
jdk/test/sun/misc/CopyMemory.java
jdk/test/sun/misc/Safe.java
jdk/test/sun/misc/SunMiscSignalTest.java
jdk/test/sun/reflect/AnonymousNewInstance/ManyNewInstanceAnonTest.java
jdk/test/sun/security/krb5/auto/TEST.properties
jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java
jdk/test/sun/security/pkcs/pkcs9/UnknownAttribute.java
jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java
jdk/test/sun/security/tools/jarsigner/ts.sh
jdk/test/sun/security/x509/X500Name/NullX500Name.java
jdk/test/tools/launcher/modules/addexports/AddExportsTest.java
jdk/test/tools/launcher/modules/addexports/src/m1/jdk/test1/Main.java
jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java
--- a/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
 
 package sun.nio.ch;
 
-import sun.misc.*;
 import java.io.IOException;
 import java.io.FileDescriptor;
 import java.util.Iterator;
--- a/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java	Sat Apr 09 20:12:13 2016 +0100
@@ -36,7 +36,6 @@
 import java.nio.channels.*;
 import java.nio.channels.spi.*;
 import java.util.*;
-import sun.misc.*;
 
 class KQueueSelectorImpl
     extends SelectorImpl
--- a/jdk/src/java.base/share/classes/module-info.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.base/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -86,8 +86,7 @@
     // see JDK-8044773
     exports jdk.net;
 
-    // These will move to a jdk.internal module via JEP-260
-    exports sun.misc;
+    // This will move to a jdk.internal module via JEP-260
     exports sun.reflect;
 
 
@@ -173,6 +172,7 @@
         java.xml,
         jdk.charsets,
         jdk.scripting.nashorn,
+        jdk.unsupported,
         jdk.vm.ci;
     exports jdk.internal.perf to
         java.desktop,
@@ -180,6 +180,8 @@
         jdk.jvmstat;
     exports jdk.internal.ref to
         java.desktop;
+    exports jdk.internal.vm.annotation to
+        jdk.unsupported;
     exports jdk.internal.util.jar to
         jdk.jartool;
     exports jdk.internal.vm to
--- a/jdk/src/java.base/share/classes/sun/misc/CRC16.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * The CRC-16 class calculates a 16 bit cyclic redundancy check of a set
- * of bytes. This error detecting code is used to determine if bit rot
- * has occurred in a byte stream.
- */
-
-public class CRC16 {
-
-    /** value contains the currently computed CRC, set it to 0 initally */
-    public int value;
-
-    public CRC16() {
-        value = 0;
-    }
-
-    /** update CRC with byte b */
-    public void update(byte aByte) {
-        int a, b;
-
-        a = (int) aByte;
-        for (int count = 7; count >=0; count--) {
-            a = a << 1;
-            b = (a >>> 8) & 1;
-            if ((value & 0x8000) != 0) {
-                value = ((value << 1) + b) ^ 0x1021;
-            } else {
-                value = (value << 1) + b;
-            }
-        }
-        value = value & 0xffff;
-        return;
-    }
-
-    /** reset CRC value to 0 */
-    public void reset() {
-        value = 0;
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/misc/Cache.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,362 +0,0 @@
-/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.lang.ref.SoftReference;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-/**
- * Caches the collision list.
- */
-class CacheEntry {
-    int hash;
-    Object key;
-    CacheEntry next;
-    SoftReference<Object> value;
-
-    public CacheEntry() {
-        value = null;
-    }
-
-    public CacheEntry(Object o) {
-        value = new SoftReference<>(o);
-    }
-
-    public Object get() {
-        return value.get();
-    }
-
-    public void setThing(Object thing) {
-        value = new SoftReference<>(thing);
-    }
-}
-
-/**
- * The Cache class. Maps keys to values. Any object can be used as
- * a key and/or value.  This is very similar to the Hashtable
- * class, except that after putting an object into the Cache,
- * it is not guaranteed that a subsequent get will return it.
- * The Cache will automatically remove entries if memory is
- * getting tight and if the entry is not referenced from outside
- * the Cache.<p>
- *
- * To sucessfully store and retrieve objects from a hash table the
- * object used as the key must implement the hashCode() and equals()
- * methods.<p>
- *
- * This example creates a Cache of numbers. It uses the names of
- * the numbers as keys:
- * <pre>
- *      Cache numbers = new Cache();
- *      numbers.put("one", new Integer(1));
- *      numbers.put("two", new Integer(1));
- *      numbers.put("three", new Integer(1));
- * </pre>
- * To retrieve a number use:
- * <pre>
- *      Integer n = (Integer)numbers.get("two");
- *      if (n != null) {
- *          System.out.println("two = " + n);
- *      }
- * </pre>
- *
- * @see java.lang.Object#hashCode
- * @see java.lang.Object#equals
- * @deprecated Consider {@link java.util.LinkedHashMap} for LRU caches.
- */
-@Deprecated
-public
-    class Cache extends Dictionary<Object, Object> {
-    /**
-     * The hash table data.
-     */
-    private CacheEntry table[];
-
-    /**
-     * The total number of entries in the hash table.
-     */
-    private int count;
-
-    /**
-     * Rehashes the table when count exceeds this threshold.
-     */
-    private int threshold;
-
-    /**
-     * The load factor for the hashtable.
-     */
-    private float loadFactor;
-
-    private void init(int initialCapacity, float loadFactor) {
-        if ((initialCapacity <= 0) || (loadFactor <= 0.0)) {
-            throw new IllegalArgumentException();
-        }
-        this.loadFactor = loadFactor;
-        table = new CacheEntry[initialCapacity];
-        threshold = (int) (initialCapacity * loadFactor);
-    }
-
-    /**
-     * Constructs a new, empty Cache with the specified initial
-     * capacity and the specified load factor.
-     * @param initialCapacity the initial number of buckets
-     * @param loadFactor a number between 0.0 and 1.0, it defines
-     *          the threshold for rehashing the Cache into
-     *          a bigger one.
-     * @exception IllegalArgumentException If the initial capacity
-     * is less than or equal to zero.
-     * @exception IllegalArgumentException If the load factor is
-     * less than or equal to zero.
-     */
-    public Cache (int initialCapacity, float loadFactor) {
-        init(initialCapacity, loadFactor);
-    }
-
-    /**
-     * Constructs a new, empty Cache with the specified initial
-     * capacity.
-     * @param initialCapacity the initial number of buckets
-     */
-    public Cache (int initialCapacity) {
-        init(initialCapacity, 0.75f);
-    }
-
-    /**
-     * Constructs a new, empty Cache. A default capacity and load factor
-     * is used. Note that the Cache will automatically grow when it gets
-     * full.
-     */
-    public Cache () {
-        try {
-            init(101, 0.75f);
-        } catch (IllegalArgumentException ex) {
-            // This should never happen
-            throw new Error("panic");
-        }
-    }
-
-    /**
-     * Returns the number of elements contained within the Cache.
-     */
-    public int size() {
-        return count;
-    }
-
-    /**
-     * Returns true if the Cache contains no elements.
-     */
-    public boolean isEmpty() {
-        return count == 0;
-    }
-
-    /**
-     * Returns an enumeration of the Cache's keys.
-     * @see Cache#elements
-     * @see Enumeration
-     */
-    public synchronized Enumeration<Object> keys() {
-        return new CacheEnumerator(table, true);
-    }
-
-    /**
-     * Returns an enumeration of the elements. Use the Enumeration methods
-     * on the returned object to fetch the elements sequentially.
-     * @see Cache#keys
-     * @see Enumeration
-     */
-    public synchronized Enumeration<Object> elements() {
-        return new CacheEnumerator(table, false);
-    }
-
-    /**
-     * Gets the object associated with the specified key in the Cache.
-     * @param key the key in the hash table
-     * @return the element for the key or null if the key
-     *         is not defined in the hash table.
-     * @see Cache#put
-     */
-    public synchronized Object get(Object key) {
-        CacheEntry tab[] = table;
-        int hash = key.hashCode();
-        int index = (hash & 0x7FFFFFFF) % tab.length;
-        for (CacheEntry e = tab[index]; e != null; e = e.next) {
-            if ((e.hash == hash) && e.key.equals(key)) {
-                return e.get();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Rehashes the contents of the table into a bigger table.
-     * This is method is called automatically when the Cache's
-     * size exceeds the threshold.
-     */
-    protected void rehash() {
-        int oldCapacity = table.length;
-        CacheEntry oldTable[] = table;
-
-        int newCapacity = oldCapacity * 2 + 1;
-        CacheEntry newTable[] = new CacheEntry[newCapacity];
-
-        threshold = (int) (newCapacity * loadFactor);
-        table = newTable;
-
-        // System.out.println("rehash old=" + oldCapacity + ", new=" +
-        // newCapacity + ", thresh=" + threshold + ", count=" + count);
-
-        for (int i = oldCapacity; i-- > 0;) {
-            for (CacheEntry old = oldTable[i]; old != null;) {
-                CacheEntry e = old;
-                old = old.next;
-                if (e.get() != null) {
-                    int index = (e.hash & 0x7FFFFFFF) % newCapacity;
-                    e.next = newTable[index];
-                    newTable[index] = e;
-                } else
-                    count--;    /* remove entries that have disappeared */
-            }
-        }
-    }
-
-    /**
-     * Puts the specified element into the Cache, using the specified
-     * key.  The element may be retrieved by doing a get() with the same
-     * key.  The key and the element cannot be null.
-     * @param key the specified hashtable key
-     * @param value the specified element
-     * @return the old value of the key, or null if it did not have one.
-     * @exception NullPointerException If the value of the specified
-     * element is null.
-     * @see Cache#get
-     */
-    public synchronized Object put(Object key, Object value) {
-        // Make sure the value is not null
-        if (value == null) {
-            throw new NullPointerException();
-        }
-        // Makes sure the key is not already in the cache.
-        CacheEntry tab[] = table;
-        int hash = key.hashCode();
-        int index = (hash & 0x7FFFFFFF) % tab.length;
-        CacheEntry ne = null;
-        for (CacheEntry e = tab[index]; e != null; e = e.next) {
-            if ((e.hash == hash) && e.key.equals(key)) {
-                Object old = e.get();
-                e.setThing(value);
-                return old;
-            } else if (e.get() == null)
-                ne = e;         /* reuse old flushed value */
-        }
-
-        if (count >= threshold) {
-            // Rehash the table if the threshold is exceeded
-            rehash();
-            return put(key, value);
-        }
-        // Creates the new entry.
-        if (ne == null) {
-            ne = new CacheEntry ();
-            ne.next = tab[index];
-            tab[index] = ne;
-            count++;
-        }
-        ne.hash = hash;
-        ne.key = key;
-        ne.setThing(value);
-        return null;
-    }
-
-    /**
-     * Removes the element corresponding to the key. Does nothing if the
-     * key is not present.
-     * @param key the key that needs to be removed
-     * @return the value of key, or null if the key was not found.
-     */
-    public synchronized Object remove(Object key) {
-        CacheEntry tab[] = table;
-        int hash = key.hashCode();
-        int index = (hash & 0x7FFFFFFF) % tab.length;
-        for (CacheEntry e = tab[index], prev = null; e != null; prev = e, e = e.next) {
-            if ((e.hash == hash) && e.key.equals(key)) {
-                if (prev != null) {
-                    prev.next = e.next;
-                } else {
-                    tab[index] = e.next;
-                }
-                count--;
-                return e.get();
-            }
-        }
-        return null;
-    }
-}
-
-/**
- * A Cache enumerator class.  This class should remain opaque
- * to the client. It will use the Enumeration interface.
- */
-class CacheEnumerator implements Enumeration<Object> {
-    boolean keys;
-    int index;
-    CacheEntry table[];
-    CacheEntry entry;
-
-    CacheEnumerator (CacheEntry table[], boolean keys) {
-        this.table = table;
-        this.keys = keys;
-        this.index = table.length;
-    }
-
-    public boolean hasMoreElements() {
-        while (index >= 0) {
-            while (entry != null)
-                if (entry.get() != null)
-                    return true;
-                else
-                    entry = entry.next;
-            while (--index >= 0 && (entry = table[index]) == null) ;
-        }
-        return false;
-    }
-
-    public Object nextElement() {
-        while (index >= 0) {
-            if (entry == null)
-                while (--index >= 0 && (entry = table[index]) == null) ;
-            if (entry != null) {
-                CacheEntry e = entry;
-                entry = e.next;
-                if (e.get() != null)
-                    return keys ? e.key : e.get();
-            }
-        }
-        throw new NoSuchElementException("CacheEnumerator");
-    }
-
-}
--- a/jdk/src/java.base/share/classes/sun/misc/ManagedLocalsThread.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * A thread that has it's thread locals, and inheritable thread
- * locals erased on construction.
- */
-public class ManagedLocalsThread extends Thread {
-    private static final jdk.internal.misc.Unsafe UNSAFE;
-    private static final long THREAD_LOCALS;
-    private static final long INHERITABLE_THREAD_LOCALS;
-
-    public ManagedLocalsThread() {
-        eraseThreadLocals();
-    }
-
-    public ManagedLocalsThread(Runnable target) {
-        super(target);
-        eraseThreadLocals();
-    }
-
-    public ManagedLocalsThread(String name) {
-        super(name);
-        eraseThreadLocals();
-    }
-
-    public ManagedLocalsThread(ThreadGroup group, Runnable target) {
-        super(group, target);
-        eraseThreadLocals();
-    }
-
-    public ManagedLocalsThread(Runnable target, String name) {
-        super(target, name);
-        eraseThreadLocals();
-    }
-
-    public ManagedLocalsThread(ThreadGroup group, String name) {
-        super(group, name);
-        eraseThreadLocals();
-    }
-
-    public ManagedLocalsThread(ThreadGroup group, Runnable target, String name) {
-        super(group, target, name);
-        eraseThreadLocals();
-    }
-
-    /**
-     * Drops all thread locals (and inherited thread locals).
-     */
-    public final void eraseThreadLocals() {
-        UNSAFE.putObject(this, THREAD_LOCALS, null);
-        UNSAFE.putObject(this, INHERITABLE_THREAD_LOCALS, null);
-    }
-
-    static {
-        UNSAFE = jdk.internal.misc.Unsafe.getUnsafe();
-        Class<?> t = Thread.class;
-        try {
-            THREAD_LOCALS = UNSAFE.objectFieldOffset
-                (t.getDeclaredField("threadLocals"));
-            INHERITABLE_THREAD_LOCALS = UNSAFE.objectFieldOffset
-                (t.getDeclaredField("inheritableThreadLocals"));
-        } catch (Exception e) {
-            throw new Error(e);
-        }
-    }
-}
-
--- a/jdk/src/java.base/share/classes/sun/misc/Signal.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.util.Objects;
-
-/**
- * This class provides ANSI/ISO C signal support. A Java program can register
- * signal handlers for the current process. There are two restrictions:
- * <ul>
- * <li>
- * Java code cannot register a handler for signals that are already used
- * by the Java VM implementation. The <code>Signal.handle</code>
- * function raises an <code>IllegalArgumentException</code> if such an attempt
- * is made.
- * <li>
- * When <code>Signal.handle</code> is called, the VM internally registers a
- * special C signal handler. There is no way to force the Java signal handler
- * to run synchronously before the C signal handler returns. Instead, when the
- * VM receives a signal, the special C signal handler creates a new thread
- * (at priority <code>Thread.MAX_PRIORITY</code>) to
- * run the registered Java signal handler. The C signal handler immediately
- * returns. Note that because the Java signal handler runs in a newly created
- * thread, it may not actually be executed until some time after the C signal
- * handler returns.
- * </ul>
- * <p>
- * Signal objects are created based on their names. For example:
- * <blockquote><pre>
- * new Signal("INT");
- * </pre></blockquote>
- * constructs a signal object corresponding to <code>SIGINT</code>, which is
- * typically produced when the user presses <code>Ctrl-C</code> at the command line.
- * The <code>Signal</code> constructor throws <code>IllegalArgumentException</code>
- * when it is passed an unknown signal.
- * <p>
- * This is an example of how Java code handles <code>SIGINT</code>:
- * <blockquote><pre>
- * SignalHandler handler = new SignalHandler () {
- *     public void handle(Signal sig) {
- *       ... // handle SIGINT
- *     }
- * };
- * Signal.handle(new Signal("INT"), handler);
- * </pre></blockquote>
- *
- * @author   Sheng Liang
- * @author   Bill Shannon
- * @see     sun.misc.SignalHandler
- * @since    1.2
- */
-public final class Signal {
-
-    // Delegate to jdk.internal.misc.Signal.
-    private final jdk.internal.misc.Signal iSignal;
-
-    /* Returns the signal number */
-    public int getNumber() {
-        return iSignal.getNumber();
-    }
-
-    /**
-     * Returns the signal name.
-     *
-     * @return the name of the signal.
-     * @see sun.misc.Signal#Signal(String name)
-     */
-    public String getName() {
-        return iSignal.getName();
-    }
-
-    /**
-     * Compares the equality of two <code>Signal</code> objects.
-     *
-     * @param other the object to compare with.
-     * @return whether two <code>Signal</code> objects are equal.
-     */
-    public boolean equals(Object other) {
-        if (this == other) {
-            return true;
-        }
-        if (other == null || !(other instanceof Signal)) {
-            return false;
-        }
-        Signal other1 = (Signal)other;
-        return iSignal.equals(other1.iSignal);
-    }
-
-    /**
-     * Returns a hashcode for this Signal.
-     *
-     * @return  a hash code value for this object.
-     */
-    public int hashCode() {
-        return getNumber();
-    }
-
-    /**
-     * Returns a string representation of this signal. For example, "SIGINT"
-     * for an object constructed using <code>new Signal ("INT")</code>.
-     *
-     * @return a string representation of the signal
-     */
-    public String toString() {
-        return iSignal.toString();
-    }
-
-    /**
-     * Constructs a signal from its name.
-     *
-     * @param name the name of the signal.
-     * @exception IllegalArgumentException unknown signal
-     * @see sun.misc.Signal#getName()
-     */
-    public Signal(String name) {
-        iSignal = new jdk.internal.misc.Signal(name);
-    }
-
-    /**
-     * Registers a signal handler.
-     *
-     * @param sig a signal
-     * @param handler the handler to be registered with the given signal.
-     * @return the old handler
-     * @exception IllegalArgumentException the signal is in use by the VM
-     * @see sun.misc.Signal#raise(Signal sig)
-     * @see sun.misc.SignalHandler
-     * @see sun.misc.SignalHandler#SIG_DFL
-     * @see sun.misc.SignalHandler#SIG_IGN
-     */
-    public static synchronized SignalHandler handle(Signal sig,
-                                                    SignalHandler handler)
-        throws IllegalArgumentException {
-        jdk.internal.misc.Signal.Handler oldHandler = jdk.internal.misc.Signal.handle(sig.iSignal,
-                InternalMiscHandler.of(sig, handler));
-        return SunMiscHandler.of(sig.iSignal, oldHandler);
-    }
-
-    /**
-     * Raises a signal in the current process.
-     *
-     * @param sig a signal
-     * @see sun.misc.Signal#handle(Signal sig, SignalHandler handler)
-     */
-    public static void raise(Signal sig) throws IllegalArgumentException {
-        jdk.internal.misc.Signal.raise(sig.iSignal);
-    }
-
-    /*
-     * Wrapper class to proxy a SignalHandler to a jdk.internal.misc.Signal.Handler.
-     */
-    static final class InternalMiscHandler implements jdk.internal.misc.Signal.Handler {
-        private final SignalHandler handler;
-        private final Signal signal;
-
-        static jdk.internal.misc.Signal.Handler of(Signal signal, SignalHandler handler) {
-            if (handler == SignalHandler.SIG_DFL) {
-                return jdk.internal.misc.Signal.Handler.SIG_DFL;
-            } else if (handler == SignalHandler.SIG_IGN) {
-                return jdk.internal.misc.Signal.Handler.SIG_IGN;
-            } else if (handler instanceof SunMiscHandler) {
-                return ((SunMiscHandler)handler).iHandler;
-            } else {
-                return new InternalMiscHandler(signal, handler);
-            }
-        }
-
-        private InternalMiscHandler(Signal signal, SignalHandler handler) {
-            this.handler = handler;
-            this.signal = signal;
-        }
-
-        @Override
-        public void handle(jdk.internal.misc.Signal ignore) {
-            handler.handle(signal);
-        }
-    }
-
-    /*
-     * Wrapper class to proxy a jdk.internal.misc.Signal.Handler to a SignalHandler.
-     */
-    static final class SunMiscHandler implements SignalHandler {
-        private final jdk.internal.misc.Signal iSignal;
-        private final jdk.internal.misc.Signal.Handler iHandler;
-
-        static SignalHandler of(jdk.internal.misc.Signal signal, jdk.internal.misc.Signal.Handler handler) {
-            if (handler == jdk.internal.misc.Signal.Handler.SIG_DFL) {
-                return SignalHandler.SIG_DFL;
-            } else if (handler == jdk.internal.misc.Signal.Handler.SIG_IGN) {
-                return SignalHandler.SIG_IGN;
-            } else if (handler instanceof InternalMiscHandler) {
-                return ((InternalMiscHandler) handler).handler;
-            } else {
-                return new SunMiscHandler(signal, handler);
-            }
-        }
-
-        SunMiscHandler(jdk.internal.misc.Signal iSignal, jdk.internal.misc.Signal.Handler iHandler) {
-            this.iSignal = iSignal;
-            this.iHandler = iHandler;
-        }
-
-        @Override
-        public void handle(Signal sig) {
-            iHandler.handle(iSignal);
-        }
-
-        public String toString() {
-            return iHandler.toString();
-        }
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/misc/SignalHandler.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * This is the signal handler interface expected in <code>Signal.handle</code>.
- *
- * @author   Sheng Liang
- * @author   Bill Shannon
- * @see      sun.misc.Signal
- * @since    1.2
- */
-
-public interface SignalHandler {
-
-    /**
-     * The default signal handler
-     */
-    public static final SignalHandler SIG_DFL =
-            new Signal.SunMiscHandler(null, jdk.internal.misc.Signal.Handler.SIG_DFL);
-    /**
-     * Ignore the signal
-     */
-    public static final SignalHandler SIG_IGN =
-            new Signal.SunMiscHandler(null, jdk.internal.misc.Signal.Handler.SIG_IGN);
-
-    /**
-     * Handle the given signal
-     *
-     * @param sig a signal object
-     */
-    public void handle(Signal sig);
-}
--- a/jdk/src/java.base/share/classes/sun/misc/SoftCache.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,462 +0,0 @@
-/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.lang.ref.SoftReference;
-import java.lang.ref.ReferenceQueue;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.Set;
-import java.util.AbstractSet;
-import java.util.NoSuchElementException;
-
-
-/**
- * A memory-sensitive implementation of the <code>Map</code> interface.
- *
- * <p> A <code>SoftCache</code> object uses {@link java.lang.ref.SoftReference
- * soft references} to implement a memory-sensitive hash map.  If the garbage
- * collector determines at a certain point in time that a value object in a
- * <code>SoftCache</code> entry is no longer strongly reachable, then it may
- * remove that entry in order to release the memory occupied by the value
- * object.  All <code>SoftCache</code> objects are guaranteed to be completely
- * cleared before the virtual machine will throw an
- * <code>OutOfMemoryError</code>.  Because of this automatic clearing feature,
- * the behavior of this class is somewhat different from that of other
- * <code>Map</code> implementations.
- *
- * <p> Both null values and the null key are supported.  This class has the
- * same performance characteristics as the <code>HashMap</code> class, and has
- * the same efficiency parameters of <em>initial capacity</em> and <em>load
- * factor</em>.
- *
- * <p> Like most collection classes, this class is not synchronized.  A
- * synchronized <code>SoftCache</code> may be constructed using the
- * <code>Collections.synchronizedMap</code> method.
- *
- * <p> In typical usage this class will be subclassed and the <code>fill</code>
- * method will be overridden.  When the <code>get</code> method is invoked on a
- * key for which there is no mapping in the cache, it will in turn invoke the
- * <code>fill</code> method on that key in an attempt to construct a
- * corresponding value.  If the <code>fill</code> method returns such a value
- * then the cache will be updated and the new value will be returned.  Thus,
- * for example, a simple URL-content cache can be constructed as follows:
- *
- * <pre>
- *     public class URLCache extends SoftCache {
- *         protected Object fill(Object key) {
- *             return ((URL)key).getContent();
- *         }
- *     }
- * </pre>
- *
- * <p> The behavior of the <code>SoftCache</code> class depends in part upon
- * the actions of the garbage collector, so several familiar (though not
- * required) <code>Map</code> invariants do not hold for this class.  <p>
- * Because entries are removed from a <code>SoftCache</code> in response to
- * dynamic advice from the garbage collector, a <code>SoftCache</code> may
- * behave as though an unknown thread is silently removing entries.  In
- * particular, even if you synchronize on a <code>SoftCache</code> instance and
- * invoke none of its mutator methods, it is possible for the <code>size</code>
- * method to return smaller values over time, for the <code>isEmpty</code>
- * method to return <code>false</code> and then <code>true</code>, for the
- * <code>containsKey</code> method to return <code>true</code> and later
- * <code>false</code> for a given key, for the <code>get</code> method to
- * return a value for a given key but later return <code>null</code>, for the
- * <code>put</code> method to return <code>null</code> and the
- * <code>remove</code> method to return <code>false</code> for a key that
- * previously appeared to be in the map, and for successive examinations of the
- * key set, the value set, and the entry set to yield successively smaller
- * numbers of elements.
- *
- * @author      Mark Reinhold
- * @since       1.2
- * @see         java.util.HashMap
- * @see         java.lang.ref.SoftReference
- * @deprecated No direct replacement; {@link java.util.WeakHashMap}
- * addresses a related by different use-case.
- */
-
-@Deprecated
-public class SoftCache extends AbstractMap<Object, Object> implements Map<Object, Object> {
-
-    /* The basic idea of this implementation is to maintain an internal HashMap
-       that maps keys to soft references whose referents are the keys' values;
-       the various accessor methods dereference these soft references before
-       returning values.  Because we don't have access to the innards of the
-       HashMap, each soft reference must contain the key that maps to it so
-       that the processQueue method can remove keys whose values have been
-       discarded.  Thus the HashMap actually maps keys to instances of the
-       ValueCell class, which is a simple extension of the SoftReference class.
-     */
-
-
-    private static class ValueCell extends SoftReference<Object> {
-        private static Object INVALID_KEY = new Object();
-        private static int dropped = 0;
-        private Object key;
-
-        private ValueCell(Object key, Object value, ReferenceQueue<Object> queue) {
-            super(value, queue);
-            this.key = key;
-        }
-
-        private static ValueCell create(Object key, Object value,
-                                        ReferenceQueue<Object> queue)
-        {
-            if (value == null) return null;
-            return new ValueCell(key, value, queue);
-        }
-
-        private static Object strip(Object val, boolean drop) {
-            if (val == null) return null;
-            ValueCell vc = (ValueCell)val;
-            Object o = vc.get();
-            if (drop) vc.drop();
-            return o;
-        }
-
-        private boolean isValid() {
-            return (key != INVALID_KEY);
-        }
-
-        private void drop() {
-            super.clear();
-            key = INVALID_KEY;
-            dropped++;
-        }
-
-    }
-
-
-    /* Hash table mapping keys to ValueCells */
-    private Map<Object, Object> hash;
-
-    /* Reference queue for cleared ValueCells */
-    private ReferenceQueue<Object> queue = new ReferenceQueue<>();
-
-
-    /* Process any ValueCells that have been cleared and enqueued by the
-       garbage collector.  This method should be invoked once by each public
-       mutator in this class.  We don't invoke this method in public accessors
-       because that can lead to surprising ConcurrentModificationExceptions.
-     */
-    private void processQueue() {
-        ValueCell vc;
-        while ((vc = (ValueCell)queue.poll()) != null) {
-            if (vc.isValid()) hash.remove(vc.key);
-            else ValueCell.dropped--;
-        }
-    }
-
-
-    /* -- Constructors -- */
-
-    /**
-     * Construct a new, empty <code>SoftCache</code> with the given
-     * initial capacity and the given load factor.
-     *
-     * @param  initialCapacity  The initial capacity of the cache
-     *
-     * @param  loadFactor       A number between 0.0 and 1.0
-     *
-     * @throws IllegalArgumentException  If the initial capacity is less than
-     *                                   or equal to zero, or if the load
-     *                                   factor is less than zero
-     */
-    public SoftCache(int initialCapacity, float loadFactor) {
-        hash = new HashMap<>(initialCapacity, loadFactor);
-    }
-
-    /**
-     * Construct a new, empty <code>SoftCache</code> with the given
-     * initial capacity and the default load factor.
-     *
-     * @param  initialCapacity  The initial capacity of the cache
-     *
-     * @throws IllegalArgumentException  If the initial capacity is less than
-     *                                   or equal to zero
-     */
-    public SoftCache(int initialCapacity) {
-        hash = new HashMap<>(initialCapacity);
-    }
-
-    /**
-     * Construct a new, empty <code>SoftCache</code> with the default
-     * capacity and the default load factor.
-     */
-    public SoftCache() {
-        hash = new HashMap<>();
-    }
-
-
-    /* -- Simple queries -- */
-
-    /**
-     * Return the number of key-value mappings in this cache.  The time
-     * required by this operation is linear in the size of the map.
-     */
-    public int size() {
-        return entrySet().size();
-    }
-
-    /**
-     * Return <code>true</code> if this cache contains no key-value mappings.
-     */
-    public boolean isEmpty() {
-        return entrySet().isEmpty();
-    }
-
-    /**
-     * Return <code>true</code> if this cache contains a mapping for the
-     * specified key.  If there is no mapping for the key, this method will not
-     * attempt to construct one by invoking the <code>fill</code> method.
-     *
-     * @param   key   The key whose presence in the cache is to be tested
-     */
-    public boolean containsKey(Object key) {
-        return ValueCell.strip(hash.get(key), false) != null;
-    }
-
-
-    /* -- Lookup and modification operations -- */
-
-    /**
-     * Create a value object for the given <code>key</code>.  This method is
-     * invoked by the <code>get</code> method when there is no entry for
-     * <code>key</code>.  If this method returns a non-<code>null</code> value,
-     * then the cache will be updated to map <code>key</code> to that value,
-     * and that value will be returned by the <code>get</code> method.
-     *
-     * <p> The default implementation of this method simply returns
-     * <code>null</code> for every <code>key</code> value.  A subclass may
-     * override this method to provide more useful behavior.
-     *
-     * @param  key  The key for which a value is to be computed
-     *
-     * @return      A value for <code>key</code>, or <code>null</code> if one
-     *              could not be computed
-     * @see #get
-     */
-    protected Object fill(Object key) {
-        return null;
-    }
-
-    /**
-     * Return the value to which this cache maps the specified
-     * <code>key</code>.  If the cache does not presently contain a value for
-     * this key, then invoke the <code>fill</code> method in an attempt to
-     * compute such a value.  If that method returns a non-<code>null</code>
-     * value, then update the cache and return the new value.  Otherwise,
-     * return <code>null</code>.
-     *
-     * <p> Note that because this method may update the cache, it is considered
-     * a mutator and may cause <code>ConcurrentModificationException</code>s to
-     * be thrown if invoked while an iterator is in use.
-     *
-     * @param  key  The key whose associated value, if any, is to be returned
-     *
-     * @see #fill
-     */
-    public Object get(Object key) {
-        processQueue();
-        Object v = hash.get(key);
-        if (v == null) {
-            v = fill(key);
-            if (v != null) {
-                hash.put(key, ValueCell.create(key, v, queue));
-                return v;
-            }
-        }
-        return ValueCell.strip(v, false);
-    }
-
-    /**
-     * Update this cache so that the given <code>key</code> maps to the given
-     * <code>value</code>.  If the cache previously contained a mapping for
-     * <code>key</code> then that mapping is replaced and the old value is
-     * returned.
-     *
-     * @param  key    The key that is to be mapped to the given
-     *                <code>value</code>
-     * @param  value  The value to which the given <code>key</code> is to be
-     *                mapped
-     *
-     * @return  The previous value to which this key was mapped, or
-     *          <code>null</code> if there was no mapping for the key
-     */
-    public Object put(Object key, Object value) {
-        processQueue();
-        ValueCell vc = ValueCell.create(key, value, queue);
-        return ValueCell.strip(hash.put(key, vc), true);
-    }
-
-    /**
-     * Remove the mapping for the given <code>key</code> from this cache, if
-     * present.
-     *
-     * @param  key  The key whose mapping is to be removed
-     *
-     * @return  The value to which this key was mapped, or <code>null</code> if
-     *          there was no mapping for the key
-     */
-    public Object remove(Object key) {
-        processQueue();
-        return ValueCell.strip(hash.remove(key), true);
-    }
-
-    /**
-     * Remove all mappings from this cache.
-     */
-    public void clear() {
-        processQueue();
-        hash.clear();
-    }
-
-
-    /* -- Views -- */
-
-    private static boolean valEquals(Object o1, Object o2) {
-        return (o1 == null) ? (o2 == null) : o1.equals(o2);
-    }
-
-
-    /* Internal class for entries.
-       Because it uses SoftCache.this.queue, this class cannot be static.
-     */
-    private class Entry implements Map.Entry<Object, Object> {
-        private Map.Entry<Object, Object> ent;
-        private Object value;   /* Strong reference to value, to prevent the GC
-                                   from flushing the value while this Entry
-                                   exists */
-
-        Entry(Map.Entry<Object, Object> ent, Object value) {
-            this.ent = ent;
-            this.value = value;
-        }
-
-        public Object getKey() {
-            return ent.getKey();
-        }
-
-        public Object getValue() {
-            return value;
-        }
-
-        public Object setValue(Object value) {
-            return ent.setValue(ValueCell.create(ent.getKey(), value, queue));
-        }
-
-        @SuppressWarnings("unchecked")
-        public boolean equals(Object o) {
-            if (! (o instanceof Map.Entry)) return false;
-            Map.Entry<Object, Object> e = (Map.Entry<Object, Object>)o;
-            return (valEquals(ent.getKey(), e.getKey())
-                    && valEquals(value, e.getValue()));
-        }
-
-        public int hashCode() {
-            Object k;
-            return ((((k = getKey()) == null) ? 0 : k.hashCode())
-                    ^ ((value == null) ? 0 : value.hashCode()));
-        }
-
-    }
-
-
-    /* Internal class for entry sets */
-    private class EntrySet extends AbstractSet<Map.Entry<Object, Object>> {
-        Set<Map.Entry<Object, Object>> hashEntries = hash.entrySet();
-
-        public Iterator<Map.Entry<Object, Object>> iterator() {
-
-            return new Iterator<Map.Entry<Object, Object>>() {
-                Iterator<Map.Entry<Object, Object>> hashIterator = hashEntries.iterator();
-                Entry next = null;
-
-                public boolean hasNext() {
-                    while (hashIterator.hasNext()) {
-                        Map.Entry<Object, Object> ent = hashIterator.next();
-                        ValueCell vc = (ValueCell)ent.getValue();
-                        Object v = null;
-                        if ((vc != null) && ((v = vc.get()) == null)) {
-                            /* Value has been flushed by GC */
-                            continue;
-                        }
-                        next = new Entry(ent, v);
-                        return true;
-                    }
-                    return false;
-                }
-
-                public Map.Entry<Object, Object> next() {
-                    if ((next == null) && !hasNext())
-                        throw new NoSuchElementException();
-                    Entry e = next;
-                    next = null;
-                    return e;
-                }
-
-                public void remove() {
-                    hashIterator.remove();
-                }
-
-            };
-        }
-
-        public boolean isEmpty() {
-            return !(iterator().hasNext());
-        }
-
-        public int size() {
-            int j = 0;
-            for (Iterator<Map.Entry<Object, Object>> i = iterator(); i.hasNext(); i.next()) j++;
-            return j;
-        }
-
-        public boolean remove(Object o) {
-            processQueue();
-            if (o instanceof Entry) return hashEntries.remove(((Entry)o).ent);
-            else return false;
-        }
-
-    }
-
-
-    private Set<Map.Entry<Object, Object>> entrySet = null;
-
-    /**
-     * Return a <code>Set</code> view of the mappings in this cache.
-     */
-    public Set<Map.Entry<Object, Object>> entrySet() {
-        if (entrySet == null) entrySet = new EntrySet();
-        return entrySet;
-    }
-
-}
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1270 +0,0 @@
-/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import jdk.internal.vm.annotation.ForceInline;
-import jdk.internal.misc.VM;
-import sun.reflect.CallerSensitive;
-import sun.reflect.Reflection;
-
-import java.lang.reflect.Field;
-import java.security.ProtectionDomain;
-
-
-/**
- * A collection of methods for performing low-level, unsafe operations.
- * Although the class and all methods are public, use of this class is
- * limited because only trusted code can obtain instances of it.
- *
- * <em>Note:</em> It is the resposibility of the caller to make sure
- * arguments are checked before methods of this class are
- * called. While some rudimentary checks are performed on the input,
- * the checks are best effort and when performance is an overriding
- * priority, as when methods of this class are optimized by the
- * runtime compiler, some or all checks (if any) may be elided. Hence,
- * the caller must not rely on the checks and corresponding
- * exceptions!
- *
- * @author John R. Rose
- * @see #getUnsafe
- */
-
-public final class Unsafe {
-
-    static {
-        sun.reflect.Reflection.registerMethodsToFilter(Unsafe.class, "getUnsafe");
-    }
-
-    private Unsafe() {}
-
-    private static final Unsafe theUnsafe = new Unsafe();
-    private static final jdk.internal.misc.Unsafe theInternalUnsafe = jdk.internal.misc.Unsafe.getUnsafe();
-
-    /**
-     * Provides the caller with the capability of performing unsafe
-     * operations.
-     *
-     * <p>The returned {@code Unsafe} object should be carefully guarded
-     * by the caller, since it can be used to read and write data at arbitrary
-     * memory addresses.  It must never be passed to untrusted code.
-     *
-     * <p>Most methods in this class are very low-level, and correspond to a
-     * small number of hardware instructions (on typical machines).  Compilers
-     * are encouraged to optimize these methods accordingly.
-     *
-     * <p>Here is a suggested idiom for using unsafe operations:
-     *
-     * <pre> {@code
-     * class MyTrustedClass {
-     *   private static final Unsafe unsafe = Unsafe.getUnsafe();
-     *   ...
-     *   private long myCountAddress = ...;
-     *   public int getCount() { return unsafe.getByte(myCountAddress); }
-     * }}</pre>
-     *
-     * (It may assist compilers to make the local variable {@code final}.)
-     *
-     * @throws  SecurityException  if a security manager exists and its
-     *          {@code checkPropertiesAccess} method doesn't allow
-     *          access to the system properties.
-     */
-    @CallerSensitive
-    public static Unsafe getUnsafe() {
-        Class<?> caller = Reflection.getCallerClass();
-        if (!VM.isSystemDomainLoader(caller.getClassLoader()))
-            throw new SecurityException("Unsafe");
-        return theUnsafe;
-    }
-
-    /// peek and poke operations
-    /// (compilers should optimize these to memory ops)
-
-    // These work on object fields in the Java heap.
-    // They will not work on elements of packed arrays.
-
-    /**
-     * Fetches a value from a given Java variable.
-     * More specifically, fetches a field or array element within the given
-     * object {@code o} at the given offset, or (if {@code o} is null)
-     * from the memory address whose numerical value is the given offset.
-     * <p>
-     * The results are undefined unless one of the following cases is true:
-     * <ul>
-     * <li>The offset was obtained from {@link #objectFieldOffset} on
-     * the {@link java.lang.reflect.Field} of some Java field and the object
-     * referred to by {@code o} is of a class compatible with that
-     * field's class.
-     *
-     * <li>The offset and object reference {@code o} (either null or
-     * non-null) were both obtained via {@link #staticFieldOffset}
-     * and {@link #staticFieldBase} (respectively) from the
-     * reflective {@link Field} representation of some Java field.
-     *
-     * <li>The object referred to by {@code o} is an array, and the offset
-     * is an integer of the form {@code B+N*S}, where {@code N} is
-     * a valid index into the array, and {@code B} and {@code S} are
-     * the values obtained by {@link #arrayBaseOffset} and {@link
-     * #arrayIndexScale} (respectively) from the array's class.  The value
-     * referred to is the {@code N}<em>th</em> element of the array.
-     *
-     * </ul>
-     * <p>
-     * If one of the above cases is true, the call references a specific Java
-     * variable (field or array element).  However, the results are undefined
-     * if that variable is not in fact of the type returned by this method.
-     * <p>
-     * This method refers to a variable by means of two parameters, and so
-     * it provides (in effect) a <em>double-register</em> addressing mode
-     * for Java variables.  When the object reference is null, this method
-     * uses its offset as an absolute address.  This is similar in operation
-     * to methods such as {@link #getInt(long)}, which provide (in effect) a
-     * <em>single-register</em> addressing mode for non-Java variables.
-     * However, because Java variables may have a different layout in memory
-     * from non-Java variables, programmers should not assume that these
-     * two addressing modes are ever equivalent.  Also, programmers should
-     * remember that offsets from the double-register addressing mode cannot
-     * be portably confused with longs used in the single-register addressing
-     * mode.
-     *
-     * @param o Java heap object in which the variable resides, if any, else
-     *        null
-     * @param offset indication of where the variable resides in a Java heap
-     *        object, if any, else a memory address locating the variable
-     *        statically
-     * @return the value fetched from the indicated Java variable
-     * @throws RuntimeException No defined exceptions are thrown, not even
-     *         {@link NullPointerException}
-     */
-    @ForceInline
-    public int getInt(Object o, long offset) {
-        return theInternalUnsafe.getInt(o, offset);
-    }
-
-    /**
-     * Stores a value into a given Java variable.
-     * <p>
-     * The first two parameters are interpreted exactly as with
-     * {@link #getInt(Object, long)} to refer to a specific
-     * Java variable (field or array element).  The given value
-     * is stored into that variable.
-     * <p>
-     * The variable must be of the same type as the method
-     * parameter {@code x}.
-     *
-     * @param o Java heap object in which the variable resides, if any, else
-     *        null
-     * @param offset indication of where the variable resides in a Java heap
-     *        object, if any, else a memory address locating the variable
-     *        statically
-     * @param x the value to store into the indicated Java variable
-     * @throws RuntimeException No defined exceptions are thrown, not even
-     *         {@link NullPointerException}
-     */
-    @ForceInline
-    public void putInt(Object o, long offset, int x) {
-        theInternalUnsafe.putInt(o, offset, x);
-    }
-
-    /**
-     * Fetches a reference value from a given Java variable.
-     * @see #getInt(Object, long)
-     */
-    @ForceInline
-    public Object getObject(Object o, long offset) {
-        return theInternalUnsafe.getObject(o, offset);
-    }
-
-    /**
-     * Stores a reference value into a given Java variable.
-     * <p>
-     * Unless the reference {@code x} being stored is either null
-     * or matches the field type, the results are undefined.
-     * If the reference {@code o} is non-null, card marks or
-     * other store barriers for that object (if the VM requires them)
-     * are updated.
-     * @see #putInt(Object, long, int)
-     */
-    @ForceInline
-    public void putObject(Object o, long offset, Object x) {
-        theInternalUnsafe.putObject(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public boolean getBoolean(Object o, long offset) {
-        return theInternalUnsafe.getBoolean(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putBoolean(Object o, long offset, boolean x) {
-        theInternalUnsafe.putBoolean(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public byte getByte(Object o, long offset) {
-        return theInternalUnsafe.getByte(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putByte(Object o, long offset, byte x) {
-        theInternalUnsafe.putByte(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public short getShort(Object o, long offset) {
-        return theInternalUnsafe.getShort(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putShort(Object o, long offset, short x) {
-        theInternalUnsafe.putShort(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public char getChar(Object o, long offset) {
-        return theInternalUnsafe.getChar(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putChar(Object o, long offset, char x) {
-        theInternalUnsafe.putChar(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public long getLong(Object o, long offset) {
-        return theInternalUnsafe.getLong(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putLong(Object o, long offset, long x) {
-        theInternalUnsafe.putLong(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public float getFloat(Object o, long offset) {
-        return theInternalUnsafe.getFloat(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putFloat(Object o, long offset, float x) {
-        theInternalUnsafe.putFloat(o, offset, x);
-    }
-
-    /** @see #getInt(Object, long) */
-    @ForceInline
-    public double getDouble(Object o, long offset) {
-        return theInternalUnsafe.getDouble(o, offset);
-    }
-
-    /** @see #putInt(Object, long, int) */
-    @ForceInline
-    public void putDouble(Object o, long offset, double x) {
-        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.
-
-    /**
-     * Fetches a value from a given memory address.  If the address is zero, or
-     * does not point into a block obtained from {@link #allocateMemory}, the
-     * results are undefined.
-     *
-     * @see #allocateMemory
-     */
-    @ForceInline
-    public byte getByte(long address) {
-        return theInternalUnsafe.getByte(address);
-    }
-
-    /**
-     * Stores a value into a given memory address.  If the address is zero, or
-     * does not point into a block obtained from {@link #allocateMemory}, the
-     * results are undefined.
-     *
-     * @see #getByte(long)
-     */
-    @ForceInline
-    public void putByte(long address, byte x) {
-        theInternalUnsafe.putByte(address, x);
-    }
-
-    /** @see #getByte(long) */
-    @ForceInline
-    public short getShort(long address) {
-        return theInternalUnsafe.getShort(address);
-    }
-
-    /** @see #putByte(long, byte) */
-    @ForceInline
-    public void putShort(long address, short x) {
-        theInternalUnsafe.putShort(address, x);
-    }
-
-    /** @see #getByte(long) */
-    @ForceInline
-    public char getChar(long address) {
-        return theInternalUnsafe.getChar(address);
-    }
-
-    /** @see #putByte(long, byte) */
-    @ForceInline
-    public void putChar(long address, char x) {
-        theInternalUnsafe.putChar(address, x);
-    }
-
-    /** @see #getByte(long) */
-    @ForceInline
-    public int getInt(long address) {
-        return theInternalUnsafe.getInt(address);
-    }
-
-    /** @see #putByte(long, byte) */
-    @ForceInline
-    public void putInt(long address, int x) {
-        theInternalUnsafe.putInt(address, x);
-    }
-
-    /** @see #getByte(long) */
-    @ForceInline
-    public long getLong(long address) {
-        return theInternalUnsafe.getLong(address);
-    }
-
-    /** @see #putByte(long, byte) */
-    @ForceInline
-    public void putLong(long address, long x) {
-        theInternalUnsafe.putLong(address, x);
-    }
-
-    /** @see #getByte(long) */
-    @ForceInline
-    public float getFloat(long address) {
-        return theInternalUnsafe.getFloat(address);
-    }
-
-    /** @see #putByte(long, byte) */
-    @ForceInline
-    public void putFloat(long address, float x) {
-        theInternalUnsafe.putFloat(address, x);
-    }
-
-    /** @see #getByte(long) */
-    @ForceInline
-    public double getDouble(long address) {
-        return theInternalUnsafe.getDouble(address);
-    }
-
-    /** @see #putByte(long, byte) */
-    @ForceInline
-    public void putDouble(long address, double x) {
-        theInternalUnsafe.putDouble(address, x);
-    }
-
-
-    /**
-     * Fetches a native pointer from a given memory address.  If the address is
-     * zero, or does not point into a block obtained from {@link
-     * #allocateMemory}, the results are undefined.
-     *
-     * <p>If the native pointer is less than 64 bits wide, it is extended as
-     * an unsigned number to a Java long.  The pointer may be indexed by any
-     * given byte offset, simply by adding that offset (as a simple integer) to
-     * the long representing the pointer.  The number of bytes actually read
-     * from the target address may be determined by consulting {@link
-     * #addressSize}.
-     *
-     * @see #allocateMemory
-     */
-    @ForceInline
-    public long getAddress(long address) {
-        return theInternalUnsafe.getAddress(address);
-    }
-
-    /**
-     * Stores a native pointer into a given memory address.  If the address is
-     * zero, or does not point into a block obtained from {@link
-     * #allocateMemory}, the results are undefined.
-     *
-     * <p>The number of bytes actually written at the target address may be
-     * determined by consulting {@link #addressSize}.
-     *
-     * @see #getAddress(long)
-     */
-    @ForceInline
-    public void putAddress(long address, long x) {
-        theInternalUnsafe.putAddress(address, x);
-    }
-
-
-    /// wrappers for malloc, realloc, free:
-
-    /**
-     * Allocates a new block of native memory, of the given size in bytes.  The
-     * contents of the memory are uninitialized; they will generally be
-     * garbage.  The resulting native pointer will never be zero, and will be
-     * aligned for all value types.  Dispose of this memory by calling {@link
-     * #freeMemory}, or resize it with {@link #reallocateMemory}.
-     *
-     * <em>Note:</em> It is the resposibility of the caller to make
-     * sure arguments are checked before the methods are called. While
-     * some rudimentary checks are performed on the input, the checks
-     * are best effort and when performance is an overriding priority,
-     * as when methods of this class are optimized by the runtime
-     * compiler, some or all checks (if any) may be elided. Hence, the
-     * caller must not rely on the checks and corresponding
-     * exceptions!
-     *
-     * @throws RuntimeException if the size is negative or too large
-     *         for the native size_t type
-     *
-     * @throws OutOfMemoryError if the allocation is refused by the system
-     *
-     * @see #getByte(long)
-     * @see #putByte(long, byte)
-     */
-    @ForceInline
-    public long allocateMemory(long bytes) {
-        return theInternalUnsafe.allocateMemory(bytes);
-    }
-
-    /**
-     * Resizes a new block of native memory, to the given size in bytes.  The
-     * contents of the new block past the size of the old block are
-     * uninitialized; they will generally be garbage.  The resulting native
-     * pointer will be zero if and only if the requested size is zero.  The
-     * resulting native pointer will be aligned for all value types.  Dispose
-     * of this memory by calling {@link #freeMemory}, or resize it with {@link
-     * #reallocateMemory}.  The address passed to this method may be null, in
-     * which case an allocation will be performed.
-     *
-     * <em>Note:</em> It is the resposibility of the caller to make
-     * sure arguments are checked before the methods are called. While
-     * some rudimentary checks are performed on the input, the checks
-     * are best effort and when performance is an overriding priority,
-     * as when methods of this class are optimized by the runtime
-     * compiler, some or all checks (if any) may be elided. Hence, the
-     * caller must not rely on the checks and corresponding
-     * exceptions!
-     *
-     * @throws RuntimeException if the size is negative or too large
-     *         for the native size_t type
-     *
-     * @throws OutOfMemoryError if the allocation is refused by the system
-     *
-     * @see #allocateMemory
-     */
-    @ForceInline
-    public long reallocateMemory(long address, long bytes) {
-        return theInternalUnsafe.reallocateMemory(address, bytes);
-    }
-
-    /**
-     * Sets all bytes in a given block of memory to a fixed value
-     * (usually zero).
-     *
-     * <p>This method determines a block's base address by means of two parameters,
-     * and so it provides (in effect) a <em>double-register</em> addressing mode,
-     * as discussed in {@link #getInt(Object,long)}.  When the object reference is null,
-     * the offset supplies an absolute base address.
-     *
-     * <p>The stores are in coherent (atomic) units of a size determined
-     * by the address and length parameters.  If the effective address and
-     * length are all even modulo 8, the stores take place in 'long' units.
-     * If the effective address and length are (resp.) even modulo 4 or 2,
-     * the stores take place in units of 'int' or 'short'.
-     *
-     * <em>Note:</em> It is the resposibility of the caller to make
-     * sure arguments are checked before the methods are called. While
-     * some rudimentary checks are performed on the input, the checks
-     * are best effort and when performance is an overriding priority,
-     * as when methods of this class are optimized by the runtime
-     * compiler, some or all checks (if any) may be elided. Hence, the
-     * caller must not rely on the checks and corresponding
-     * exceptions!
-     *
-     * @throws RuntimeException if any of the arguments is invalid
-     *
-     * @since 1.7
-     */
-    @ForceInline
-    public void setMemory(Object o, long offset, long bytes, byte value) {
-        theInternalUnsafe.setMemory(o, offset, bytes, value);
-    }
-
-    /**
-     * Sets all bytes in a given block of memory to a fixed value
-     * (usually zero).  This provides a <em>single-register</em> addressing mode,
-     * as discussed in {@link #getInt(Object,long)}.
-     *
-     * <p>Equivalent to {@code setMemory(null, address, bytes, value)}.
-     */
-    @ForceInline
-    public void setMemory(long address, long bytes, byte value) {
-        theInternalUnsafe.setMemory(address, bytes, value);
-    }
-
-    /**
-     * Sets all bytes in a given block of memory to a copy of another
-     * block.
-     *
-     * <p>This method determines each block's base address by means of two parameters,
-     * and so it provides (in effect) a <em>double-register</em> addressing mode,
-     * as discussed in {@link #getInt(Object,long)}.  When the object reference is null,
-     * the offset supplies an absolute base address.
-     *
-     * <p>The transfers are in coherent (atomic) units of a size determined
-     * by the address and length parameters.  If the effective addresses and
-     * length are all even modulo 8, the transfer takes place in 'long' units.
-     * If the effective addresses and length are (resp.) even modulo 4 or 2,
-     * the transfer takes place in units of 'int' or 'short'.
-     *
-     * <em>Note:</em> It is the resposibility of the caller to make
-     * sure arguments are checked before the methods are called. While
-     * some rudimentary checks are performed on the input, the checks
-     * are best effort and when performance is an overriding priority,
-     * as when methods of this class are optimized by the runtime
-     * compiler, some or all checks (if any) may be elided. Hence, the
-     * caller must not rely on the checks and corresponding
-     * exceptions!
-     *
-     * @throws RuntimeException if any of the arguments is invalid
-     *
-     * @since 1.7
-     */
-    @ForceInline
-    public void copyMemory(Object srcBase, long srcOffset,
-                           Object destBase, long destOffset,
-                           long bytes) {
-        theInternalUnsafe.copyMemory(srcBase, srcOffset, destBase, destOffset, bytes);
-    }
-
-    /**
-     * Sets all bytes in a given block of memory to a copy of another
-     * block.  This provides a <em>single-register</em> addressing mode,
-     * as discussed in {@link #getInt(Object,long)}.
-     *
-     * Equivalent to {@code copyMemory(null, srcAddress, null, destAddress, bytes)}.
-     */
-    @ForceInline
-    public void copyMemory(long srcAddress, long destAddress, long bytes) {
-        theInternalUnsafe.copyMemory(srcAddress, destAddress, bytes);
-    }
-
-    /**
-     * Disposes of a block of native memory, as obtained from {@link
-     * #allocateMemory} or {@link #reallocateMemory}.  The address passed to
-     * this method may be null, in which case no action is taken.
-     *
-     * <em>Note:</em> It is the resposibility of the caller to make
-     * sure arguments are checked before the methods are called. While
-     * some rudimentary checks are performed on the input, the checks
-     * are best effort and when performance is an overriding priority,
-     * as when methods of this class are optimized by the runtime
-     * compiler, some or all checks (if any) may be elided. Hence, the
-     * caller must not rely on the checks and corresponding
-     * exceptions!
-     *
-     * @throws RuntimeException if any of the arguments is invalid
-     *
-     * @see #allocateMemory
-     */
-    @ForceInline
-    public void freeMemory(long address) {
-        theInternalUnsafe.freeMemory(address);
-    }
-
-    /// random queries
-
-    /**
-     * This constant differs from all results that will ever be returned from
-     * {@link #staticFieldOffset}, {@link #objectFieldOffset},
-     * or {@link #arrayBaseOffset}.
-     */
-    public static final int INVALID_FIELD_OFFSET = jdk.internal.misc.Unsafe.INVALID_FIELD_OFFSET;
-
-    /**
-     * Reports the location of a given field in the storage allocation of its
-     * class.  Do not expect to perform any sort of arithmetic on this offset;
-     * it is just a cookie which is passed to the unsafe heap memory accessors.
-     *
-     * <p>Any given field will always have the same offset and base, and no
-     * two distinct fields of the same class will ever have the same offset
-     * and base.
-     *
-     * <p>As of 1.4.1, offsets for fields are represented as long values,
-     * although the Sun JVM does not use the most significant 32 bits.
-     * However, JVM implementations which store static fields at absolute
-     * addresses can use long offsets and null base pointers to express
-     * the field locations in a form usable by {@link #getInt(Object,long)}.
-     * Therefore, code which will be ported to such JVMs on 64-bit platforms
-     * must preserve all bits of static field offsets.
-     * @see #getInt(Object, long)
-     */
-    @ForceInline
-    public long objectFieldOffset(Field f) {
-        return theInternalUnsafe.objectFieldOffset(f);
-    }
-
-    /**
-     * Reports the location of a given static field, in conjunction with {@link
-     * #staticFieldBase}.
-     * <p>Do not expect to perform any sort of arithmetic on this offset;
-     * it is just a cookie which is passed to the unsafe heap memory accessors.
-     *
-     * <p>Any given field will always have the same offset, and no two distinct
-     * fields of the same class will ever have the same offset.
-     *
-     * <p>As of 1.4.1, offsets for fields are represented as long values,
-     * although the Sun JVM does not use the most significant 32 bits.
-     * It is hard to imagine a JVM technology which needs more than
-     * a few bits to encode an offset within a non-array object,
-     * However, for consistency with other methods in this class,
-     * this method reports its result as a long value.
-     * @see #getInt(Object, long)
-     */
-    @ForceInline
-    public long staticFieldOffset(Field f) {
-        return theInternalUnsafe.staticFieldOffset(f);
-    }
-
-    /**
-     * Reports the location of a given static field, in conjunction with {@link
-     * #staticFieldOffset}.
-     * <p>Fetch the base "Object", if any, with which static fields of the
-     * given class can be accessed via methods like {@link #getInt(Object,
-     * long)}.  This value may be null.  This value may refer to an object
-     * which is a "cookie", not guaranteed to be a real Object, and it should
-     * not be used in any way except as argument to the get and put routines in
-     * this class.
-     */
-    @ForceInline
-    public Object staticFieldBase(Field f) {
-        return theInternalUnsafe.staticFieldBase(f);
-    }
-
-    /**
-     * Detects if the given class may need to be initialized. This is often
-     * needed in conjunction with obtaining the static field base of a
-     * class.
-     * @return false only if a call to {@code ensureClassInitialized} would have no effect
-     */
-    @ForceInline
-    public boolean shouldBeInitialized(Class<?> c) {
-        return theInternalUnsafe.shouldBeInitialized(c);
-    }
-
-    /**
-     * Ensures the given class has been initialized. This is often
-     * needed in conjunction with obtaining the static field base of a
-     * class.
-     */
-    @ForceInline
-    public void ensureClassInitialized(Class<?> c) {
-        theInternalUnsafe.ensureClassInitialized(c);
-    }
-
-    /**
-     * Reports the offset of the first element in the storage allocation of a
-     * given array class.  If {@link #arrayIndexScale} returns a non-zero value
-     * for the same class, you may use that scale factor, together with this
-     * base offset, to form new offsets to access elements of arrays of the
-     * given class.
-     *
-     * @see #getInt(Object, long)
-     * @see #putInt(Object, long, int)
-     */
-    @ForceInline
-    public int arrayBaseOffset(Class<?> arrayClass) {
-        return theInternalUnsafe.arrayBaseOffset(arrayClass);
-    }
-
-    /** The value of {@code arrayBaseOffset(boolean[].class)} */
-    public static final int ARRAY_BOOLEAN_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_BOOLEAN_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(byte[].class)} */
-    public static final int ARRAY_BYTE_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(short[].class)} */
-    public static final int ARRAY_SHORT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_SHORT_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(char[].class)} */
-    public static final int ARRAY_CHAR_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_CHAR_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(int[].class)} */
-    public static final int ARRAY_INT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_INT_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(long[].class)} */
-    public static final int ARRAY_LONG_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_LONG_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(float[].class)} */
-    public static final int ARRAY_FLOAT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_FLOAT_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(double[].class)} */
-    public static final int ARRAY_DOUBLE_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_DOUBLE_BASE_OFFSET;
-
-    /** The value of {@code arrayBaseOffset(Object[].class)} */
-    public static final int ARRAY_OBJECT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_OBJECT_BASE_OFFSET;
-
-    /**
-     * Reports the scale factor for addressing elements in the storage
-     * allocation of a given array class.  However, arrays of "narrow" types
-     * will generally not work properly with accessors like {@link
-     * #getByte(Object, long)}, so the scale factor for such classes is reported
-     * as zero.
-     *
-     * @see #arrayBaseOffset
-     * @see #getInt(Object, long)
-     * @see #putInt(Object, long, int)
-     */
-    @ForceInline
-    public int arrayIndexScale(Class<?> arrayClass) {
-        return theInternalUnsafe.arrayIndexScale(arrayClass);
-    }
-
-    /** The value of {@code arrayIndexScale(boolean[].class)} */
-    public static final int ARRAY_BOOLEAN_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_BOOLEAN_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(byte[].class)} */
-    public static final int ARRAY_BYTE_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_BYTE_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(short[].class)} */
-    public static final int ARRAY_SHORT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_SHORT_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(char[].class)} */
-    public static final int ARRAY_CHAR_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_CHAR_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(int[].class)} */
-    public static final int ARRAY_INT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_INT_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(long[].class)} */
-    public static final int ARRAY_LONG_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_LONG_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(float[].class)} */
-    public static final int ARRAY_FLOAT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_FLOAT_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(double[].class)} */
-    public static final int ARRAY_DOUBLE_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_DOUBLE_INDEX_SCALE;
-
-    /** The value of {@code arrayIndexScale(Object[].class)} */
-    public static final int ARRAY_OBJECT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_OBJECT_INDEX_SCALE;
-
-    /**
-     * Reports the size in bytes of a native pointer, as stored via {@link
-     * #putAddress}.  This value will be either 4 or 8.  Note that the sizes of
-     * other primitive types (as stored in native memory blocks) is determined
-     * fully by their information content.
-     */
-    @ForceInline
-    public int addressSize() {
-        return theInternalUnsafe.addressSize();
-    }
-
-    /** The value of {@code addressSize()} */
-    public static final int ADDRESS_SIZE = theInternalUnsafe.addressSize();
-
-    /**
-     * Reports the size in bytes of a native memory page (whatever that is).
-     * This value will always be a power of two.
-     */
-    @ForceInline
-    public int pageSize() {
-        return theInternalUnsafe.pageSize();
-    }
-
-
-    /// random trusted operations from JNI:
-
-    /**
-     * Tells the VM to define a class, without security checks.  By default, the
-     * class loader and protection domain come from the caller's class.
-     */
-    @ForceInline
-    public Class<?> defineClass(String name, byte[] b, int off, int len,
-                                ClassLoader loader,
-                                ProtectionDomain protectionDomain) {
-        return theInternalUnsafe.defineClass(name, b, off, len, loader, protectionDomain);
-    }
-
-    /**
-     * Defines a class but does not make it known to the class loader or system dictionary.
-     * <p>
-     * For each CP entry, the corresponding CP patch must either be null or have
-     * the a format that matches its tag:
-     * <ul>
-     * <li>Integer, Long, Float, Double: the corresponding wrapper object type from java.lang
-     * <li>Utf8: a string (must have suitable syntax if used as signature or name)
-     * <li>Class: any java.lang.Class object
-     * <li>String: any object (not just a java.lang.String)
-     * <li>InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
-     * </ul>
-     * @param hostClass context for linkage, access control, protection domain, and class loader
-     * @param data      bytes of a class file
-     * @param cpPatches where non-null entries exist, they replace corresponding CP entries in data
-     */
-    @ForceInline
-    public Class<?> defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches) {
-        return theInternalUnsafe.defineAnonymousClass(hostClass, data, cpPatches);
-    }
-
-    /**
-     * Allocates an instance but does not run any constructor.
-     * Initializes the class if it has not yet been.
-     */
-    @ForceInline
-    public Object allocateInstance(Class<?> cls)
-        throws InstantiationException {
-        return theInternalUnsafe.allocateInstance(cls);
-    }
-
-    /** Throws the exception without telling the verifier. */
-    @ForceInline
-    public void throwException(Throwable ee) {
-        theInternalUnsafe.throwException(ee);
-    }
-
-    /**
-     * Atomically updates Java variable to {@code x} if it is currently
-     * holding {@code expected}.
-     *
-     * <p>This operation has memory semantics of a {@code volatile} read
-     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
-     *
-     * @return {@code true} if successful
-     */
-    @ForceInline
-    public final boolean compareAndSwapObject(Object o, long offset,
-                                              Object expected,
-                                              Object x) {
-        return theInternalUnsafe.compareAndSwapObject(o, offset, expected, x);
-    }
-
-    /**
-     * Atomically updates Java variable to {@code x} if it is currently
-     * holding {@code expected}.
-     *
-     * <p>This operation has memory semantics of a {@code volatile} read
-     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
-     *
-     * @return {@code true} if successful
-     */
-    @ForceInline
-    public final boolean compareAndSwapInt(Object o, long offset,
-                                           int expected,
-                                           int x) {
-        return theInternalUnsafe.compareAndSwapInt(o, offset, expected, x);
-    }
-
-    /**
-     * Atomically updates Java variable to {@code x} if it is currently
-     * holding {@code expected}.
-     *
-     * <p>This operation has memory semantics of a {@code volatile} read
-     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
-     *
-     * @return {@code true} if successful
-     */
-    @ForceInline
-    public final boolean compareAndSwapLong(Object o, long offset,
-                                            long expected,
-                                            long x) {
-        return theInternalUnsafe.compareAndSwapLong(o, offset, expected, x);
-    }
-
-    /**
-     * Fetches a reference value from a given Java variable, with volatile
-     * load semantics. Otherwise identical to {@link #getObject(Object, long)}
-     */
-    @ForceInline
-    public Object getObjectVolatile(Object o, long offset) {
-        return theInternalUnsafe.getObjectVolatile(o, offset);
-    }
-
-    /**
-     * Stores a reference value into a given Java variable, with
-     * volatile store semantics. Otherwise identical to {@link #putObject(Object, long, Object)}
-     */
-    @ForceInline
-    public void putObjectVolatile(Object o, long offset, Object x) {
-        theInternalUnsafe.putObjectVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getInt(Object, long)}  */
-    @ForceInline
-    public int getIntVolatile(Object o, long offset) {
-        return theInternalUnsafe.getIntVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putInt(Object, long, int)}  */
-    @ForceInline
-    public void putIntVolatile(Object o, long offset, int x) {
-        theInternalUnsafe.putIntVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getBoolean(Object, long)}  */
-    @ForceInline
-    public boolean getBooleanVolatile(Object o, long offset) {
-        return theInternalUnsafe.getBooleanVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putBoolean(Object, long, boolean)}  */
-    @ForceInline
-    public void putBooleanVolatile(Object o, long offset, boolean x) {
-        theInternalUnsafe.putBooleanVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getByte(Object, long)}  */
-    @ForceInline
-    public byte getByteVolatile(Object o, long offset) {
-        return theInternalUnsafe.getByteVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putByte(Object, long, byte)}  */
-    @ForceInline
-    public void putByteVolatile(Object o, long offset, byte x) {
-        theInternalUnsafe.putByteVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getShort(Object, long)}  */
-    @ForceInline
-    public short getShortVolatile(Object o, long offset) {
-        return theInternalUnsafe.getShortVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putShort(Object, long, short)}  */
-    @ForceInline
-    public void putShortVolatile(Object o, long offset, short x) {
-        theInternalUnsafe.putShortVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getChar(Object, long)}  */
-    @ForceInline
-    public char getCharVolatile(Object o, long offset) {
-        return theInternalUnsafe.getCharVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putChar(Object, long, char)}  */
-    @ForceInline
-    public void putCharVolatile(Object o, long offset, char x) {
-        theInternalUnsafe.putCharVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getLong(Object, long)}  */
-    @ForceInline
-    public long getLongVolatile(Object o, long offset) {
-        return theInternalUnsafe.getLongVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putLong(Object, long, long)}  */
-    @ForceInline
-    public void putLongVolatile(Object o, long offset, long x) {
-        theInternalUnsafe.putLongVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getFloat(Object, long)}  */
-    @ForceInline
-    public float getFloatVolatile(Object o, long offset) {
-        return theInternalUnsafe.getFloatVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putFloat(Object, long, float)}  */
-    @ForceInline
-    public void putFloatVolatile(Object o, long offset, float x) {
-        theInternalUnsafe.putFloatVolatile(o, offset, x);
-    }
-
-    /** Volatile version of {@link #getDouble(Object, long)}  */
-    @ForceInline
-    public double getDoubleVolatile(Object o, long offset) {
-        return theInternalUnsafe.getDoubleVolatile(o, offset);
-    }
-
-    /** Volatile version of {@link #putDouble(Object, long, double)}  */
-    @ForceInline
-    public void putDoubleVolatile(Object o, long offset, double x) {
-        theInternalUnsafe.putDoubleVolatile(o, offset, x);
-    }
-
-    /**
-     * Version of {@link #putObjectVolatile(Object, long, Object)}
-     * that does not guarantee immediate visibility of the store to
-     * other threads. This method is generally only useful if the
-     * underlying field is a Java volatile (or if an array cell, one
-     * that is otherwise only accessed using volatile accesses).
-     *
-     * Corresponds to C11 atomic_store_explicit(..., memory_order_release).
-     */
-    @ForceInline
-    public void putOrderedObject(Object o, long offset, Object x) {
-        theInternalUnsafe.putObjectRelease(o, offset, x);
-    }
-
-    /** Ordered/Lazy version of {@link #putIntVolatile(Object, long, int)}  */
-    @ForceInline
-    public void putOrderedInt(Object o, long offset, int x) {
-        theInternalUnsafe.putIntRelease(o, offset, x);
-    }
-
-    /** Ordered/Lazy version of {@link #putLongVolatile(Object, long, long)} */
-    @ForceInline
-    public void putOrderedLong(Object o, long offset, long x) {
-        theInternalUnsafe.putLongRelease(o, offset, x);
-    }
-
-    /**
-     * Unblocks the given thread blocked on {@code park}, or, if it is
-     * not blocked, causes the subsequent call to {@code park} not to
-     * block.  Note: this operation is "unsafe" solely because the
-     * caller must somehow ensure that the thread has not been
-     * destroyed. Nothing special is usually required to ensure this
-     * when called from Java (in which there will ordinarily be a live
-     * reference to the thread) but this is not nearly-automatically
-     * so when calling from native code.
-     *
-     * @param thread the thread to unpark.
-     */
-    @ForceInline
-    public void unpark(Object thread) {
-        theInternalUnsafe.unpark(thread);
-    }
-
-    /**
-     * Blocks current thread, returning when a balancing
-     * {@code unpark} occurs, or a balancing {@code unpark} has
-     * already occurred, or the thread is interrupted, or, if not
-     * absolute and time is not zero, the given time nanoseconds have
-     * elapsed, or if absolute, the given deadline in milliseconds
-     * since Epoch has passed, or spuriously (i.e., returning for no
-     * "reason"). Note: This operation is in the Unsafe class only
-     * because {@code unpark} is, so it would be strange to place it
-     * elsewhere.
-     */
-    @ForceInline
-    public void park(boolean isAbsolute, long time) {
-        theInternalUnsafe.park(isAbsolute, time);
-    }
-
-    /**
-     * Gets the load average in the system run queue assigned
-     * to the available processors averaged over various periods of time.
-     * This method retrieves the given {@code nelem} samples and
-     * assigns to the elements of the given {@code loadavg} array.
-     * The system imposes a maximum of 3 samples, representing
-     * averages over the last 1,  5,  and  15 minutes, respectively.
-     *
-     * @param loadavg an array of double of size nelems
-     * @param nelems the number of samples to be retrieved and
-     *        must be 1 to 3.
-     *
-     * @return the number of samples actually retrieved; or -1
-     *         if the load average is unobtainable.
-     */
-    @ForceInline
-    public int getLoadAverage(double[] loadavg, int nelems) {
-        return theInternalUnsafe.getLoadAverage(loadavg, nelems);
-    }
-
-    // The following contain CAS-based Java implementations used on
-    // platforms not supporting native instructions
-
-    /**
-     * Atomically adds the given value to the current value of a field
-     * or array element within the given object {@code o}
-     * at the given {@code offset}.
-     *
-     * @param o object/array to update the field/element in
-     * @param offset field/element offset
-     * @param delta the value to add
-     * @return the previous value
-     * @since 1.8
-     */
-    @ForceInline
-    public final int getAndAddInt(Object o, long offset, int delta) {
-        return theInternalUnsafe.getAndAddInt(o, offset, delta);
-    }
-
-    /**
-     * Atomically adds the given value to the current value of a field
-     * or array element within the given object {@code o}
-     * at the given {@code offset}.
-     *
-     * @param o object/array to update the field/element in
-     * @param offset field/element offset
-     * @param delta the value to add
-     * @return the previous value
-     * @since 1.8
-     */
-    @ForceInline
-    public final long getAndAddLong(Object o, long offset, long delta) {
-        return theInternalUnsafe.getAndAddLong(o, offset, delta);
-    }
-
-    /**
-     * Atomically exchanges the given value with the current value of
-     * a field or array element within the given object {@code o}
-     * at the given {@code offset}.
-     *
-     * @param o object/array to update the field/element in
-     * @param offset field/element offset
-     * @param newValue new value
-     * @return the previous value
-     * @since 1.8
-     */
-    @ForceInline
-    public final int getAndSetInt(Object o, long offset, int newValue) {
-        return theInternalUnsafe.getAndSetInt(o, offset, newValue);
-    }
-
-    /**
-     * Atomically exchanges the given value with the current value of
-     * a field or array element within the given object {@code o}
-     * at the given {@code offset}.
-     *
-     * @param o object/array to update the field/element in
-     * @param offset field/element offset
-     * @param newValue new value
-     * @return the previous value
-     * @since 1.8
-     */
-    @ForceInline
-    public final long getAndSetLong(Object o, long offset, long newValue) {
-        return theInternalUnsafe.getAndSetLong(o, offset, newValue);
-    }
-
-    /**
-     * Atomically exchanges the given reference value with the current
-     * reference value of a field or array element within the given
-     * object {@code o} at the given {@code offset}.
-     *
-     * @param o object/array to update the field/element in
-     * @param offset field/element offset
-     * @param newValue new value
-     * @return the previous value
-     * @since 1.8
-     */
-    @ForceInline
-    public final Object getAndSetObject(Object o, long offset, Object newValue) {
-        return theInternalUnsafe.getAndSetObject(o, offset, newValue);
-    }
-
-
-    /**
-     * Ensures that loads before the fence will not be reordered with loads and
-     * stores after the fence; a "LoadLoad plus LoadStore barrier".
-     *
-     * Corresponds to C11 atomic_thread_fence(memory_order_acquire)
-     * (an "acquire fence").
-     *
-     * A pure LoadLoad fence is not provided, since the addition of LoadStore
-     * is almost always desired, and most current hardware instructions that
-     * provide a LoadLoad barrier also provide a LoadStore barrier for free.
-     * @since 1.8
-     */
-    @ForceInline
-    public void loadFence() {
-        theInternalUnsafe.loadFence();
-    }
-
-    /**
-     * Ensures that loads and stores before the fence will not be reordered with
-     * stores after the fence; a "StoreStore plus LoadStore barrier".
-     *
-     * Corresponds to C11 atomic_thread_fence(memory_order_release)
-     * (a "release fence").
-     *
-     * A pure StoreStore fence is not provided, since the addition of LoadStore
-     * is almost always desired, and most current hardware instructions that
-     * provide a StoreStore barrier also provide a LoadStore barrier for free.
-     * @since 1.8
-     */
-    @ForceInline
-    public void storeFence() {
-        theInternalUnsafe.storeFence();
-    }
-
-    /**
-     * Ensures that loads and stores before the fence will not be reordered
-     * with loads and stores after the fence.  Implies the effects of both
-     * loadFence() and storeFence(), and in addition, the effect of a StoreLoad
-     * barrier.
-     *
-     * Corresponds to C11 atomic_thread_fence(memory_order_seq_cst).
-     * @since 1.8
-     */
-    @ForceInline
-    public void fullFence() {
-        theInternalUnsafe.fullFence();
-    }
-}
--- a/jdk/src/java.base/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,8 +25,6 @@
 
 package sun.nio.ch;
 
-import sun.misc.*;
-
 
 /**
  * Manipulates a native array of pollfd structs.
--- a/jdk/src/java.base/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.base/solaris/classes/sun/nio/ch/DevPollSelectorImpl.java	Sat Apr 09 20:12:13 2016 +0100
@@ -29,7 +29,6 @@
 import java.nio.channels.*;
 import java.nio.channels.spi.*;
 import java.util.*;
-import sun.misc.*;
 
 
 /**
--- a/jdk/src/java.base/unix/classes/sun/misc/GThreadHelper.java	Sat Apr 09 20:11:51 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * This class is used to prevent multiple calling of g_thread_init ()
- * and gdk_thread_init ().
- *
- * Since version 2.24 of GLib, calling g_thread_init () multiple times is
- * allowed, but it will crash for older versions. There are two ways to
- * find out if g_thread_init () has been called:
- * g_thread_get_initialized (), but it was introduced in 2.20
- * g_thread_supported (), but it is a macro and cannot be loaded with dlsym.
- *
- * usage:
- * <pre>
- * lock();
- * try {
- *    if (!getAndSetInitializationNeededFlag()) {
- *        //call to g_thread_init();
- *        //call to gdk_thread_init();
- *    }
- * } finally {
- *    unlock();
- * }
- * </pre>
- */
-public final class GThreadHelper {
-
-    private static final ReentrantLock LOCK = new ReentrantLock();
-    private static boolean isGThreadInitialized = false;
-
-    /**
-     * Acquires the lock.
-     */
-    public static void lock() {
-        LOCK.lock();
-    }
-
-    /**
-     * Releases the lock.
-     */
-    public static void unlock() {
-        LOCK.unlock();
-    }
-
-    /**
-     * Gets current value of initialization flag and sets it to {@code true}.
-     * MUST be called under the lock.
-     *
-     * A return value of {@code false} indicates that the calling code
-     * should call the g_thread_init() and gdk_thread_init() functions
-     * before releasing the lock.
-     *
-     * @return {@code true} if initialization has been completed.
-     */
-    public static boolean getAndSetInitializationNeededFlag() {
-        boolean ret = isGThreadInitialized;
-        isGThreadInitialized = true;
-        return ret;
-    }
-}
--- a/jdk/src/java.base/unix/classes/sun/nio/ch/PollArrayWrapper.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.base/unix/classes/sun/nio/ch/PollArrayWrapper.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,8 +25,6 @@
 
 package sun.nio.ch;
 
-import sun.misc.*;
-
 
 /**
  * Manipulates a native array of pollfd structs on Solaris:
--- a/jdk/src/java.desktop/share/classes/module-info.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.desktop/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -27,6 +27,8 @@
     requires public java.datatransfer;
     requires public java.xml;
     requires java.prefs;
+    // 8147544
+    requires jdk.unsupported;
 
     exports java.applet;
     exports java.awt;
--- a/jdk/src/java.logging/share/classes/module-info.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.logging/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -24,6 +24,8 @@
  */
 
 module java.logging {
+    // 8153158
+    requires jdk.unsupported;
     exports java.util.logging;
     provides jdk.internal.logger.DefaultLoggerFinder with
         sun.util.logging.internal.LoggingProviderImpl;
--- a/jdk/src/java.management/share/classes/module-info.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/java.management/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -27,6 +27,8 @@
     requires public java.rmi;
     requires java.logging;
     requires java.naming;
+    // 8147553
+    requires jdk.unsupported;
 
     exports java.lang.management;
     exports javax.management;
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/module-info.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -26,6 +26,8 @@
 module jdk.crypto.pkcs11 {
     // Depends on SunEC provider for EC related functionality
     requires jdk.crypto.ec;
+    // 8153371
+    requires jdk.unsupported;
     provides java.security.Provider with sun.security.pkcs11.SunPKCS11;
 }
 
--- a/jdk/src/jdk.httpserver/share/classes/module-info.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/src/jdk.httpserver/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,6 +25,8 @@
 
 module jdk.httpserver {
     requires java.logging;
+    // 8153372
+    requires jdk.unsupported;
     exports com.sun.net.httpserver;
     exports com.sun.net.httpserver.spi;
     uses com.sun.net.httpserver.spi.HttpServerProvider;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/module-info.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module jdk.unsupported {
+    exports sun.misc;
+    //exports sun.reflect;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/ManagedLocalsThread.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+/**
+ * A thread that has it's thread locals, and inheritable thread
+ * locals erased on construction.
+ */
+public class ManagedLocalsThread extends Thread {
+    private static final jdk.internal.misc.Unsafe UNSAFE;
+    private static final long THREAD_LOCALS;
+    private static final long INHERITABLE_THREAD_LOCALS;
+
+    public ManagedLocalsThread() {
+        eraseThreadLocals();
+    }
+
+    public ManagedLocalsThread(Runnable target) {
+        super(target);
+        eraseThreadLocals();
+    }
+
+    public ManagedLocalsThread(String name) {
+        super(name);
+        eraseThreadLocals();
+    }
+
+    public ManagedLocalsThread(ThreadGroup group, Runnable target) {
+        super(group, target);
+        eraseThreadLocals();
+    }
+
+    public ManagedLocalsThread(Runnable target, String name) {
+        super(target, name);
+        eraseThreadLocals();
+    }
+
+    public ManagedLocalsThread(ThreadGroup group, String name) {
+        super(group, name);
+        eraseThreadLocals();
+    }
+
+    public ManagedLocalsThread(ThreadGroup group, Runnable target, String name) {
+        super(group, target, name);
+        eraseThreadLocals();
+    }
+
+    /**
+     * Drops all thread locals (and inherited thread locals).
+     */
+    public final void eraseThreadLocals() {
+        UNSAFE.putObject(this, THREAD_LOCALS, null);
+        UNSAFE.putObject(this, INHERITABLE_THREAD_LOCALS, null);
+    }
+
+    static {
+        UNSAFE = jdk.internal.misc.Unsafe.getUnsafe();
+        Class<?> t = Thread.class;
+        try {
+            THREAD_LOCALS = UNSAFE.objectFieldOffset
+                (t.getDeclaredField("threadLocals"));
+            INHERITABLE_THREAD_LOCALS = UNSAFE.objectFieldOffset
+                (t.getDeclaredField("inheritableThreadLocals"));
+        } catch (Exception e) {
+            throw new Error(e);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/Signal.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+import java.util.Objects;
+
+/**
+ * This class provides ANSI/ISO C signal support. A Java program can register
+ * signal handlers for the current process. There are two restrictions:
+ * <ul>
+ * <li>
+ * Java code cannot register a handler for signals that are already used
+ * by the Java VM implementation. The <code>Signal.handle</code>
+ * function raises an <code>IllegalArgumentException</code> if such an attempt
+ * is made.
+ * <li>
+ * When <code>Signal.handle</code> is called, the VM internally registers a
+ * special C signal handler. There is no way to force the Java signal handler
+ * to run synchronously before the C signal handler returns. Instead, when the
+ * VM receives a signal, the special C signal handler creates a new thread
+ * (at priority <code>Thread.MAX_PRIORITY</code>) to
+ * run the registered Java signal handler. The C signal handler immediately
+ * returns. Note that because the Java signal handler runs in a newly created
+ * thread, it may not actually be executed until some time after the C signal
+ * handler returns.
+ * </ul>
+ * <p>
+ * Signal objects are created based on their names. For example:
+ * <blockquote><pre>
+ * new Signal("INT");
+ * </pre></blockquote>
+ * constructs a signal object corresponding to <code>SIGINT</code>, which is
+ * typically produced when the user presses <code>Ctrl-C</code> at the command line.
+ * The <code>Signal</code> constructor throws <code>IllegalArgumentException</code>
+ * when it is passed an unknown signal.
+ * <p>
+ * This is an example of how Java code handles <code>SIGINT</code>:
+ * <blockquote><pre>
+ * SignalHandler handler = new SignalHandler () {
+ *     public void handle(Signal sig) {
+ *       ... // handle SIGINT
+ *     }
+ * };
+ * Signal.handle(new Signal("INT"), handler);
+ * </pre></blockquote>
+ *
+ * @author   Sheng Liang
+ * @author   Bill Shannon
+ * @see     sun.misc.SignalHandler
+ * @since    1.2
+ */
+public final class Signal {
+
+    // Delegate to jdk.internal.misc.Signal.
+    private final jdk.internal.misc.Signal iSignal;
+
+    /* Returns the signal number */
+    public int getNumber() {
+        return iSignal.getNumber();
+    }
+
+    /**
+     * Returns the signal name.
+     *
+     * @return the name of the signal.
+     * @see sun.misc.Signal#Signal(String name)
+     */
+    public String getName() {
+        return iSignal.getName();
+    }
+
+    /**
+     * Compares the equality of two <code>Signal</code> objects.
+     *
+     * @param other the object to compare with.
+     * @return whether two <code>Signal</code> objects are equal.
+     */
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (other == null || !(other instanceof Signal)) {
+            return false;
+        }
+        Signal other1 = (Signal)other;
+        return iSignal.equals(other1.iSignal);
+    }
+
+    /**
+     * Returns a hashcode for this Signal.
+     *
+     * @return  a hash code value for this object.
+     */
+    public int hashCode() {
+        return getNumber();
+    }
+
+    /**
+     * Returns a string representation of this signal. For example, "SIGINT"
+     * for an object constructed using <code>new Signal ("INT")</code>.
+     *
+     * @return a string representation of the signal
+     */
+    public String toString() {
+        return iSignal.toString();
+    }
+
+    /**
+     * Constructs a signal from its name.
+     *
+     * @param name the name of the signal.
+     * @exception IllegalArgumentException unknown signal
+     * @see sun.misc.Signal#getName()
+     */
+    public Signal(String name) {
+        iSignal = new jdk.internal.misc.Signal(name);
+    }
+
+    /**
+     * Registers a signal handler.
+     *
+     * @param sig a signal
+     * @param handler the handler to be registered with the given signal.
+     * @return the old handler
+     * @exception IllegalArgumentException the signal is in use by the VM
+     * @see sun.misc.Signal#raise(Signal sig)
+     * @see sun.misc.SignalHandler
+     * @see sun.misc.SignalHandler#SIG_DFL
+     * @see sun.misc.SignalHandler#SIG_IGN
+     */
+    public static synchronized SignalHandler handle(Signal sig,
+                                                    SignalHandler handler)
+        throws IllegalArgumentException {
+        jdk.internal.misc.Signal.Handler oldHandler = jdk.internal.misc.Signal.handle(sig.iSignal,
+                InternalMiscHandler.of(sig, handler));
+        return SunMiscHandler.of(sig.iSignal, oldHandler);
+    }
+
+    /**
+     * Raises a signal in the current process.
+     *
+     * @param sig a signal
+     * @see sun.misc.Signal#handle(Signal sig, SignalHandler handler)
+     */
+    public static void raise(Signal sig) throws IllegalArgumentException {
+        jdk.internal.misc.Signal.raise(sig.iSignal);
+    }
+
+    /*
+     * Wrapper class to proxy a SignalHandler to a jdk.internal.misc.Signal.Handler.
+     */
+    static final class InternalMiscHandler implements jdk.internal.misc.Signal.Handler {
+        private final SignalHandler handler;
+        private final Signal signal;
+
+        static jdk.internal.misc.Signal.Handler of(Signal signal, SignalHandler handler) {
+            if (handler == SignalHandler.SIG_DFL) {
+                return jdk.internal.misc.Signal.Handler.SIG_DFL;
+            } else if (handler == SignalHandler.SIG_IGN) {
+                return jdk.internal.misc.Signal.Handler.SIG_IGN;
+            } else if (handler instanceof SunMiscHandler) {
+                return ((SunMiscHandler)handler).iHandler;
+            } else {
+                return new InternalMiscHandler(signal, handler);
+            }
+        }
+
+        private InternalMiscHandler(Signal signal, SignalHandler handler) {
+            this.handler = handler;
+            this.signal = signal;
+        }
+
+        @Override
+        public void handle(jdk.internal.misc.Signal ignore) {
+            handler.handle(signal);
+        }
+    }
+
+    /*
+     * Wrapper class to proxy a jdk.internal.misc.Signal.Handler to a SignalHandler.
+     */
+    static final class SunMiscHandler implements SignalHandler {
+        private final jdk.internal.misc.Signal iSignal;
+        private final jdk.internal.misc.Signal.Handler iHandler;
+
+        static SignalHandler of(jdk.internal.misc.Signal signal, jdk.internal.misc.Signal.Handler handler) {
+            if (handler == jdk.internal.misc.Signal.Handler.SIG_DFL) {
+                return SignalHandler.SIG_DFL;
+            } else if (handler == jdk.internal.misc.Signal.Handler.SIG_IGN) {
+                return SignalHandler.SIG_IGN;
+            } else if (handler instanceof InternalMiscHandler) {
+                return ((InternalMiscHandler) handler).handler;
+            } else {
+                return new SunMiscHandler(signal, handler);
+            }
+        }
+
+        SunMiscHandler(jdk.internal.misc.Signal iSignal, jdk.internal.misc.Signal.Handler iHandler) {
+            this.iSignal = iSignal;
+            this.iHandler = iHandler;
+        }
+
+        @Override
+        public void handle(Signal sig) {
+            iHandler.handle(iSignal);
+        }
+
+        public String toString() {
+            return iHandler.toString();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/SignalHandler.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+/**
+ * This is the signal handler interface expected in <code>Signal.handle</code>.
+ *
+ * @author   Sheng Liang
+ * @author   Bill Shannon
+ * @see      sun.misc.Signal
+ * @since    1.2
+ */
+
+public interface SignalHandler {
+
+    /**
+     * The default signal handler
+     */
+    public static final SignalHandler SIG_DFL =
+            new Signal.SunMiscHandler(null, jdk.internal.misc.Signal.Handler.SIG_DFL);
+    /**
+     * Ignore the signal
+     */
+    public static final SignalHandler SIG_IGN =
+            new Signal.SunMiscHandler(null, jdk.internal.misc.Signal.Handler.SIG_IGN);
+
+    /**
+     * Handle the given signal
+     *
+     * @param sig a signal object
+     */
+    public void handle(Signal sig);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/SoftCache.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,462 @@
+/*
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+import java.lang.ref.SoftReference;
+import java.lang.ref.ReferenceQueue;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.AbstractMap;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.AbstractSet;
+import java.util.NoSuchElementException;
+
+
+/**
+ * A memory-sensitive implementation of the <code>Map</code> interface.
+ *
+ * <p> A <code>SoftCache</code> object uses {@link java.lang.ref.SoftReference
+ * soft references} to implement a memory-sensitive hash map.  If the garbage
+ * collector determines at a certain point in time that a value object in a
+ * <code>SoftCache</code> entry is no longer strongly reachable, then it may
+ * remove that entry in order to release the memory occupied by the value
+ * object.  All <code>SoftCache</code> objects are guaranteed to be completely
+ * cleared before the virtual machine will throw an
+ * <code>OutOfMemoryError</code>.  Because of this automatic clearing feature,
+ * the behavior of this class is somewhat different from that of other
+ * <code>Map</code> implementations.
+ *
+ * <p> Both null values and the null key are supported.  This class has the
+ * same performance characteristics as the <code>HashMap</code> class, and has
+ * the same efficiency parameters of <em>initial capacity</em> and <em>load
+ * factor</em>.
+ *
+ * <p> Like most collection classes, this class is not synchronized.  A
+ * synchronized <code>SoftCache</code> may be constructed using the
+ * <code>Collections.synchronizedMap</code> method.
+ *
+ * <p> In typical usage this class will be subclassed and the <code>fill</code>
+ * method will be overridden.  When the <code>get</code> method is invoked on a
+ * key for which there is no mapping in the cache, it will in turn invoke the
+ * <code>fill</code> method on that key in an attempt to construct a
+ * corresponding value.  If the <code>fill</code> method returns such a value
+ * then the cache will be updated and the new value will be returned.  Thus,
+ * for example, a simple URL-content cache can be constructed as follows:
+ *
+ * <pre>
+ *     public class URLCache extends SoftCache {
+ *         protected Object fill(Object key) {
+ *             return ((URL)key).getContent();
+ *         }
+ *     }
+ * </pre>
+ *
+ * <p> The behavior of the <code>SoftCache</code> class depends in part upon
+ * the actions of the garbage collector, so several familiar (though not
+ * required) <code>Map</code> invariants do not hold for this class.  <p>
+ * Because entries are removed from a <code>SoftCache</code> in response to
+ * dynamic advice from the garbage collector, a <code>SoftCache</code> may
+ * behave as though an unknown thread is silently removing entries.  In
+ * particular, even if you synchronize on a <code>SoftCache</code> instance and
+ * invoke none of its mutator methods, it is possible for the <code>size</code>
+ * method to return smaller values over time, for the <code>isEmpty</code>
+ * method to return <code>false</code> and then <code>true</code>, for the
+ * <code>containsKey</code> method to return <code>true</code> and later
+ * <code>false</code> for a given key, for the <code>get</code> method to
+ * return a value for a given key but later return <code>null</code>, for the
+ * <code>put</code> method to return <code>null</code> and the
+ * <code>remove</code> method to return <code>false</code> for a key that
+ * previously appeared to be in the map, and for successive examinations of the
+ * key set, the value set, and the entry set to yield successively smaller
+ * numbers of elements.
+ *
+ * @author      Mark Reinhold
+ * @since       1.2
+ * @see         java.util.HashMap
+ * @see         java.lang.ref.SoftReference
+ * @deprecated No direct replacement; {@link java.util.WeakHashMap}
+ * addresses a related by different use-case.
+ */
+
+@Deprecated
+public class SoftCache extends AbstractMap<Object, Object> implements Map<Object, Object> {
+
+    /* The basic idea of this implementation is to maintain an internal HashMap
+       that maps keys to soft references whose referents are the keys' values;
+       the various accessor methods dereference these soft references before
+       returning values.  Because we don't have access to the innards of the
+       HashMap, each soft reference must contain the key that maps to it so
+       that the processQueue method can remove keys whose values have been
+       discarded.  Thus the HashMap actually maps keys to instances of the
+       ValueCell class, which is a simple extension of the SoftReference class.
+     */
+
+
+    private static class ValueCell extends SoftReference<Object> {
+        private static Object INVALID_KEY = new Object();
+        private static int dropped = 0;
+        private Object key;
+
+        private ValueCell(Object key, Object value, ReferenceQueue<Object> queue) {
+            super(value, queue);
+            this.key = key;
+        }
+
+        private static ValueCell create(Object key, Object value,
+                                        ReferenceQueue<Object> queue)
+        {
+            if (value == null) return null;
+            return new ValueCell(key, value, queue);
+        }
+
+        private static Object strip(Object val, boolean drop) {
+            if (val == null) return null;
+            ValueCell vc = (ValueCell)val;
+            Object o = vc.get();
+            if (drop) vc.drop();
+            return o;
+        }
+
+        private boolean isValid() {
+            return (key != INVALID_KEY);
+        }
+
+        private void drop() {
+            super.clear();
+            key = INVALID_KEY;
+            dropped++;
+        }
+
+    }
+
+
+    /* Hash table mapping keys to ValueCells */
+    private Map<Object, Object> hash;
+
+    /* Reference queue for cleared ValueCells */
+    private ReferenceQueue<Object> queue = new ReferenceQueue<>();
+
+
+    /* Process any ValueCells that have been cleared and enqueued by the
+       garbage collector.  This method should be invoked once by each public
+       mutator in this class.  We don't invoke this method in public accessors
+       because that can lead to surprising ConcurrentModificationExceptions.
+     */
+    private void processQueue() {
+        ValueCell vc;
+        while ((vc = (ValueCell)queue.poll()) != null) {
+            if (vc.isValid()) hash.remove(vc.key);
+            else ValueCell.dropped--;
+        }
+    }
+
+
+    /* -- Constructors -- */
+
+    /**
+     * Construct a new, empty <code>SoftCache</code> with the given
+     * initial capacity and the given load factor.
+     *
+     * @param  initialCapacity  The initial capacity of the cache
+     *
+     * @param  loadFactor       A number between 0.0 and 1.0
+     *
+     * @throws IllegalArgumentException  If the initial capacity is less than
+     *                                   or equal to zero, or if the load
+     *                                   factor is less than zero
+     */
+    public SoftCache(int initialCapacity, float loadFactor) {
+        hash = new HashMap<>(initialCapacity, loadFactor);
+    }
+
+    /**
+     * Construct a new, empty <code>SoftCache</code> with the given
+     * initial capacity and the default load factor.
+     *
+     * @param  initialCapacity  The initial capacity of the cache
+     *
+     * @throws IllegalArgumentException  If the initial capacity is less than
+     *                                   or equal to zero
+     */
+    public SoftCache(int initialCapacity) {
+        hash = new HashMap<>(initialCapacity);
+    }
+
+    /**
+     * Construct a new, empty <code>SoftCache</code> with the default
+     * capacity and the default load factor.
+     */
+    public SoftCache() {
+        hash = new HashMap<>();
+    }
+
+
+    /* -- Simple queries -- */
+
+    /**
+     * Return the number of key-value mappings in this cache.  The time
+     * required by this operation is linear in the size of the map.
+     */
+    public int size() {
+        return entrySet().size();
+    }
+
+    /**
+     * Return <code>true</code> if this cache contains no key-value mappings.
+     */
+    public boolean isEmpty() {
+        return entrySet().isEmpty();
+    }
+
+    /**
+     * Return <code>true</code> if this cache contains a mapping for the
+     * specified key.  If there is no mapping for the key, this method will not
+     * attempt to construct one by invoking the <code>fill</code> method.
+     *
+     * @param   key   The key whose presence in the cache is to be tested
+     */
+    public boolean containsKey(Object key) {
+        return ValueCell.strip(hash.get(key), false) != null;
+    }
+
+
+    /* -- Lookup and modification operations -- */
+
+    /**
+     * Create a value object for the given <code>key</code>.  This method is
+     * invoked by the <code>get</code> method when there is no entry for
+     * <code>key</code>.  If this method returns a non-<code>null</code> value,
+     * then the cache will be updated to map <code>key</code> to that value,
+     * and that value will be returned by the <code>get</code> method.
+     *
+     * <p> The default implementation of this method simply returns
+     * <code>null</code> for every <code>key</code> value.  A subclass may
+     * override this method to provide more useful behavior.
+     *
+     * @param  key  The key for which a value is to be computed
+     *
+     * @return      A value for <code>key</code>, or <code>null</code> if one
+     *              could not be computed
+     * @see #get
+     */
+    protected Object fill(Object key) {
+        return null;
+    }
+
+    /**
+     * Return the value to which this cache maps the specified
+     * <code>key</code>.  If the cache does not presently contain a value for
+     * this key, then invoke the <code>fill</code> method in an attempt to
+     * compute such a value.  If that method returns a non-<code>null</code>
+     * value, then update the cache and return the new value.  Otherwise,
+     * return <code>null</code>.
+     *
+     * <p> Note that because this method may update the cache, it is considered
+     * a mutator and may cause <code>ConcurrentModificationException</code>s to
+     * be thrown if invoked while an iterator is in use.
+     *
+     * @param  key  The key whose associated value, if any, is to be returned
+     *
+     * @see #fill
+     */
+    public Object get(Object key) {
+        processQueue();
+        Object v = hash.get(key);
+        if (v == null) {
+            v = fill(key);
+            if (v != null) {
+                hash.put(key, ValueCell.create(key, v, queue));
+                return v;
+            }
+        }
+        return ValueCell.strip(v, false);
+    }
+
+    /**
+     * Update this cache so that the given <code>key</code> maps to the given
+     * <code>value</code>.  If the cache previously contained a mapping for
+     * <code>key</code> then that mapping is replaced and the old value is
+     * returned.
+     *
+     * @param  key    The key that is to be mapped to the given
+     *                <code>value</code>
+     * @param  value  The value to which the given <code>key</code> is to be
+     *                mapped
+     *
+     * @return  The previous value to which this key was mapped, or
+     *          <code>null</code> if there was no mapping for the key
+     */
+    public Object put(Object key, Object value) {
+        processQueue();
+        ValueCell vc = ValueCell.create(key, value, queue);
+        return ValueCell.strip(hash.put(key, vc), true);
+    }
+
+    /**
+     * Remove the mapping for the given <code>key</code> from this cache, if
+     * present.
+     *
+     * @param  key  The key whose mapping is to be removed
+     *
+     * @return  The value to which this key was mapped, or <code>null</code> if
+     *          there was no mapping for the key
+     */
+    public Object remove(Object key) {
+        processQueue();
+        return ValueCell.strip(hash.remove(key), true);
+    }
+
+    /**
+     * Remove all mappings from this cache.
+     */
+    public void clear() {
+        processQueue();
+        hash.clear();
+    }
+
+
+    /* -- Views -- */
+
+    private static boolean valEquals(Object o1, Object o2) {
+        return (o1 == null) ? (o2 == null) : o1.equals(o2);
+    }
+
+
+    /* Internal class for entries.
+       Because it uses SoftCache.this.queue, this class cannot be static.
+     */
+    private class Entry implements Map.Entry<Object, Object> {
+        private Map.Entry<Object, Object> ent;
+        private Object value;   /* Strong reference to value, to prevent the GC
+                                   from flushing the value while this Entry
+                                   exists */
+
+        Entry(Map.Entry<Object, Object> ent, Object value) {
+            this.ent = ent;
+            this.value = value;
+        }
+
+        public Object getKey() {
+            return ent.getKey();
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object setValue(Object value) {
+            return ent.setValue(ValueCell.create(ent.getKey(), value, queue));
+        }
+
+        @SuppressWarnings("unchecked")
+        public boolean equals(Object o) {
+            if (! (o instanceof Map.Entry)) return false;
+            Map.Entry<Object, Object> e = (Map.Entry<Object, Object>)o;
+            return (valEquals(ent.getKey(), e.getKey())
+                    && valEquals(value, e.getValue()));
+        }
+
+        public int hashCode() {
+            Object k;
+            return ((((k = getKey()) == null) ? 0 : k.hashCode())
+                    ^ ((value == null) ? 0 : value.hashCode()));
+        }
+
+    }
+
+
+    /* Internal class for entry sets */
+    private class EntrySet extends AbstractSet<Map.Entry<Object, Object>> {
+        Set<Map.Entry<Object, Object>> hashEntries = hash.entrySet();
+
+        public Iterator<Map.Entry<Object, Object>> iterator() {
+
+            return new Iterator<Map.Entry<Object, Object>>() {
+                Iterator<Map.Entry<Object, Object>> hashIterator = hashEntries.iterator();
+                Entry next = null;
+
+                public boolean hasNext() {
+                    while (hashIterator.hasNext()) {
+                        Map.Entry<Object, Object> ent = hashIterator.next();
+                        ValueCell vc = (ValueCell)ent.getValue();
+                        Object v = null;
+                        if ((vc != null) && ((v = vc.get()) == null)) {
+                            /* Value has been flushed by GC */
+                            continue;
+                        }
+                        next = new Entry(ent, v);
+                        return true;
+                    }
+                    return false;
+                }
+
+                public Map.Entry<Object, Object> next() {
+                    if ((next == null) && !hasNext())
+                        throw new NoSuchElementException();
+                    Entry e = next;
+                    next = null;
+                    return e;
+                }
+
+                public void remove() {
+                    hashIterator.remove();
+                }
+
+            };
+        }
+
+        public boolean isEmpty() {
+            return !(iterator().hasNext());
+        }
+
+        public int size() {
+            int j = 0;
+            for (Iterator<Map.Entry<Object, Object>> i = iterator(); i.hasNext(); i.next()) j++;
+            return j;
+        }
+
+        public boolean remove(Object o) {
+            processQueue();
+            if (o instanceof Entry) return hashEntries.remove(((Entry)o).ent);
+            else return false;
+        }
+
+    }
+
+
+    private Set<Map.Entry<Object, Object>> entrySet = null;
+
+    /**
+     * Return a <code>Set</code> view of the mappings in this cache.
+     */
+    public Set<Map.Entry<Object, Object>> entrySet() {
+        if (entrySet == null) entrySet = new EntrySet();
+        return entrySet;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,1270 @@
+/*
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+import jdk.internal.vm.annotation.ForceInline;
+import jdk.internal.misc.VM;
+import sun.reflect.CallerSensitive;
+import sun.reflect.Reflection;
+
+import java.lang.reflect.Field;
+import java.security.ProtectionDomain;
+
+
+/**
+ * A collection of methods for performing low-level, unsafe operations.
+ * Although the class and all methods are public, use of this class is
+ * limited because only trusted code can obtain instances of it.
+ *
+ * <em>Note:</em> It is the resposibility of the caller to make sure
+ * arguments are checked before methods of this class are
+ * called. While some rudimentary checks are performed on the input,
+ * the checks are best effort and when performance is an overriding
+ * priority, as when methods of this class are optimized by the
+ * runtime compiler, some or all checks (if any) may be elided. Hence,
+ * the caller must not rely on the checks and corresponding
+ * exceptions!
+ *
+ * @author John R. Rose
+ * @see #getUnsafe
+ */
+
+public final class Unsafe {
+
+    static {
+        sun.reflect.Reflection.registerMethodsToFilter(Unsafe.class, "getUnsafe");
+    }
+
+    private Unsafe() {}
+
+    private static final Unsafe theUnsafe = new Unsafe();
+    private static final jdk.internal.misc.Unsafe theInternalUnsafe = jdk.internal.misc.Unsafe.getUnsafe();
+
+    /**
+     * Provides the caller with the capability of performing unsafe
+     * operations.
+     *
+     * <p>The returned {@code Unsafe} object should be carefully guarded
+     * by the caller, since it can be used to read and write data at arbitrary
+     * memory addresses.  It must never be passed to untrusted code.
+     *
+     * <p>Most methods in this class are very low-level, and correspond to a
+     * small number of hardware instructions (on typical machines).  Compilers
+     * are encouraged to optimize these methods accordingly.
+     *
+     * <p>Here is a suggested idiom for using unsafe operations:
+     *
+     * <pre> {@code
+     * class MyTrustedClass {
+     *   private static final Unsafe unsafe = Unsafe.getUnsafe();
+     *   ...
+     *   private long myCountAddress = ...;
+     *   public int getCount() { return unsafe.getByte(myCountAddress); }
+     * }}</pre>
+     *
+     * (It may assist compilers to make the local variable {@code final}.)
+     *
+     * @throws  SecurityException  if a security manager exists and its
+     *          {@code checkPropertiesAccess} method doesn't allow
+     *          access to the system properties.
+     */
+    @CallerSensitive
+    public static Unsafe getUnsafe() {
+        Class<?> caller = Reflection.getCallerClass();
+        if (!VM.isSystemDomainLoader(caller.getClassLoader()))
+            throw new SecurityException("Unsafe");
+        return theUnsafe;
+    }
+
+    /// peek and poke operations
+    /// (compilers should optimize these to memory ops)
+
+    // These work on object fields in the Java heap.
+    // They will not work on elements of packed arrays.
+
+    /**
+     * Fetches a value from a given Java variable.
+     * More specifically, fetches a field or array element within the given
+     * object {@code o} at the given offset, or (if {@code o} is null)
+     * from the memory address whose numerical value is the given offset.
+     * <p>
+     * The results are undefined unless one of the following cases is true:
+     * <ul>
+     * <li>The offset was obtained from {@link #objectFieldOffset} on
+     * the {@link java.lang.reflect.Field} of some Java field and the object
+     * referred to by {@code o} is of a class compatible with that
+     * field's class.
+     *
+     * <li>The offset and object reference {@code o} (either null or
+     * non-null) were both obtained via {@link #staticFieldOffset}
+     * and {@link #staticFieldBase} (respectively) from the
+     * reflective {@link Field} representation of some Java field.
+     *
+     * <li>The object referred to by {@code o} is an array, and the offset
+     * is an integer of the form {@code B+N*S}, where {@code N} is
+     * a valid index into the array, and {@code B} and {@code S} are
+     * the values obtained by {@link #arrayBaseOffset} and {@link
+     * #arrayIndexScale} (respectively) from the array's class.  The value
+     * referred to is the {@code N}<em>th</em> element of the array.
+     *
+     * </ul>
+     * <p>
+     * If one of the above cases is true, the call references a specific Java
+     * variable (field or array element).  However, the results are undefined
+     * if that variable is not in fact of the type returned by this method.
+     * <p>
+     * This method refers to a variable by means of two parameters, and so
+     * it provides (in effect) a <em>double-register</em> addressing mode
+     * for Java variables.  When the object reference is null, this method
+     * uses its offset as an absolute address.  This is similar in operation
+     * to methods such as {@link #getInt(long)}, which provide (in effect) a
+     * <em>single-register</em> addressing mode for non-Java variables.
+     * However, because Java variables may have a different layout in memory
+     * from non-Java variables, programmers should not assume that these
+     * two addressing modes are ever equivalent.  Also, programmers should
+     * remember that offsets from the double-register addressing mode cannot
+     * be portably confused with longs used in the single-register addressing
+     * mode.
+     *
+     * @param o Java heap object in which the variable resides, if any, else
+     *        null
+     * @param offset indication of where the variable resides in a Java heap
+     *        object, if any, else a memory address locating the variable
+     *        statically
+     * @return the value fetched from the indicated Java variable
+     * @throws RuntimeException No defined exceptions are thrown, not even
+     *         {@link NullPointerException}
+     */
+    @ForceInline
+    public int getInt(Object o, long offset) {
+        return theInternalUnsafe.getInt(o, offset);
+    }
+
+    /**
+     * Stores a value into a given Java variable.
+     * <p>
+     * The first two parameters are interpreted exactly as with
+     * {@link #getInt(Object, long)} to refer to a specific
+     * Java variable (field or array element).  The given value
+     * is stored into that variable.
+     * <p>
+     * The variable must be of the same type as the method
+     * parameter {@code x}.
+     *
+     * @param o Java heap object in which the variable resides, if any, else
+     *        null
+     * @param offset indication of where the variable resides in a Java heap
+     *        object, if any, else a memory address locating the variable
+     *        statically
+     * @param x the value to store into the indicated Java variable
+     * @throws RuntimeException No defined exceptions are thrown, not even
+     *         {@link NullPointerException}
+     */
+    @ForceInline
+    public void putInt(Object o, long offset, int x) {
+        theInternalUnsafe.putInt(o, offset, x);
+    }
+
+    /**
+     * Fetches a reference value from a given Java variable.
+     * @see #getInt(Object, long)
+     */
+    @ForceInline
+    public Object getObject(Object o, long offset) {
+        return theInternalUnsafe.getObject(o, offset);
+    }
+
+    /**
+     * Stores a reference value into a given Java variable.
+     * <p>
+     * Unless the reference {@code x} being stored is either null
+     * or matches the field type, the results are undefined.
+     * If the reference {@code o} is non-null, card marks or
+     * other store barriers for that object (if the VM requires them)
+     * are updated.
+     * @see #putInt(Object, long, int)
+     */
+    @ForceInline
+    public void putObject(Object o, long offset, Object x) {
+        theInternalUnsafe.putObject(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public boolean getBoolean(Object o, long offset) {
+        return theInternalUnsafe.getBoolean(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putBoolean(Object o, long offset, boolean x) {
+        theInternalUnsafe.putBoolean(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public byte getByte(Object o, long offset) {
+        return theInternalUnsafe.getByte(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putByte(Object o, long offset, byte x) {
+        theInternalUnsafe.putByte(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public short getShort(Object o, long offset) {
+        return theInternalUnsafe.getShort(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putShort(Object o, long offset, short x) {
+        theInternalUnsafe.putShort(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public char getChar(Object o, long offset) {
+        return theInternalUnsafe.getChar(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putChar(Object o, long offset, char x) {
+        theInternalUnsafe.putChar(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public long getLong(Object o, long offset) {
+        return theInternalUnsafe.getLong(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putLong(Object o, long offset, long x) {
+        theInternalUnsafe.putLong(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public float getFloat(Object o, long offset) {
+        return theInternalUnsafe.getFloat(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putFloat(Object o, long offset, float x) {
+        theInternalUnsafe.putFloat(o, offset, x);
+    }
+
+    /** @see #getInt(Object, long) */
+    @ForceInline
+    public double getDouble(Object o, long offset) {
+        return theInternalUnsafe.getDouble(o, offset);
+    }
+
+    /** @see #putInt(Object, long, int) */
+    @ForceInline
+    public void putDouble(Object o, long offset, double x) {
+        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.
+
+    /**
+     * Fetches a value from a given memory address.  If the address is zero, or
+     * does not point into a block obtained from {@link #allocateMemory}, the
+     * results are undefined.
+     *
+     * @see #allocateMemory
+     */
+    @ForceInline
+    public byte getByte(long address) {
+        return theInternalUnsafe.getByte(address);
+    }
+
+    /**
+     * Stores a value into a given memory address.  If the address is zero, or
+     * does not point into a block obtained from {@link #allocateMemory}, the
+     * results are undefined.
+     *
+     * @see #getByte(long)
+     */
+    @ForceInline
+    public void putByte(long address, byte x) {
+        theInternalUnsafe.putByte(address, x);
+    }
+
+    /** @see #getByte(long) */
+    @ForceInline
+    public short getShort(long address) {
+        return theInternalUnsafe.getShort(address);
+    }
+
+    /** @see #putByte(long, byte) */
+    @ForceInline
+    public void putShort(long address, short x) {
+        theInternalUnsafe.putShort(address, x);
+    }
+
+    /** @see #getByte(long) */
+    @ForceInline
+    public char getChar(long address) {
+        return theInternalUnsafe.getChar(address);
+    }
+
+    /** @see #putByte(long, byte) */
+    @ForceInline
+    public void putChar(long address, char x) {
+        theInternalUnsafe.putChar(address, x);
+    }
+
+    /** @see #getByte(long) */
+    @ForceInline
+    public int getInt(long address) {
+        return theInternalUnsafe.getInt(address);
+    }
+
+    /** @see #putByte(long, byte) */
+    @ForceInline
+    public void putInt(long address, int x) {
+        theInternalUnsafe.putInt(address, x);
+    }
+
+    /** @see #getByte(long) */
+    @ForceInline
+    public long getLong(long address) {
+        return theInternalUnsafe.getLong(address);
+    }
+
+    /** @see #putByte(long, byte) */
+    @ForceInline
+    public void putLong(long address, long x) {
+        theInternalUnsafe.putLong(address, x);
+    }
+
+    /** @see #getByte(long) */
+    @ForceInline
+    public float getFloat(long address) {
+        return theInternalUnsafe.getFloat(address);
+    }
+
+    /** @see #putByte(long, byte) */
+    @ForceInline
+    public void putFloat(long address, float x) {
+        theInternalUnsafe.putFloat(address, x);
+    }
+
+    /** @see #getByte(long) */
+    @ForceInline
+    public double getDouble(long address) {
+        return theInternalUnsafe.getDouble(address);
+    }
+
+    /** @see #putByte(long, byte) */
+    @ForceInline
+    public void putDouble(long address, double x) {
+        theInternalUnsafe.putDouble(address, x);
+    }
+
+
+    /**
+     * Fetches a native pointer from a given memory address.  If the address is
+     * zero, or does not point into a block obtained from {@link
+     * #allocateMemory}, the results are undefined.
+     *
+     * <p>If the native pointer is less than 64 bits wide, it is extended as
+     * an unsigned number to a Java long.  The pointer may be indexed by any
+     * given byte offset, simply by adding that offset (as a simple integer) to
+     * the long representing the pointer.  The number of bytes actually read
+     * from the target address may be determined by consulting {@link
+     * #addressSize}.
+     *
+     * @see #allocateMemory
+     */
+    @ForceInline
+    public long getAddress(long address) {
+        return theInternalUnsafe.getAddress(address);
+    }
+
+    /**
+     * Stores a native pointer into a given memory address.  If the address is
+     * zero, or does not point into a block obtained from {@link
+     * #allocateMemory}, the results are undefined.
+     *
+     * <p>The number of bytes actually written at the target address may be
+     * determined by consulting {@link #addressSize}.
+     *
+     * @see #getAddress(long)
+     */
+    @ForceInline
+    public void putAddress(long address, long x) {
+        theInternalUnsafe.putAddress(address, x);
+    }
+
+
+    /// wrappers for malloc, realloc, free:
+
+    /**
+     * Allocates a new block of native memory, of the given size in bytes.  The
+     * contents of the memory are uninitialized; they will generally be
+     * garbage.  The resulting native pointer will never be zero, and will be
+     * aligned for all value types.  Dispose of this memory by calling {@link
+     * #freeMemory}, or resize it with {@link #reallocateMemory}.
+     *
+     * <em>Note:</em> It is the resposibility of the caller to make
+     * sure arguments are checked before the methods are called. While
+     * some rudimentary checks are performed on the input, the checks
+     * are best effort and when performance is an overriding priority,
+     * as when methods of this class are optimized by the runtime
+     * compiler, some or all checks (if any) may be elided. Hence, the
+     * caller must not rely on the checks and corresponding
+     * exceptions!
+     *
+     * @throws RuntimeException if the size is negative or too large
+     *         for the native size_t type
+     *
+     * @throws OutOfMemoryError if the allocation is refused by the system
+     *
+     * @see #getByte(long)
+     * @see #putByte(long, byte)
+     */
+    @ForceInline
+    public long allocateMemory(long bytes) {
+        return theInternalUnsafe.allocateMemory(bytes);
+    }
+
+    /**
+     * Resizes a new block of native memory, to the given size in bytes.  The
+     * contents of the new block past the size of the old block are
+     * uninitialized; they will generally be garbage.  The resulting native
+     * pointer will be zero if and only if the requested size is zero.  The
+     * resulting native pointer will be aligned for all value types.  Dispose
+     * of this memory by calling {@link #freeMemory}, or resize it with {@link
+     * #reallocateMemory}.  The address passed to this method may be null, in
+     * which case an allocation will be performed.
+     *
+     * <em>Note:</em> It is the resposibility of the caller to make
+     * sure arguments are checked before the methods are called. While
+     * some rudimentary checks are performed on the input, the checks
+     * are best effort and when performance is an overriding priority,
+     * as when methods of this class are optimized by the runtime
+     * compiler, some or all checks (if any) may be elided. Hence, the
+     * caller must not rely on the checks and corresponding
+     * exceptions!
+     *
+     * @throws RuntimeException if the size is negative or too large
+     *         for the native size_t type
+     *
+     * @throws OutOfMemoryError if the allocation is refused by the system
+     *
+     * @see #allocateMemory
+     */
+    @ForceInline
+    public long reallocateMemory(long address, long bytes) {
+        return theInternalUnsafe.reallocateMemory(address, bytes);
+    }
+
+    /**
+     * Sets all bytes in a given block of memory to a fixed value
+     * (usually zero).
+     *
+     * <p>This method determines a block's base address by means of two parameters,
+     * and so it provides (in effect) a <em>double-register</em> addressing mode,
+     * as discussed in {@link #getInt(Object,long)}.  When the object reference is null,
+     * the offset supplies an absolute base address.
+     *
+     * <p>The stores are in coherent (atomic) units of a size determined
+     * by the address and length parameters.  If the effective address and
+     * length are all even modulo 8, the stores take place in 'long' units.
+     * If the effective address and length are (resp.) even modulo 4 or 2,
+     * the stores take place in units of 'int' or 'short'.
+     *
+     * <em>Note:</em> It is the resposibility of the caller to make
+     * sure arguments are checked before the methods are called. While
+     * some rudimentary checks are performed on the input, the checks
+     * are best effort and when performance is an overriding priority,
+     * as when methods of this class are optimized by the runtime
+     * compiler, some or all checks (if any) may be elided. Hence, the
+     * caller must not rely on the checks and corresponding
+     * exceptions!
+     *
+     * @throws RuntimeException if any of the arguments is invalid
+     *
+     * @since 1.7
+     */
+    @ForceInline
+    public void setMemory(Object o, long offset, long bytes, byte value) {
+        theInternalUnsafe.setMemory(o, offset, bytes, value);
+    }
+
+    /**
+     * Sets all bytes in a given block of memory to a fixed value
+     * (usually zero).  This provides a <em>single-register</em> addressing mode,
+     * as discussed in {@link #getInt(Object,long)}.
+     *
+     * <p>Equivalent to {@code setMemory(null, address, bytes, value)}.
+     */
+    @ForceInline
+    public void setMemory(long address, long bytes, byte value) {
+        theInternalUnsafe.setMemory(address, bytes, value);
+    }
+
+    /**
+     * Sets all bytes in a given block of memory to a copy of another
+     * block.
+     *
+     * <p>This method determines each block's base address by means of two parameters,
+     * and so it provides (in effect) a <em>double-register</em> addressing mode,
+     * as discussed in {@link #getInt(Object,long)}.  When the object reference is null,
+     * the offset supplies an absolute base address.
+     *
+     * <p>The transfers are in coherent (atomic) units of a size determined
+     * by the address and length parameters.  If the effective addresses and
+     * length are all even modulo 8, the transfer takes place in 'long' units.
+     * If the effective addresses and length are (resp.) even modulo 4 or 2,
+     * the transfer takes place in units of 'int' or 'short'.
+     *
+     * <em>Note:</em> It is the resposibility of the caller to make
+     * sure arguments are checked before the methods are called. While
+     * some rudimentary checks are performed on the input, the checks
+     * are best effort and when performance is an overriding priority,
+     * as when methods of this class are optimized by the runtime
+     * compiler, some or all checks (if any) may be elided. Hence, the
+     * caller must not rely on the checks and corresponding
+     * exceptions!
+     *
+     * @throws RuntimeException if any of the arguments is invalid
+     *
+     * @since 1.7
+     */
+    @ForceInline
+    public void copyMemory(Object srcBase, long srcOffset,
+                           Object destBase, long destOffset,
+                           long bytes) {
+        theInternalUnsafe.copyMemory(srcBase, srcOffset, destBase, destOffset, bytes);
+    }
+
+    /**
+     * Sets all bytes in a given block of memory to a copy of another
+     * block.  This provides a <em>single-register</em> addressing mode,
+     * as discussed in {@link #getInt(Object,long)}.
+     *
+     * Equivalent to {@code copyMemory(null, srcAddress, null, destAddress, bytes)}.
+     */
+    @ForceInline
+    public void copyMemory(long srcAddress, long destAddress, long bytes) {
+        theInternalUnsafe.copyMemory(srcAddress, destAddress, bytes);
+    }
+
+    /**
+     * Disposes of a block of native memory, as obtained from {@link
+     * #allocateMemory} or {@link #reallocateMemory}.  The address passed to
+     * this method may be null, in which case no action is taken.
+     *
+     * <em>Note:</em> It is the resposibility of the caller to make
+     * sure arguments are checked before the methods are called. While
+     * some rudimentary checks are performed on the input, the checks
+     * are best effort and when performance is an overriding priority,
+     * as when methods of this class are optimized by the runtime
+     * compiler, some or all checks (if any) may be elided. Hence, the
+     * caller must not rely on the checks and corresponding
+     * exceptions!
+     *
+     * @throws RuntimeException if any of the arguments is invalid
+     *
+     * @see #allocateMemory
+     */
+    @ForceInline
+    public void freeMemory(long address) {
+        theInternalUnsafe.freeMemory(address);
+    }
+
+    /// random queries
+
+    /**
+     * This constant differs from all results that will ever be returned from
+     * {@link #staticFieldOffset}, {@link #objectFieldOffset},
+     * or {@link #arrayBaseOffset}.
+     */
+    public static final int INVALID_FIELD_OFFSET = jdk.internal.misc.Unsafe.INVALID_FIELD_OFFSET;
+
+    /**
+     * Reports the location of a given field in the storage allocation of its
+     * class.  Do not expect to perform any sort of arithmetic on this offset;
+     * it is just a cookie which is passed to the unsafe heap memory accessors.
+     *
+     * <p>Any given field will always have the same offset and base, and no
+     * two distinct fields of the same class will ever have the same offset
+     * and base.
+     *
+     * <p>As of 1.4.1, offsets for fields are represented as long values,
+     * although the Sun JVM does not use the most significant 32 bits.
+     * However, JVM implementations which store static fields at absolute
+     * addresses can use long offsets and null base pointers to express
+     * the field locations in a form usable by {@link #getInt(Object,long)}.
+     * Therefore, code which will be ported to such JVMs on 64-bit platforms
+     * must preserve all bits of static field offsets.
+     * @see #getInt(Object, long)
+     */
+    @ForceInline
+    public long objectFieldOffset(Field f) {
+        return theInternalUnsafe.objectFieldOffset(f);
+    }
+
+    /**
+     * Reports the location of a given static field, in conjunction with {@link
+     * #staticFieldBase}.
+     * <p>Do not expect to perform any sort of arithmetic on this offset;
+     * it is just a cookie which is passed to the unsafe heap memory accessors.
+     *
+     * <p>Any given field will always have the same offset, and no two distinct
+     * fields of the same class will ever have the same offset.
+     *
+     * <p>As of 1.4.1, offsets for fields are represented as long values,
+     * although the Sun JVM does not use the most significant 32 bits.
+     * It is hard to imagine a JVM technology which needs more than
+     * a few bits to encode an offset within a non-array object,
+     * However, for consistency with other methods in this class,
+     * this method reports its result as a long value.
+     * @see #getInt(Object, long)
+     */
+    @ForceInline
+    public long staticFieldOffset(Field f) {
+        return theInternalUnsafe.staticFieldOffset(f);
+    }
+
+    /**
+     * Reports the location of a given static field, in conjunction with {@link
+     * #staticFieldOffset}.
+     * <p>Fetch the base "Object", if any, with which static fields of the
+     * given class can be accessed via methods like {@link #getInt(Object,
+     * long)}.  This value may be null.  This value may refer to an object
+     * which is a "cookie", not guaranteed to be a real Object, and it should
+     * not be used in any way except as argument to the get and put routines in
+     * this class.
+     */
+    @ForceInline
+    public Object staticFieldBase(Field f) {
+        return theInternalUnsafe.staticFieldBase(f);
+    }
+
+    /**
+     * Detects if the given class may need to be initialized. This is often
+     * needed in conjunction with obtaining the static field base of a
+     * class.
+     * @return false only if a call to {@code ensureClassInitialized} would have no effect
+     */
+    @ForceInline
+    public boolean shouldBeInitialized(Class<?> c) {
+        return theInternalUnsafe.shouldBeInitialized(c);
+    }
+
+    /**
+     * Ensures the given class has been initialized. This is often
+     * needed in conjunction with obtaining the static field base of a
+     * class.
+     */
+    @ForceInline
+    public void ensureClassInitialized(Class<?> c) {
+        theInternalUnsafe.ensureClassInitialized(c);
+    }
+
+    /**
+     * Reports the offset of the first element in the storage allocation of a
+     * given array class.  If {@link #arrayIndexScale} returns a non-zero value
+     * for the same class, you may use that scale factor, together with this
+     * base offset, to form new offsets to access elements of arrays of the
+     * given class.
+     *
+     * @see #getInt(Object, long)
+     * @see #putInt(Object, long, int)
+     */
+    @ForceInline
+    public int arrayBaseOffset(Class<?> arrayClass) {
+        return theInternalUnsafe.arrayBaseOffset(arrayClass);
+    }
+
+    /** The value of {@code arrayBaseOffset(boolean[].class)} */
+    public static final int ARRAY_BOOLEAN_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_BOOLEAN_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(byte[].class)} */
+    public static final int ARRAY_BYTE_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_BYTE_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(short[].class)} */
+    public static final int ARRAY_SHORT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_SHORT_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(char[].class)} */
+    public static final int ARRAY_CHAR_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_CHAR_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(int[].class)} */
+    public static final int ARRAY_INT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_INT_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(long[].class)} */
+    public static final int ARRAY_LONG_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_LONG_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(float[].class)} */
+    public static final int ARRAY_FLOAT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_FLOAT_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(double[].class)} */
+    public static final int ARRAY_DOUBLE_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_DOUBLE_BASE_OFFSET;
+
+    /** The value of {@code arrayBaseOffset(Object[].class)} */
+    public static final int ARRAY_OBJECT_BASE_OFFSET = jdk.internal.misc.Unsafe.ARRAY_OBJECT_BASE_OFFSET;
+
+    /**
+     * Reports the scale factor for addressing elements in the storage
+     * allocation of a given array class.  However, arrays of "narrow" types
+     * will generally not work properly with accessors like {@link
+     * #getByte(Object, long)}, so the scale factor for such classes is reported
+     * as zero.
+     *
+     * @see #arrayBaseOffset
+     * @see #getInt(Object, long)
+     * @see #putInt(Object, long, int)
+     */
+    @ForceInline
+    public int arrayIndexScale(Class<?> arrayClass) {
+        return theInternalUnsafe.arrayIndexScale(arrayClass);
+    }
+
+    /** The value of {@code arrayIndexScale(boolean[].class)} */
+    public static final int ARRAY_BOOLEAN_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_BOOLEAN_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(byte[].class)} */
+    public static final int ARRAY_BYTE_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_BYTE_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(short[].class)} */
+    public static final int ARRAY_SHORT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_SHORT_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(char[].class)} */
+    public static final int ARRAY_CHAR_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_CHAR_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(int[].class)} */
+    public static final int ARRAY_INT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_INT_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(long[].class)} */
+    public static final int ARRAY_LONG_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_LONG_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(float[].class)} */
+    public static final int ARRAY_FLOAT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_FLOAT_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(double[].class)} */
+    public static final int ARRAY_DOUBLE_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_DOUBLE_INDEX_SCALE;
+
+    /** The value of {@code arrayIndexScale(Object[].class)} */
+    public static final int ARRAY_OBJECT_INDEX_SCALE = jdk.internal.misc.Unsafe.ARRAY_OBJECT_INDEX_SCALE;
+
+    /**
+     * Reports the size in bytes of a native pointer, as stored via {@link
+     * #putAddress}.  This value will be either 4 or 8.  Note that the sizes of
+     * other primitive types (as stored in native memory blocks) is determined
+     * fully by their information content.
+     */
+    @ForceInline
+    public int addressSize() {
+        return theInternalUnsafe.addressSize();
+    }
+
+    /** The value of {@code addressSize()} */
+    public static final int ADDRESS_SIZE = theInternalUnsafe.addressSize();
+
+    /**
+     * Reports the size in bytes of a native memory page (whatever that is).
+     * This value will always be a power of two.
+     */
+    @ForceInline
+    public int pageSize() {
+        return theInternalUnsafe.pageSize();
+    }
+
+
+    /// random trusted operations from JNI:
+
+    /**
+     * Tells the VM to define a class, without security checks.  By default, the
+     * class loader and protection domain come from the caller's class.
+     */
+    @ForceInline
+    public Class<?> defineClass(String name, byte[] b, int off, int len,
+                                ClassLoader loader,
+                                ProtectionDomain protectionDomain) {
+        return theInternalUnsafe.defineClass(name, b, off, len, loader, protectionDomain);
+    }
+
+    /**
+     * Defines a class but does not make it known to the class loader or system dictionary.
+     * <p>
+     * For each CP entry, the corresponding CP patch must either be null or have
+     * the a format that matches its tag:
+     * <ul>
+     * <li>Integer, Long, Float, Double: the corresponding wrapper object type from java.lang
+     * <li>Utf8: a string (must have suitable syntax if used as signature or name)
+     * <li>Class: any java.lang.Class object
+     * <li>String: any object (not just a java.lang.String)
+     * <li>InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
+     * </ul>
+     * @param hostClass context for linkage, access control, protection domain, and class loader
+     * @param data      bytes of a class file
+     * @param cpPatches where non-null entries exist, they replace corresponding CP entries in data
+     */
+    @ForceInline
+    public Class<?> defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches) {
+        return theInternalUnsafe.defineAnonymousClass(hostClass, data, cpPatches);
+    }
+
+    /**
+     * Allocates an instance but does not run any constructor.
+     * Initializes the class if it has not yet been.
+     */
+    @ForceInline
+    public Object allocateInstance(Class<?> cls)
+        throws InstantiationException {
+        return theInternalUnsafe.allocateInstance(cls);
+    }
+
+    /** Throws the exception without telling the verifier. */
+    @ForceInline
+    public void throwException(Throwable ee) {
+        theInternalUnsafe.throwException(ee);
+    }
+
+    /**
+     * Atomically updates Java variable to {@code x} if it is currently
+     * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
+     * @return {@code true} if successful
+     */
+    @ForceInline
+    public final boolean compareAndSwapObject(Object o, long offset,
+                                              Object expected,
+                                              Object x) {
+        return theInternalUnsafe.compareAndSwapObject(o, offset, expected, x);
+    }
+
+    /**
+     * Atomically updates Java variable to {@code x} if it is currently
+     * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
+     * @return {@code true} if successful
+     */
+    @ForceInline
+    public final boolean compareAndSwapInt(Object o, long offset,
+                                           int expected,
+                                           int x) {
+        return theInternalUnsafe.compareAndSwapInt(o, offset, expected, x);
+    }
+
+    /**
+     * Atomically updates Java variable to {@code x} if it is currently
+     * holding {@code expected}.
+     *
+     * <p>This operation has memory semantics of a {@code volatile} read
+     * and write.  Corresponds to C11 atomic_compare_exchange_strong.
+     *
+     * @return {@code true} if successful
+     */
+    @ForceInline
+    public final boolean compareAndSwapLong(Object o, long offset,
+                                            long expected,
+                                            long x) {
+        return theInternalUnsafe.compareAndSwapLong(o, offset, expected, x);
+    }
+
+    /**
+     * Fetches a reference value from a given Java variable, with volatile
+     * load semantics. Otherwise identical to {@link #getObject(Object, long)}
+     */
+    @ForceInline
+    public Object getObjectVolatile(Object o, long offset) {
+        return theInternalUnsafe.getObjectVolatile(o, offset);
+    }
+
+    /**
+     * Stores a reference value into a given Java variable, with
+     * volatile store semantics. Otherwise identical to {@link #putObject(Object, long, Object)}
+     */
+    @ForceInline
+    public void putObjectVolatile(Object o, long offset, Object x) {
+        theInternalUnsafe.putObjectVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getInt(Object, long)}  */
+    @ForceInline
+    public int getIntVolatile(Object o, long offset) {
+        return theInternalUnsafe.getIntVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putInt(Object, long, int)}  */
+    @ForceInline
+    public void putIntVolatile(Object o, long offset, int x) {
+        theInternalUnsafe.putIntVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getBoolean(Object, long)}  */
+    @ForceInline
+    public boolean getBooleanVolatile(Object o, long offset) {
+        return theInternalUnsafe.getBooleanVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putBoolean(Object, long, boolean)}  */
+    @ForceInline
+    public void putBooleanVolatile(Object o, long offset, boolean x) {
+        theInternalUnsafe.putBooleanVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getByte(Object, long)}  */
+    @ForceInline
+    public byte getByteVolatile(Object o, long offset) {
+        return theInternalUnsafe.getByteVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putByte(Object, long, byte)}  */
+    @ForceInline
+    public void putByteVolatile(Object o, long offset, byte x) {
+        theInternalUnsafe.putByteVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getShort(Object, long)}  */
+    @ForceInline
+    public short getShortVolatile(Object o, long offset) {
+        return theInternalUnsafe.getShortVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putShort(Object, long, short)}  */
+    @ForceInline
+    public void putShortVolatile(Object o, long offset, short x) {
+        theInternalUnsafe.putShortVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getChar(Object, long)}  */
+    @ForceInline
+    public char getCharVolatile(Object o, long offset) {
+        return theInternalUnsafe.getCharVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putChar(Object, long, char)}  */
+    @ForceInline
+    public void putCharVolatile(Object o, long offset, char x) {
+        theInternalUnsafe.putCharVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getLong(Object, long)}  */
+    @ForceInline
+    public long getLongVolatile(Object o, long offset) {
+        return theInternalUnsafe.getLongVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putLong(Object, long, long)}  */
+    @ForceInline
+    public void putLongVolatile(Object o, long offset, long x) {
+        theInternalUnsafe.putLongVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getFloat(Object, long)}  */
+    @ForceInline
+    public float getFloatVolatile(Object o, long offset) {
+        return theInternalUnsafe.getFloatVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putFloat(Object, long, float)}  */
+    @ForceInline
+    public void putFloatVolatile(Object o, long offset, float x) {
+        theInternalUnsafe.putFloatVolatile(o, offset, x);
+    }
+
+    /** Volatile version of {@link #getDouble(Object, long)}  */
+    @ForceInline
+    public double getDoubleVolatile(Object o, long offset) {
+        return theInternalUnsafe.getDoubleVolatile(o, offset);
+    }
+
+    /** Volatile version of {@link #putDouble(Object, long, double)}  */
+    @ForceInline
+    public void putDoubleVolatile(Object o, long offset, double x) {
+        theInternalUnsafe.putDoubleVolatile(o, offset, x);
+    }
+
+    /**
+     * Version of {@link #putObjectVolatile(Object, long, Object)}
+     * that does not guarantee immediate visibility of the store to
+     * other threads. This method is generally only useful if the
+     * underlying field is a Java volatile (or if an array cell, one
+     * that is otherwise only accessed using volatile accesses).
+     *
+     * Corresponds to C11 atomic_store_explicit(..., memory_order_release).
+     */
+    @ForceInline
+    public void putOrderedObject(Object o, long offset, Object x) {
+        theInternalUnsafe.putObjectRelease(o, offset, x);
+    }
+
+    /** Ordered/Lazy version of {@link #putIntVolatile(Object, long, int)}  */
+    @ForceInline
+    public void putOrderedInt(Object o, long offset, int x) {
+        theInternalUnsafe.putIntRelease(o, offset, x);
+    }
+
+    /** Ordered/Lazy version of {@link #putLongVolatile(Object, long, long)} */
+    @ForceInline
+    public void putOrderedLong(Object o, long offset, long x) {
+        theInternalUnsafe.putLongRelease(o, offset, x);
+    }
+
+    /**
+     * Unblocks the given thread blocked on {@code park}, or, if it is
+     * not blocked, causes the subsequent call to {@code park} not to
+     * block.  Note: this operation is "unsafe" solely because the
+     * caller must somehow ensure that the thread has not been
+     * destroyed. Nothing special is usually required to ensure this
+     * when called from Java (in which there will ordinarily be a live
+     * reference to the thread) but this is not nearly-automatically
+     * so when calling from native code.
+     *
+     * @param thread the thread to unpark.
+     */
+    @ForceInline
+    public void unpark(Object thread) {
+        theInternalUnsafe.unpark(thread);
+    }
+
+    /**
+     * Blocks current thread, returning when a balancing
+     * {@code unpark} occurs, or a balancing {@code unpark} has
+     * already occurred, or the thread is interrupted, or, if not
+     * absolute and time is not zero, the given time nanoseconds have
+     * elapsed, or if absolute, the given deadline in milliseconds
+     * since Epoch has passed, or spuriously (i.e., returning for no
+     * "reason"). Note: This operation is in the Unsafe class only
+     * because {@code unpark} is, so it would be strange to place it
+     * elsewhere.
+     */
+    @ForceInline
+    public void park(boolean isAbsolute, long time) {
+        theInternalUnsafe.park(isAbsolute, time);
+    }
+
+    /**
+     * Gets the load average in the system run queue assigned
+     * to the available processors averaged over various periods of time.
+     * This method retrieves the given {@code nelem} samples and
+     * assigns to the elements of the given {@code loadavg} array.
+     * The system imposes a maximum of 3 samples, representing
+     * averages over the last 1,  5,  and  15 minutes, respectively.
+     *
+     * @param loadavg an array of double of size nelems
+     * @param nelems the number of samples to be retrieved and
+     *        must be 1 to 3.
+     *
+     * @return the number of samples actually retrieved; or -1
+     *         if the load average is unobtainable.
+     */
+    @ForceInline
+    public int getLoadAverage(double[] loadavg, int nelems) {
+        return theInternalUnsafe.getLoadAverage(loadavg, nelems);
+    }
+
+    // The following contain CAS-based Java implementations used on
+    // platforms not supporting native instructions
+
+    /**
+     * Atomically adds the given value to the current value of a field
+     * or array element within the given object {@code o}
+     * at the given {@code offset}.
+     *
+     * @param o object/array to update the field/element in
+     * @param offset field/element offset
+     * @param delta the value to add
+     * @return the previous value
+     * @since 1.8
+     */
+    @ForceInline
+    public final int getAndAddInt(Object o, long offset, int delta) {
+        return theInternalUnsafe.getAndAddInt(o, offset, delta);
+    }
+
+    /**
+     * Atomically adds the given value to the current value of a field
+     * or array element within the given object {@code o}
+     * at the given {@code offset}.
+     *
+     * @param o object/array to update the field/element in
+     * @param offset field/element offset
+     * @param delta the value to add
+     * @return the previous value
+     * @since 1.8
+     */
+    @ForceInline
+    public final long getAndAddLong(Object o, long offset, long delta) {
+        return theInternalUnsafe.getAndAddLong(o, offset, delta);
+    }
+
+    /**
+     * Atomically exchanges the given value with the current value of
+     * a field or array element within the given object {@code o}
+     * at the given {@code offset}.
+     *
+     * @param o object/array to update the field/element in
+     * @param offset field/element offset
+     * @param newValue new value
+     * @return the previous value
+     * @since 1.8
+     */
+    @ForceInline
+    public final int getAndSetInt(Object o, long offset, int newValue) {
+        return theInternalUnsafe.getAndSetInt(o, offset, newValue);
+    }
+
+    /**
+     * Atomically exchanges the given value with the current value of
+     * a field or array element within the given object {@code o}
+     * at the given {@code offset}.
+     *
+     * @param o object/array to update the field/element in
+     * @param offset field/element offset
+     * @param newValue new value
+     * @return the previous value
+     * @since 1.8
+     */
+    @ForceInline
+    public final long getAndSetLong(Object o, long offset, long newValue) {
+        return theInternalUnsafe.getAndSetLong(o, offset, newValue);
+    }
+
+    /**
+     * Atomically exchanges the given reference value with the current
+     * reference value of a field or array element within the given
+     * object {@code o} at the given {@code offset}.
+     *
+     * @param o object/array to update the field/element in
+     * @param offset field/element offset
+     * @param newValue new value
+     * @return the previous value
+     * @since 1.8
+     */
+    @ForceInline
+    public final Object getAndSetObject(Object o, long offset, Object newValue) {
+        return theInternalUnsafe.getAndSetObject(o, offset, newValue);
+    }
+
+
+    /**
+     * Ensures that loads before the fence will not be reordered with loads and
+     * stores after the fence; a "LoadLoad plus LoadStore barrier".
+     *
+     * Corresponds to C11 atomic_thread_fence(memory_order_acquire)
+     * (an "acquire fence").
+     *
+     * A pure LoadLoad fence is not provided, since the addition of LoadStore
+     * is almost always desired, and most current hardware instructions that
+     * provide a LoadLoad barrier also provide a LoadStore barrier for free.
+     * @since 1.8
+     */
+    @ForceInline
+    public void loadFence() {
+        theInternalUnsafe.loadFence();
+    }
+
+    /**
+     * Ensures that loads and stores before the fence will not be reordered with
+     * stores after the fence; a "StoreStore plus LoadStore barrier".
+     *
+     * Corresponds to C11 atomic_thread_fence(memory_order_release)
+     * (a "release fence").
+     *
+     * A pure StoreStore fence is not provided, since the addition of LoadStore
+     * is almost always desired, and most current hardware instructions that
+     * provide a StoreStore barrier also provide a LoadStore barrier for free.
+     * @since 1.8
+     */
+    @ForceInline
+    public void storeFence() {
+        theInternalUnsafe.storeFence();
+    }
+
+    /**
+     * Ensures that loads and stores before the fence will not be reordered
+     * with loads and stores after the fence.  Implies the effects of both
+     * loadFence() and storeFence(), and in addition, the effect of a StoreLoad
+     * barrier.
+     *
+     * Corresponds to C11 atomic_thread_fence(memory_order_seq_cst).
+     * @since 1.8
+     */
+    @ForceInline
+    public void fullFence() {
+        theInternalUnsafe.fullFence();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.unsupported/unix/classes/sun/misc/GThreadHelper.java	Sat Apr 09 20:12:13 2016 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.misc;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * This class is used to prevent multiple calling of g_thread_init ()
+ * and gdk_thread_init ().
+ *
+ * Since version 2.24 of GLib, calling g_thread_init () multiple times is
+ * allowed, but it will crash for older versions. There are two ways to
+ * find out if g_thread_init () has been called:
+ * g_thread_get_initialized (), but it was introduced in 2.20
+ * g_thread_supported (), but it is a macro and cannot be loaded with dlsym.
+ *
+ * usage:
+ * <pre>
+ * lock();
+ * try {
+ *    if (!getAndSetInitializationNeededFlag()) {
+ *        //call to g_thread_init();
+ *        //call to gdk_thread_init();
+ *    }
+ * } finally {
+ *    unlock();
+ * }
+ * </pre>
+ */
+public final class GThreadHelper {
+
+    private static final ReentrantLock LOCK = new ReentrantLock();
+    private static boolean isGThreadInitialized = false;
+
+    /**
+     * Acquires the lock.
+     */
+    public static void lock() {
+        LOCK.lock();
+    }
+
+    /**
+     * Releases the lock.
+     */
+    public static void unlock() {
+        LOCK.unlock();
+    }
+
+    /**
+     * Gets current value of initialization flag and sets it to {@code true}.
+     * MUST be called under the lock.
+     *
+     * A return value of {@code false} indicates that the calling code
+     * should call the g_thread_init() and gdk_thread_init() functions
+     * before releasing the lock.
+     *
+     * @return {@code true} if initialization has been completed.
+     */
+    public static boolean getAndSetInitializationNeededFlag() {
+        boolean ret = isGThreadInitialized;
+        isGThreadInitialized = true;
+        return ret;
+    }
+}
--- a/jdk/test/com/sun/jdi/cds/CDSBreakpointTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/com/sun/jdi/cds/CDSBreakpointTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -26,7 +26,6 @@
  * @bug 8054386
  * @summary java debugging test for CDS
  * @modules jdk.jdi
- *          java.base/sun.misc
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @library /lib/testlibrary
--- a/jdk/test/com/sun/jdi/cds/CDSDeleteAllBkptsTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/com/sun/jdi/cds/CDSDeleteAllBkptsTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -26,7 +26,6 @@
  * @bug 8054386
  * @summary java debugging test for CDS
  * @modules jdk.jdi
- *          java.base/sun.misc
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @library /lib/testlibrary
--- a/jdk/test/com/sun/jdi/cds/CDSFieldWatchpoints.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/com/sun/jdi/cds/CDSFieldWatchpoints.java	Sat Apr 09 20:12:13 2016 +0100
@@ -26,7 +26,6 @@
  * @bug 8054386
  * @summary java debugging test for CDS
  * @modules jdk.jdi
- *          java.base/sun.misc
  *          java.management
  *          jdk.jartool/sun.tools.jar
  * @library /lib/testlibrary
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Sat Apr 09 20:12:13 2016 +0100
@@ -29,7 +29,6 @@
  *      4947220 7018606 7034570 4244896 5049299 8003488 8054494 8058464
  *      8067796
  * @summary Basic tests for Process and Environment Variable code
- * @modules java.base/sun.misc
  * @run main/othervm/timeout=300 Basic
  * @run main/othervm/timeout=300 -Djdk.lang.Process.launchMechanism=fork Basic
  * @author Martin Buchholz
--- a/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,7 +25,6 @@
  * @test
  * @bug 8072611
  * @summary ProcessBuilder Redirect to file appending on Windows should work with long file names
- * @modules java.base/sun.misc
  * @author Thomas Stuefe
  */
 
--- a/jdk/test/java/lang/ProcessHandle/Basic.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/ProcessHandle/Basic.java	Sat Apr 09 20:12:13 2016 +0100
@@ -37,7 +37,8 @@
 /*
  * @test
  * @library /test/lib/share/classes
- * @modules jdk.management
+ * @modules java.base/jdk.internal.misc
+ *          jdk.management
  * @run testng Basic
  * @summary Basic tests for ProcessHandler
  * @author Roger Riggs
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -49,7 +49,8 @@
  * @test
  * @bug 8077350 8081566 8081567 8098852 8136597
  * @library /test/lib/share/classes
- * @modules jdk.management
+ * @modules java.base/jdk.internal.misc
+ *          jdk.management
  * @build jdk.test.lib.Platform jdk.test.lib.Utils
  * @run testng InfoTest
  * @summary Functions of ProcessHandle.Info
--- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -39,7 +39,8 @@
 /*
  * @test
  * @library /test/lib/share/classes
- * @modules jdk.management
+ * @modules java.base/jdk.internal.misc
+ *          jdk.management
  * @build jdk.test.lib.Platform jdk.test.lib.Utils
  * @run testng OnExitTest
  * @summary Functions of Process.onExit and ProcessHandle.onExit
--- a/jdk/test/java/lang/ProcessHandle/TreeTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -45,7 +45,8 @@
 /*
  * @test
  * @library /test/lib/share/classes
- * @modules jdk.management
+ * @modules java.base/jdk.internal.misc
+ *          jdk.management
  * @build jdk.test.lib.Utils
  * @run testng/othervm TreeTest
  * @summary Test counting and JavaChild.spawning and counting of Processes.
--- a/jdk/test/java/lang/invoke/VMAnonymousClass.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/java/lang/invoke/VMAnonymousClass.java	Sat Apr 09 20:12:13 2016 +0100
@@ -24,7 +24,7 @@
 /* @test
  * @bug 8046903
  * @summary VM anonymous class members can't be statically invocable
- * @modules java.base/sun.misc java.base/jdk.internal.org.objectweb.asm
+ * @modules java.base/jdk.internal.misc java.base/jdk.internal.org.objectweb.asm
  * @run junit test.java.lang.invoke.VMAnonymousClass
  */
 package test.java.lang.invoke;
@@ -34,7 +34,7 @@
 import java.lang.invoke.MethodType;
 import java.lang.reflect.Field;
 import org.junit.Test;
-import sun.misc.Unsafe;
+import jdk.internal.misc.Unsafe;
 import jdk.internal.org.objectweb.asm.*;
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
 
@@ -43,17 +43,17 @@
         VMAnonymousClass test = new VMAnonymousClass();
         test.testJavaLang();
         test.testJavaUtil();
-        test.testSunMisc();
+        test.testJdkInternalMisc();
         test.testJavaLangInvoke();
         System.out.println("TEST PASSED");
     }
 
     // Test VM anonymous classes from different packages
     // (see j.l.i.InvokerBytecodeGenerator::isStaticallyInvocable).
-    @Test public void testJavaLang()       throws Throwable { test("java/lang");        }
-    @Test public void testJavaUtil()       throws Throwable { test("java/util");        }
-    @Test public void testSunMisc()        throws Throwable { test("sun/misc");         }
-    @Test public void testJavaLangInvoke() throws Throwable { test("java/lang/invoke"); }
+    @Test public void testJavaLang()        throws Throwable { test("java/lang");         }
+    @Test public void testJavaUtil()        throws Throwable { test("java/util");         }
+    @Test public void testJdkInternalMisc() throws Throwable { test("jdk/internal/misc"); }
+    @Test public void testJavaLangInvoke()  throws Throwable { test("java/lang/invoke");  }
 
     private static Unsafe unsafe = getUnsafe();
 
--- a/jdk/test/javax/net/ssl/DTLS/TEST.properties	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/DTLS/TEST.properties	Sat Apr 09 20:12:13 2016 +0100
@@ -5,5 +5,4 @@
     java.security.jgss/sun.security.krb5.internal \
     java.security.jgss/sun.security.krb5.internal.ktab \
     java.base/sun.net.spi.nameservice \
-    java.base/sun.security.util \
-    java.base/sun.misc
+    java.base/sun.security.util
--- a/jdk/test/javax/net/ssl/DTLSv10/TEST.properties	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/DTLSv10/TEST.properties	Sat Apr 09 20:12:13 2016 +0100
@@ -5,5 +5,4 @@
     java.security.jgss/sun.security.krb5.internal \
     java.security.jgss/sun.security.krb5.internal.ktab \
     java.base/sun.net.spi.nameservice \
-    java.base/sun.security.util \
-    java.base/sun.misc
+    java.base/sun.security.util
--- a/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorer.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorer.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../SSLEngine ../templates
- * @modules java.base/sun.misc
  * @build SSLEngineService SSLCapabilities SSLExplorer
  * @run main/othervm SSLEngineExplorer SSLv2Hello,SSLv3
  * @run main/othervm SSLEngineExplorer SSLv3
--- a/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerMatchedSNI.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerMatchedSNI.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../SSLEngine ../templates
- * @modules java.base/sun.misc
  * @build SSLEngineService SSLCapabilities SSLExplorer
  * @run main/othervm SSLEngineExplorerMatchedSNI www.example.com
  *     www\.example\.com
--- a/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerUnmatchedSNI.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerUnmatchedSNI.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../SSLEngine ../templates
- * @modules java.base/sun.misc
  * @build SSLEngineService SSLCapabilities SSLExplorer
  * @run main/othervm SSLEngineExplorerUnmatchedSNI www.example.com
  *                                                 www\.example\.org
--- a/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerWithCli.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerWithCli.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../SSLEngine ../templates
- * @modules java.base/sun.misc
  * @build SSLEngineService SSLCapabilities SSLExplorer
  * @run main/othervm SSLEngineExplorerWithCli
  */
--- a/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerWithSrv.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLEngineExplorerWithSrv.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../SSLEngine ../templates
- * @modules java.base/sun.misc
  * @build SSLEngineService SSLCapabilities SSLExplorer
  * @run main/othervm SSLEngineExplorerWithSrv
  */
--- a/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorer.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorer.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../templates
- * @modules java.base/sun.misc
  * @build SSLCapabilities SSLExplorer
  * @run main/othervm SSLSocketExplorer SSLv2Hello,SSLv3
  * @run main/othervm SSLSocketExplorer SSLv3
--- a/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../templates
- * @modules java.base/sun.misc
  * @build SSLCapabilities SSLExplorer
  * @run main/othervm SSLSocketExplorerFailure SSLv2Hello,SSLv3
  * @run main/othervm SSLSocketExplorerFailure SSLv3
--- a/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerMatchedSNI.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerMatchedSNI.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../templates
- * @modules java.base/sun.misc
  * @build SSLCapabilities SSLExplorer
  * @run main/othervm SSLSocketExplorerMatchedSNI www.example.com
  *     www\.example\.com
--- a/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerUnmatchedSNI.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerUnmatchedSNI.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../templates
- * @modules java.base/sun.misc
  * @build SSLCapabilities SSLExplorer
  * @run main/othervm SSLSocketExplorerUnmatchedSNI www.example.com
  *                                                 www\.example\.org
--- a/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerWithCliSNI.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerWithCliSNI.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../templates
- * @modules java.base/sun.misc
  * @build SSLCapabilities SSLExplorer
  * @run main/othervm SSLSocketExplorerWithCliSNI
  */
--- a/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerWithSrvSNI.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/net/ssl/ServerName/SSLSocketExplorerWithSrvSNI.java	Sat Apr 09 20:12:13 2016 +0100
@@ -31,7 +31,6 @@
  * @bug 7068321
  * @summary Support TLS Server Name Indication (SNI) Extension in JSSE Server
  * @library ../templates
- * @modules java.base/sun.misc
  * @build SSLCapabilities SSLExplorer
  * @run main/othervm SSLSocketExplorerWithSrvSNI
  */
--- a/jdk/test/javax/security/auth/Subject/SubjectNullTests.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/javax/security/auth/Subject/SubjectNullTests.java	Sat Apr 09 20:12:13 2016 +0100
@@ -24,8 +24,7 @@
 /*
  * @test
  * @bug 8015081
- * @modules java.base/sun.misc
- *          java.management
+ * @modules java.management
  *          java.security.jgss
  * @compile Subject.java
  * @compile SubjectNullTests.java
--- a/jdk/test/sun/misc/CopyMemory.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/misc/CopyMemory.java	Sat Apr 09 20:12:13 2016 +0100
@@ -24,7 +24,8 @@
 /* @test
  * @bug 6565543
  * @summary Minimal test for unsafe.copyMemory() and unsafe.setMemory()
- * @modules java.base/sun.nio.ch java.base/sun.misc
+ * @modules java.base/sun.nio.ch
+ *          jdk.unsupported
  * @key randomness
  */
 
--- a/jdk/test/sun/misc/Safe.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/misc/Safe.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,7 +25,7 @@
  * @bug 4495577
  * @summary Ensure that sun.misc.Unsafe cannot (easily)
  *          be accessed from user code
- * @modules java.base/sun.misc
+ * @modules jdk.unsupported
  */
 
 
--- a/jdk/test/sun/misc/SunMiscSignalTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/misc/SunMiscSignalTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -44,6 +44,7 @@
 /*
  * @test
  * @library /test/lib/share/classes
+ * @modules jdk.unsupported
  * @build jdk.test.lib.Platform jdk.test.lib.Utils
  * @run testng/othervm -Xrs -DXrs=true SunMiscSignalTest
  * @run testng/othervm SunMiscSignalTest
--- a/jdk/test/sun/reflect/AnonymousNewInstance/ManyNewInstanceAnonTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/reflect/AnonymousNewInstance/ManyNewInstanceAnonTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 7194897
  * @summary JSR 292: Cannot create more than 16 instances of an anonymous class
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
  *          java.management
  * @library /lib/testlibrary
  * @author  Robert Field
@@ -37,7 +37,7 @@
  */
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
-import sun.misc.Unsafe;
+import jdk.internal.misc.Unsafe;
 
 public class ManyNewInstanceAnonTest {
 
--- a/jdk/test/sun/security/krb5/auto/TEST.properties	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/security/krb5/auto/TEST.properties	Sat Apr 09 20:12:13 2016 +0100
@@ -1,5 +1,4 @@
 modules java.base/jdk.internal.misc \
-        java.base/sun.misc \
         java.base/sun.net.spi.nameservice \
         java.base/sun.security.util \
         java.security.jgss/sun.security.jgss \
--- a/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/security/pkcs/pkcs8/PKCS8Test.java	Sat Apr 09 20:12:13 2016 +0100
@@ -30,7 +30,6 @@
  *          java.base/sun.security.util
  *          java.base/sun.security.provider
  *          java.base/sun.security.x509
- *          java.base/sun.misc
  * @compile -XDignore.symbol.file PKCS8Test.java
  * @run main PKCS8Test
  */
--- a/jdk/test/sun/security/pkcs/pkcs9/UnknownAttribute.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/security/pkcs/pkcs9/UnknownAttribute.java	Sat Apr 09 20:12:13 2016 +0100
@@ -25,8 +25,7 @@
  * @test
  * @bug 8011867
  * @summary Accept unknown PKCS #9 attributes
- * @modules java.base/sun.misc
- *          java.base/sun.security.pkcs
+ * @modules java.base/sun.security.pkcs
  *          java.base/sun.security.util
  */
 
--- a/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/security/tools/jarsigner/TsacertOptionTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -30,8 +30,7 @@
  * @bug 8024302 8026037
  * @summary The test signs and verifies a jar file with -tsacert option
  * @library /lib/testlibrary
- * @modules java.base/sun.misc
- *          java.base/sun.security.pkcs
+ * @modules java.base/sun.security.pkcs
  *          java.base/sun.security.timestamp
  *          java.base/sun.security.util
  *          java.base/sun.security.x509
--- a/jdk/test/sun/security/tools/jarsigner/ts.sh	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/security/tools/jarsigner/ts.sh	Sat Apr 09 20:12:13 2016 +0100
@@ -24,8 +24,7 @@
 # @test
 # @bug 6543842 6543440 6939248 8009636 8024302
 # @summary checking response of timestamp
-# @modules java.base/sun.misc
-#          java.base/sun.security.pkcs
+# @modules java.base/sun.security.pkcs
 #          java.base/sun.security.timestamp
 #          java.base/sun.security.x509
 #          java.base/sun.security.util
@@ -95,8 +94,7 @@
         $KT -alias ca -gencert -ext eku:critical=cs | \
         $KT -alias tsbad3 -importcert
 
-EXTRAOPTS="-XaddExports:java.base/sun.misc=ALL-UNNAMED \
- -XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED \
+EXTRAOPTS="-XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED \
  -XaddExports:java.base/sun.security.timestamp=ALL-UNNAMED \
  -XaddExports:java.base/sun.security.x509=ALL-UNNAMED \
  -XaddExports:java.base/sun.security.util=ALL-UNNAMED"
--- a/jdk/test/sun/security/x509/X500Name/NullX500Name.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/sun/security/x509/X500Name/NullX500Name.java	Sat Apr 09 20:12:13 2016 +0100
@@ -24,8 +24,7 @@
 /* @test
  * @bug 4118818
  * @summary allow null X.500 Names
- * @modules java.base/sun.misc
- *          java.base/sun.security.util
+ * @modules java.base/sun.security.util
  *          java.base/sun.security.x509
  */
 
--- a/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -71,7 +71,7 @@
         boolean compiled = CompilerUtils.compile(
                 SRC_DIR.resolve(TEST1_MODULE),
                 MODS_DIR.resolve(TEST1_MODULE),
-                "-XaddExports:java.base/sun.misc=m1");
+                "-XaddExports:java.base/jdk.internal.misc=m1");
         assertTrue(compiled, "module " + TEST1_MODULE + " did not compile");
 
         // javac -d upgrademods/java.transaction src/java.transaction/**
@@ -118,16 +118,16 @@
 
 
     /**
-     * Run class path application that uses sun.misc.Unsafe
+     * Run class path application that uses jdk.internal.misc.Unsafe
      */
     public void testUnnamedModule() throws Exception {
 
-        // java -XaddExports:java.base/sun.misc=ALL-UNNAMED \
+        // java -XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED \
         //      -cp mods/$TESTMODULE jdk.test.UsesUnsafe
 
         String classpath = MODS_DIR.resolve(TEST1_MODULE).toString();
         int exitValue
-            = executeTestJava("-XaddExports:java.base/sun.misc=ALL-UNNAMED",
+            = executeTestJava("-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED",
                               "-cp", classpath,
                               TEST1_MAIN_CLASS)
                 .outputTo(System.out)
@@ -139,16 +139,16 @@
 
 
     /**
-     * Run named module that uses sun.misc.Unsafe
+     * Run named module that uses jdk.internal.misc.Unsafe
      */
     public void testNamedModule() throws Exception {
 
-        //  java -XaddExports:java.base/sun.misc=test \
+        //  java -XaddExports:java.base/jdk.internal.misc=test \
         //       -mp mods -m $TESTMODULE/$MAIN_CLASS
 
         String mid = TEST1_MODULE + "/" + TEST1_MAIN_CLASS;
         int exitValue =
-            executeTestJava("-XaddExports:java.base/sun.misc=" + TEST1_MODULE,
+            executeTestJava("-XaddExports:java.base/jdk.internal.misc=" + TEST1_MODULE,
                             "-mp", MODS_DIR.toString(),
                             "-m", mid)
                 .outputTo(System.out)
@@ -240,13 +240,13 @@
     public Object[][] badValues() {
         return new Object[][]{
 
-            { "java.base/sun.misc",                  null }, // missing target
-            { "java.base/sun.misc=sun.monkey",       null }, // unknown target
-            { "java.monkey/sun.monkey=ALL-UNNAMED",  null }, // unknown module
-            { "java.base/sun.monkey=ALL-UNNAMED",    null }, // unknown package
-            { "java.monkey/sun.monkey=ALL-UNNAMED",  null }, // unknown module/package
-            { "java.base=ALL-UNNAMED",               null }, // missing package
-            { "java.base/=ALL-UNNAMED",              null }  // missing package
+            { "java.base/jdk.internal.misc",            null }, // missing target
+            { "java.base/jdk.internal.misc=sun.monkey", null }, // unknown target
+            { "java.monkey/sun.monkey=ALL-UNNAMED",     null }, // unknown module
+            { "java.base/sun.monkey=ALL-UNNAMED",       null }, // unknown package
+            { "java.monkey/sun.monkey=ALL-UNNAMED",     null }, // unknown module/package
+            { "java.base=ALL-UNNAMED",                  null }, // missing package
+            { "java.base/=ALL-UNNAMED",                 null }  // missing package
 
         };
     }
--- a/jdk/test/tools/launcher/modules/addexports/src/m1/jdk/test1/Main.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/tools/launcher/modules/addexports/src/m1/jdk/test1/Main.java	Sat Apr 09 20:12:13 2016 +0100
@@ -24,7 +24,7 @@
 package jdk.test1;
 
 import java.lang.reflect.Field;
-import sun.misc.Unsafe;
+import jdk.internal.misc.Unsafe;
 
 public class Main {
     public static void main(String[] args) throws Exception {
--- a/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java	Sat Apr 09 20:11:51 2016 +0100
+++ b/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java	Sat Apr 09 20:12:13 2016 +0100
@@ -103,9 +103,10 @@
     public void testWithAddMods() throws Exception {
         int exitValue;
 
-        // java -limitmods java.base -addmods java.logging -listmods
+        // java -limitmods java.base -addmods java.logging,jdk.unsupported -listmods
         exitValue = executeTestJava("-limitmods", "java.base",
-                                    "-addmods", "java.logging",
+                                    "-addmods",
+                                    "java.logging,jdk.unsupported",  // TODO: add bug No.
                                     "-listmods")
             .outputTo(System.out)
             .errorTo(System.out)