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

Unsafe methods to produce uninitialized arrays

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 9
    • 9
    • hotspot
    • b112

    Description

      When instantiating arrays from Java, we have to zero the backing storage to match JLS requirements. In some cases, like with the subsequent arraycopy, we are able to remove zeroing. However, in a generic case where a complicated processing is done after allocation, compilers are unable to figure out the array is covered completely. See JDK-8150463 for a motivational example of this.

      It might make sense to allow new Unsafe method that will return uninitialized arrays to trusted Java code.

      Patches:
       http://cr.openjdk.java.net/~shade/8150465/webrev.jdk.03/
       http://cr.openjdk.java.net/~shade/8150465/webrev.hs.04/

      Notes:
       http://cr.openjdk.java.net/~shade/8150465/notes.txt

      Attachments

        Issue Links

          Activity

            People

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: