JDK-8253860 : PPC: Relocation::pd_set_data_value conflates compressed oops and klasses
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16,17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2020-09-30
  • Updated: 2021-12-14
  • Resolved: 2021-12-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19 b01Fixed
Related Reports
Relates :  
Relates :  
Description
The ppc implementation of Relocation::pd_set_data_value converts a compressed klass pointer to a narrowOop to be passed into a routine for inserting literal constants into the code.  This depends on the representation types being the same.  This showed up as part of JDK-8247912, where narrowOop is no longer just a typedef for uint32_t, so the implicit type pun with compressed klass pointers had to be made explicit.

It might be that all is basically well here except for some naming and parameter type confusion.  Or there might be something actually wrong with treating a compressed klass pointer as a compressed oop pointer.

Comments
Changeset: 01b30bfa Author: Martin Doerr <mdoerr@openjdk.org> Date: 2021-12-09 17:04:55 +0000 URL: https://git.openjdk.java.net/jdk/commit/01b30bfa99e95cf1e9209c8de1f3c3c762596708
09-12-2021

Moving to tbd. If it makes it before the fork today it will go into JDK 18, otherwise into JDK 19.
09-12-2021

It turns out that the type punning code is unused. We never patch narrow Klass pointers in the instruction stream on PPC64. If it was done, it wouldn't work correctly, because NativeMovConstReg::set_narrow_oop only supports Oops, not Klass pointers. So, I suggest to do some cleanup and remove the unused and incorrect code.
06-12-2021