RFR: 8314949: linux PPC64 Big Endian: Implementation of Foreign Function & Memory API
Martin Doerr
mdoerr at openjdk.org
Fri Aug 25 07:39:09 UTC 2023
On Thu, 24 Aug 2023 23:33:23 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> I've found a way to solve the remaining FFI problem on linux PPC64 Big Endian. Large structs (>8 Bytes) which are passed in registers or on stack require shifting the Bytes in the last slot if the size is not a multiple of 8. This PR adds the required functionality to the Java code.
>>
>> Please review and provide feedback. There may be better ways to implement it. I just found one which works and makes the tests pass:
>>
>> Test summary
>> ==============================
>> TEST TOTAL PASS FAIL ERROR
>> jtreg:test/jdk/java/foreign 88 88 0 0
>>
>>
>> Note: This PR should be considered as preparation work for AIX which also uses ABIv1.
>
> src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/ABIv1CallArranger.java line 33:
>
>> 31: * PPC64 CallArranger specialized for ABI v1.
>> 32: */
>> 33: public class ABIv1CallArranger extends CallArranger {
>
> Wouldn't it be more natural for CallArranger to have an abstract method (or even a kind() accessor for the different kinds of ABI supported) and then have these specialized subclasses return the correct kind? It seems to me that setting the `useXYZAbi` flag using an instanceof test is a little dirty.
I had something like that, but another reviewer didn't like it, either. Originally, I had thought that the v1 and v2 CallArrangers would get more content, but they're still empty. Would it be better to remove these special CallArrangers and distinguish in the base class?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15417#discussion_r1305300539
More information about the core-libs-dev
mailing list