RFR: 8236850: Operations on constant List/Set.of(element) instances does not consistently constant fold

Claes Redestad claes.redestad at oracle.com
Fri Jan 10 17:01:40 UTC 2020


Hi,

this patch ensures operations on constant (static final) single-element
lists and sets created via List.of(foo) and Set.of(bar) to constant fold
properly.

Bug:    https://bugs.openjdk.java.net/browse/JDK-8236850
Webrev: http://cr.openjdk.java.net/~redestad/8236850/open.00

On micros that are set up to test constant folding, e.g.
sumSizesFinalList, we see improvements around 10-15%.

I also cleaned up and consolidated the heap archiving interaction a
notch. It was needed in an earlier prototype version of the patch, but
no longer.. since it's a cleanup I kept the changes.

Testing: tier1-3

Thanks!

/Claes


More information about the core-libs-dev mailing list