RFR: 8075930: AARCH64: Use FP Register in C2
Zoltán Majó
zoltan.majo at oracle.com
Thu Mar 26 08:49:23 UTC 2015
Hi Ed,
On 03/25/2015 05:59 PM, Edward Nevill wrote:
> Hi Zoltán,
>
> On Wed, 2015-03-25 at 14:28 +0100, Zoltán Majó wrote:
>> On 03/25/2015 02:02 PM, Edward Nevill wrote:
>>> The aarch64 C2 compiler makes no use of the FP register even though this register is saved on entry and restored on exit and is therefore always available for allocation.
>> It seems to me that the C2 compiler currently saves the SP into FP on
>> method handle invokes. This functionality is encoded by
>> aarch64_enc_java_handle_call in aarch64.ad. C1 does the same (see usages
>> of FrameMap::method_handle_invoke_SP_save_opr()).
> Thanks! I had not spotted this usage.
>
> If my understanding is correct, it does not need to be RFP in
> aarch64_enc_java_handle_call. It could be any callee saved register? On
> aarch64 r19..r28 are callee saved so we could use say r19 instead.
Yes, any callee-saved would be OK.
> C1 and C2 are caller save, so they will not have any valid data in r19
> at the point of the call (this is the problem with using RFP, because
> RFP is not caller save).
>
>> Stack walking relies on having the SP saved into FP for method handle
>> invokes (e.g., in frame::adjust_unextended_sp()).
> These would then need to be modified to recover the sp from r19.
That is correct as well.
As I mentioned earlier, I'm currently working on a patch that intends to
disable saving SP into FP on method handle invokes on x86 (JDK-8068945).
Maybe the same could be done for aarch64 as well and then you could use
both fp and r19 as "general purpose" registers. I plan to send out the
RFR this week or early next week and will let you know.
But what you just proposed is also fine, I think.
Best wishes,
Zoltán
>
> Would this work?
>
> All the best,
> Ed.
>
>
More information about the hotspot-dev
mailing list