RFR: 8142487: Cleanup sun.invoke.util.Wrapper zeroes to be both reliable and lazy

Claes Redestad claes.redestad at oracle.com
Wed Nov 11 19:53:25 UTC 2015


following-up on JDK-8141678[1]. So, it appears we want to avoid the 
fragility of keeping local copies of Byte/Short/Integer in Wrapper, and 
instead get the boxed zeroes lazily, when we actually need them.

It turns out simply fixing Wrapper.zero() would then regress things back 
a bit, since java.lang.invoke.LambdaForm itself eagerly generates a 
number of LambdaForms and NamedFunctions that touch a couple of 
Wrapper.zeros. By making the initialization of these lazy as well we not 
only avoid regression compared to JDK-8141678, but further remove 
another 9 LambdaForms from jigsaw startup (down from 74 to 65; down to 
37 together with JDK-8142334[2]). An unneeded function (void zero_V) was 
removed in the process.

webrev: http://cr.openjdk.java.net/~redestad/8142487/webrev.01
bug: https://bugs.openjdk.java.net/browse/JDK-8142487



[1] https://bugs.openjdk.java.net/browse/JDK-8141678
[2] https://bugs.openjdk.java.net/browse/JDK-8142334 - review thread: 

More information about the core-libs-dev mailing list