RFR: 8221724: Enable archiving of Strings with hash 0
Claes Redestad
claes.redestad at oracle.com
Mon Apr 1 13:12:19 UTC 2019
Hi,
the current implementation of String archiving explicitly excludes
Strings with hashcode 0, including "". The reason for this is not
explicitly stated, but is likely to be due the fact that
String::hashCode currently stores the calculated 0 to String.hash every
time, which doesn't play well with read-only memory.
This behavior is a blocker for archiving things where such strings might
exist and there is code depending on the identity of the same, so I
propose dropping this restriction. This doesn't _break_ anything
functionally: all tests passes with this patch, regardless of whether
the patch I'm proposing to change String::hashCode is applied, but some
pages could be dirtied and copied into non-shared memory.
Bug: https://bugs.openjdk.java.net/browse/JDK-8221724
Webrev: http://cr.openjdk.java.net/~redestad/8221724/open.00/
Testing: tier1-3
Thanks!
/Claes
[1] https://bugs.openjdk.java.net/browse/JDK-8221723
More information about the hotspot-runtime-dev
mailing list