RFR: 8340453: C2: Improve encoding of LoadNKlass for compact headers [v3]

Roman Kennke rkennke at openjdk.org
Thu Nov 14 11:26:31 UTC 2024


> We currently use the offset 4 as a placeholder in LoadNKlass, when running with compact headers. In reality, we are loading from offset 0, but we want to keep LoadNKlass on a separate memory slice from other mark-word-accesses, because LoadNKlass is essentially immutable memory. The consequence is that we need to figure out the address of the mark-word in the backend, and this is ugly.
> 
> However, we can do better. We can just as well load 4 bytes from offset 4, and shift by a 32 smaller shift. This has previously not been possible because we needed to check for the monitor bit in the markWord, but this is no longer necessary. This simplifies the code and even makes the instructions encoding a bit smaller.
> 
> Testing:
>  - [x] tier1 aarch64 +UCOH 
>  - [x] tier1 x86_64 +UCOH

Roman Kennke has updated the pull request incrementally with two additional commits since the last revision:

 - Fix aarch64 opto output
 - Clarify semantics of LoadNKlassNode and effect on C2's type system

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22078/files
  - new: https://git.openjdk.org/jdk/pull/22078/files/d2010d1e..7d32a835

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

  Stats: 7 lines in 2 files changed: 6 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/22078.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22078/head:pull/22078

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


More information about the hotspot-compiler-dev mailing list