JDK-8150465 : Unsafe methods to produce uninitialized arrays
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-02-23
  • Updated: 2021-01-06
  • Resolved: 2016-03-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b112Fixed
Related Reports
Blocks :  
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
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
Comments
RFR: http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-February/021899.html
26-02-2016