RFR: 8288971: AArch64: Clean up stack and register handling in interpreter [v2]

Andrew Dinn adinn at openjdk.org
Thu Jun 30 10:57:31 UTC 2022


On Thu, 30 Jun 2022 10:37:57 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp line 183:
>> 
>>> 181:   // All frames but the initial (oldest) interpreter frame we fill in have
>>> 182:   // a value for sender_sp that allows walking the stack but isn't
>>> 183:   // truly correct. Correct the value here.
>> 
>> The condition this comment leads into tests for
>> 
>> interpreter_frame->sender_sp() == interpreter_frame->interpreter_frame_sender_sp())
>> 
>> I'm not really clear how/where that actually happens? Can you explain?
>
> Sure.
> First thing to realize is that this method is used only by deopt. The logic here removes the caller's args that it's pushed onto the stack, iff the caller is an interpreted method.
> I think this is a hangover from x86. It doesn't hurt, but neither does it do anything useful AFAICS because we're going to restore the caller's SP from `interpreter_frame_extended_sp` and the caller's ESP from `interpreter_frame_last_sp` as soon as we return.
> I guess it's possible that something somewhere that walks the stack depends on this logic, but if it does I can't find it.

Ah yes, I should have looked at the calling code. Ta!

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

PR: https://git.openjdk.org/jdk/pull/9239


More information about the hotspot-dev mailing list