RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v31]

Martin Doerr mdoerr at openjdk.org
Mon May 22 12:42:08 UTC 2023


On Mon, 22 May 2023 12:14:48 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/CallArranger.java line 65:
>> 
>>> 63:  */
>>> 64: public abstract class CallArranger {
>>> 65:     protected abstract boolean useABIv2();
>> 
>> This could also be refactored into a static method with the same trick that is used in `LinuxPPC64leLinker::getInstance`. Callers could be static then and you could delete `CallArranger::ABIv2` and `ABIv2CallArranger`.
>
> Maybe something like?
> 
>     protected static final boolean useABIv2 = CABI.current() == CABI.LINUX_PPC_64_LE;

That would be better to read, but would make the PPC64 CallArranger dependent on the current CABI.
Note that there are tests which use

import jdk.internal.foreign.abi.aarch64.CallArranger;
...
CallArranger.LINUX.getBindings(mt, fd, false);

for example. The tests are designed to run on all platforms.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12708#discussion_r1200459227


More information about the hotspot-dev mailing list