RFR: 8354062: x86: Optimize stores of zero immediates with r12_heapbase

Aleksey Shipilev shade at openjdk.org
Tue Apr 8 17:59:25 UTC 2025


X86 does not have zero register. Except that it does for Hotspot, when compressed oops are enabled and heap base is zero. C2 routinely uses `r12` as zero register then. It makes the code considerably more compact. We can do the same in `MacroAssembler`. This would target the stores of known zeroes, which are surprisingly frequent in C1, mostly for zeroing out various `JavaThread` slots, e.g. for exception handling. 

Additional testing:
 - [ ] Linux x86_64 server fastdebug, `all`

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

Commit messages:
 - Fix

Changes: https://git.openjdk.org/jdk/pull/24519/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24519&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354062
  Stats: 20 lines in 2 files changed: 17 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/24519.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24519/head:pull/24519

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


More information about the hotspot-dev mailing list