RFR: 8288971: AArch64: Clean up stack and register handling in interpreter
Nick Gasson
ngasson at openjdk.org
Wed Jun 29 11:27:44 UTC 2022
On Wed, 22 Jun 2022 13:00:44 GMT, Andrew Haley <aph at openjdk.org> wrote:
> There are several places in the interpreter that could be improved.
>
> 1. We use r13 to pass the caller's SP to a callee through adapters. r13 is not a callee-saved register in the native ABI, so this causes some complications. Use a callee-saved register.
> 2. We frequently recalculate the location where the native SP needs to go. We have a spare slot in the interpreter frame, so we should calculate it once, when the frame is created, and use it.
> 3. Related to 1, we should clearly label all the places where the caller's SP is passed to a callee.
src/hotspot/cpu/aarch64/assembler_aarch64.hpp line 156:
> 154: REGISTER_DECLARATION(Register, esp, r20);
> 155: // Sender's SP while in interpreter
> 156: REGISTER_DECLARATION(Register, r19_sender_sp, r19);
I don't think rmonitors above is used anywhere, perhaps you could reuse r25? Or at least delete the definition of rmonitors while you're editing this.
src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp line 98:
> 96: void check_extended_sp(const char* msg = "check extended SP") {
> 97: #ifdef ASSERT
> 98: Label L;
Should be two space indent here
src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp line 1430:
> 1428:
> 1429: // Restore SP (drop native parameters area), to keep SP in sync with extended_sp in frame
> 1430: // __ restore_sp_after_call();
This seems to happen further down, around line 1530, but it's interleaved with popping the frame. Is there a reason to have the commented out call here?
-------------
PR: https://git.openjdk.org/jdk/pull/9239
More information about the hotspot-dev
mailing list