RFR: 8335411: RISC-V: Optimize encode_heap_oop when oop is not null

Feilong Jiang fjiang at openjdk.org
Mon Jul 1 14:40:26 UTC 2024


Hi, please review this enhancement that adds two more `encode_heap_oop_not_null` methods.

Currently, `encode_heap_oop` will check if the oop pointer is `null` at first. We can skip the null check of the oop to reduce the unnecessary branch instruction when encoding non-null oop pointer into compressed form.


Testing:
- [x] Tier1~3 on linux-riscv64 with release build
- [x] renaissance & dacapo benchmark suits for functionality

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

Commit messages:
 - add encode_heap_oop_not_null for riscv

Changes: https://git.openjdk.org/jdk/pull/19974/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19974&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8335411
  Stats: 62 lines in 3 files changed: 59 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/19974.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19974/head:pull/19974

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


More information about the hotspot-dev mailing list