RFR: 8315801: [PPC64] JNI code should be more similar to the Panama implementation [v5]
Richard Reingruber
rrich at openjdk.org
Wed Nov 8 17:03:06 UTC 2023
On Mon, 11 Sep 2023 21:05:14 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> This PR removes writing parameters to stack which are passed in registers. (See JBS issue for more details.) This allows us to get rid of the extra parameter for `c_calling_convention`.
>>
>> We can also remove the extra space for the Parameter Save Area in some ABIv2 cases (ppc64le). Note that JNI and runtime calls don't support VarArgs (except as array object for JNI), so this optimization is valid (unlike in downcalls for Panama).
>>
>> The offset of floats on stack can be put into a constant and used by interpreter and `c_calling_convention`. Panama handles this in the CallArranger. Added comment which resolves a Panama "todo".
>>
>> Tests have passed on linux ppc64 and ppc64le and AIX.
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
>
> Cleanup further Argument constants.
src/hotspot/cpu/ppc/foreignGlobals_ppc.cpp line 186:
> 184: if (from_reg.segment_mask() == REG32_MASK) {
> 185: assert(to_reg.stack_size() == 4, "size should match");
> 186: __ stfs(as_FloatRegister(from_reg), reg2offset(to_reg, out_stk_bias) + Argument::float_on_stack_offset_in_bytes_c, R1_SP);
Can the target of this store be in a Java frame? I'm asking because I think that float values in Java frames are always located at offset 0 of the slot (see `StackValueCollection::float_at`).
src/hotspot/cpu/ppc/foreignGlobals_ppc.cpp line 210:
> 208: switch (from_reg.stack_size()) {
> 209: case 8: __ lfd(as_FloatRegister(to_reg), reg2offset(from_reg, in_stk_bias), callerSP); break;
> 210: case 4: __ lfs(as_FloatRegister(to_reg), reg2offset(from_reg, in_stk_bias) + Argument::float_on_stack_offset_in_bytes_c, callerSP); break;
Can this be a load from a Java frame? I'm asking because I think that float values in Java frames are always located at offset 0 of the slot (see `StackValueCollection::float_at`).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15599#discussion_r1324358217
PR Review Comment: https://git.openjdk.org/jdk/pull/15599#discussion_r1324366127
More information about the hotspot-compiler-dev
mailing list