RFR: 8253860: PPC: Relocation::pd_set_data_value conflates compressed oops and klasses

Martin Doerr mdoerr at openjdk.java.net
Mon Dec 6 09:36:24 UTC 2021


Casting narrow Klass pointer to a narrow Oop is problematic. Note that `NativeMovConstReg::set_narrow_oop` only supports narrow Oops.
It turns out, that the problematic code is unused. We never patch narrow Klass pointers in the instruction stream on PPC64 (metadata_Relocation::pd_fix_value has an empty implementation). In contrast to that, narrow Oops in the instructions stream always get patched when the nmethod gets installed (by fix_oop_relocations). This makes sense as Metadata doesn't get relocated, but Oops may be moved by GC and the instructions need to get the current value during nmethod installation.
Note that the initial constants we were using for narrow Oops in the instruction stream were not correct (Oop compression missing, not updated by GC). So, I think it's better to use 0 to avoid confusion.

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

Commit messages:
 - 8253860: PPC: Relocation::pd_set_data_value conflates compressed oops and klasses

Changes: https://git.openjdk.java.net/jdk/pull/6716/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6716&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8253860
  Stats: 39 lines in 5 files changed: 1 ins; 24 del; 14 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6716.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6716/head:pull/6716

PR: https://git.openjdk.java.net/jdk/pull/6716


More information about the hotspot-dev mailing list