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

Clean up Unsafe

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 9
    • None
    • core-libs
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: