JDK-8080684 : PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2015-05-19
  • Updated: 2019-03-20
  • Resolved: 2015-06-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 9
9 b72Fixed
Related Reports
Relates :  
Relates :  
Description
On big-endian ppc64 we need so called 'function descriptors' instead of simple pointers in order to call functions. That's why the Assembler class on ppc64 offers an 'emit_fd()' method which can be used to create such a function descriptor.

On little-endian ppc64 the ABI was changed (i.e. ABI_ELFv2) and function descriptors have been removed. That's why the before mentioned 'emit_fd()' is being excluded from the build with the help of preprocessor macros if the HotSpot is being build in a little endian environment:

#if !defined(ABI_ELFv2)
inline address emit_fd(...)
#endif

The drawback of this approach is that every call site which uses 'emit_fd()' has to conditionally handle the case where 'emit_fd()' isn't present as well. This was exactly the problem with change "8077838: Recent developments for ppc" which introduced an unconditional call to 'emit_fd()' in 'VM_Version::config_dscr() which lead to a build failure on little endian.

A better approach would be to make 'emit_fd()' available on both, little- and big-endian platforms and handle the difference internally, within the function itself. On little-endian, the function will just return the current PC without emitting any code at all while the big-endian variant emits the required function descriptor.

Comments
It turns out there is already a wrapper for emit_fd which does exactly that. function_entry() calls emit_fd() and returns its return value on a big-endian platform while it simply returns the value of pc() on little endian.
08-06-2015