Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8149159

Clean up Unsafe

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Resolved In Build:
      b112

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mikael Mikael Vidstedt
                Reporter:
                mikael Mikael Vidstedt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: