RFR: 8321279: Implement hashCode() in Heap-X-Buffer.java.template [v6]

Sergey Tsypanov stsypanov at openjdk.org
Tue Dec 12 07:43:48 UTC 2023


> Currently `Heap*Buffer.hashCode()` is inherited from `*Buffer` and implemented as 
> 
> public int hashCode() {
>     int h = 1;
>     int p = position();
>     for (int i = limit() - 1; i >= p; i--)
>         h = 31 * h + (int)get(i);
>     return h;
> }
> 
> This can be improved using `ArraysSupport.vectorizedHashCode()`

Sergey Tsypanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 14 additional commits since the last revision:

 - Merge branch 'master' into 8321279
 - 8321279: Adjust benchmark
 - 8321279: Add benchmark
 - Merge remote-tracking branch 'origin/8321279' into 8321279
 - Update src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
   
   Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
 - Update src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
   
   Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
 - Merge branch 'master' into 8321279
 - 8321279: Fix hashCode()
 - 8321279: Fix hashCode()
 - 8321279: Fix build
 - ... and 4 more: https://git.openjdk.org/jdk/compare/b7a31632...281e2af4

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/16992/files
  - new: https://git.openjdk.org/jdk/pull/16992/files/9a17af63..281e2af4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16992&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16992&range=04-05

  Stats: 11639 lines in 90 files changed: 9729 ins; 1622 del; 288 mod
  Patch: https://git.openjdk.org/jdk/pull/16992.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16992/head:pull/16992

PR: https://git.openjdk.org/jdk/pull/16992


More information about the nio-dev mailing list