Avoid recalculating String.hash when zero

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 13
    • Affects Version/s: 13
    • Component/s: core-libs
    • b16

      As suggested in RFR thread for JDK-8221723 (http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-April/059480.html) we can add a boolean/byte to String to mark that a String.hash has been calculated as zero with neither footprint nor notable performance penalties.

      On top of the patch suggested by Peter, we should make the VM code cooperate when necessary, but with the suggested approach VM code typically does not need to set the hashIsZero flag to be semantically consistent.

            Assignee:
            Claes Redestad
            Reporter:
            Claes Redestad
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: