RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v24]
Richard Reingruber
rrich at openjdk.org
Wed May 10 14:19:44 UTC 2023
On Wed, 10 May 2023 11:16:44 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> src/hotspot/cpu/ppc/upcallLinker_ppc.cpp line 202:
>>
>>> 200:
>>> 201: MacroAssembler* _masm = new MacroAssembler(&buffer);
>>> 202: address start = __ function_entry(); // called by C
>>
>> If `!defined(ABI_ELFv2)` a function descriptor will be emitted here. It will be initialized with `friend_toc` and `friend_env`. But that's not correct for external callers, is it? If so, wouldn't an `Unimplemented()` be better than obscure crashes?
>
> No, this code is correct and tested (I have a partially working Big Endian patch). `toc` and `env` are loaded by the external caller (C code), but not used by the stub. So, we don't need to initialize them to any specific values.
I think I understand. The loaded `toc` and `env` of the stub are never used as Java execution does not use them and native or runtime calls will load corresponding `toc` and `env` of the callee.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/12708#discussion_r1189980161
More information about the core-libs-dev
mailing list