Relates :
|
|
Relates :
|
Unsafe.copyMemory currently does some argument checking in the unsafe.cpp native method. By moving the arguments checks to Java the JIT can (potentially) remove them, and the resulting native code will be much cleaner. Additionally, there are currently two Unsafe classes: sun.misc.Unsafe and jdk.internal.misc.Unsafe. To avoid code duplication and the problems that come with it (forgetting to apply the same fix in both), the actual implementation should be limited to one of the classes, and the other one should delegate to that class instead. There is also room for cleaning up the native part of unsafe (unsafe.cpp).