Review Request JDK-8181443: Replace usages of jdk.internal.misc.Unsafe with MethodHandles.Lookup.defineClass

Mandy Chung mandy.chung at
Wed Oct 3 17:56:51 UTC 2018

This patch replaces java.lang.invoke and JFR use of
jdk.internal.misc.Unsafe::defineClass with Lookup::defineClass.
It also replaces dynamic proxy and reflection implementation to
use the shared secret to invoke ClassLoader::defineClass.


With this change, JDK no longer uses Unsafe::defineClass.
Any opinion in removing Unsafe::defineClass support?

I ran jdk_core, jdk_jfr, tier1_runtime and tier1_compiler tests.


More information about the core-libs-dev mailing list