RFR: 8329331: Intrinsify Unsafe::setMemory

Scott Gibbons sgibbons at openjdk.org
Fri Mar 29 22:39:11 UTC 2024


This code makes an intrinsic stub for `Unsafe::setMemory`.  See [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around this change.

Overall, making this an intrinsic improves overall performance of `Unsafe::setMemory` by up to 4x for all buffer sizes.

Tested with tier-1 (and full CI).  I've added a table of the before and after numbers for the JMH I ran (`MemorySegmentZeroUnsafe`).

[setMemoryBM.txt](https://github.com/openjdk/jdk/files/14808974/setMemoryBM.txt)

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

Commit messages:
 - Clean up code for PR
 - Fixed bug - incorrect interface to *_fill_entry
 - Address review comment
 - Restore intrinsic
 - Add benchmark
 - Test removing intrinsic
 - Removed setMemory1; debugged intrinsic code
 - Added actual intrinsic
 - Add Unsafe.setMemory as intrinsic

Changes: https://git.openjdk.org/jdk/pull/18555/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18555&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8329331
  Stats: 362 lines in 21 files changed: 311 ins; 49 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/18555.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18555/head:pull/18555

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


More information about the core-libs-dev mailing list