RFR: 8356869: RISC-V: Improve tail handling of array fill stub [v3]

Anjian-Wen duke at openjdk.org
Wed May 14 03:28:36 UTC 2025


> The tail handling after bulk copy in array fill stub may trigger misaligned memory accesses.
> The address is 8-byte aligned after bulk copy and the tail handling copies BYTE, SHORT, and
> INT granules in order. This could trigger misaligned accesses. We should copy the remainings
> in this order: INT, SHORT, and BYTE to avoid such an issue.
> 
> JMH data on P550 SBC for reference (@Param("15") private int size):
> 
> Before:
> Benchmark                 (size)  Mode  Cnt    Score   Error  Units
> ArrayFill.fillByteArray       15  avgt   12  961.604 ± 1.497  ns/op
> ArrayFill.fillIntArray        15  avgt   12   29.355 ± 0.024  ns/op
> ArrayFill.fillShortArray      15  avgt   12  569.499 ± 0.662  ns/op
> ArrayFill.zeroByteArray       15  avgt   12  957.080 ± 5.358  ns/op
> ArrayFill.zeroIntArray        15  avgt   12   29.344 ± 0.006  ns/op
> ArrayFill.zeroShortArray      15  avgt   12  569.730 ± 0.441  ns/op
> 
> After:
> Benchmark                 (size)  Mode  Cnt   Score   Error  Units
> ArrayFill.fillByteArray       15  avgt   12  32.206 ± 0.005  ns/op
> ArrayFill.fillIntArray        15  avgt   12  29.347 ± 0.007  ns/op
> ArrayFill.fillShortArray      15  avgt   12  31.732 ± 0.451  ns/op
> ArrayFill.zeroByteArray       15  avgt   12  32.208 ± 0.007  ns/op
> ArrayFill.zeroIntArray        15  avgt   12  29.346 ± 0.007  ns/op
> ArrayFill.zeroShortArray      15  avgt   12  31.492 ± 0.006  ns/op

Anjian-Wen has updated the pull request incrementally with one additional commit since the last revision:

  fix format

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25210/files
  - new: https://git.openjdk.org/jdk/pull/25210/files/e9114839..432b31d6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25210&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25210&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/25210.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25210/head:pull/25210

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


More information about the hotspot-compiler-dev mailing list