RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v3]
Pavel Rappo
prappo at openjdk.org
Wed May 29 15:50:32 UTC 2024
> Please review this PR, which supersedes a now withdrawn https://github.com/openjdk/jdk/pull/14831.
>
> This PR replaces `ArraysSupport.vectorizedHashCode` with a set of more user-friendly methods. Here's a summary:
>
> - Made the operand constants (i.e. `T_BOOLEAN` and friends) and the `vectorizedHashCode` method private
>
> - Made the `vectorizedHashCode` method private, but didn't rename it. Renaming would dramatically increase this PR review cost, because that method's name is used by a lot of VM code. On a bright side, since the method is now private, it's no longer callable by clients of `ArraysSupport`, thus a problem of an inaccurate name is less severe.
>
> - Made the `ArraysSupport.utf16HashCode` method private
>
> - Moved tiny cases (i.e. 0, 1, 2) to `ArraysSupport`
Pavel Rappo has updated the pull request incrementally with three additional commits since the last revision:
- Update copyright years
Note: any commit hashes below might be outdated due to subsequent
history rewriting (e.g. git rebase).
+ update src/java.base/share/classes/java/lang/CharacterName.java due to 4ed451d691c
+ update src/java.base/share/classes/java/lang/StringLatin1.java due to 4ed451d691c
+ update src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template due to 4ed451d691c
+ update src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java due to 4ed451d691c
+ update src/java.base/share/classes/sun/security/util/DerValue.java due to 4ed451d691c
+ update src/java.base/unix/classes/sun/nio/fs/UnixPath.java due to 4ed451d691c
+ update test/hotspot/jtreg/compiler/intrinsics/TestArraysHashCode.java due to 4ed451d691c
- Drop redundant (int) cast
- Use Byte.toUnsignedInt not & 0xff
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/19414/files
- new: https://git.openjdk.org/jdk/pull/19414/files/adc7557d..53d4ed09
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=19414&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=19414&range=01-02
Stats: 12 lines in 8 files changed: 0 ins; 0 del; 12 mod
Patch: https://git.openjdk.org/jdk/pull/19414.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19414/head:pull/19414
PR: https://git.openjdk.org/jdk/pull/19414
More information about the hotspot-compiler-dev
mailing list