RFR: 8308984: Relativize last_sp (and top_frame_sp) in interpreter frames
Fei Yang
fyang at openjdk.org
Mon Jul 31 01:04:00 UTC 2023
On Mon, 19 Jun 2023 15:59:15 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:
> Implementation of relativized last_sp (top_frame_sp on PowerPC) in interpreter frames for x64, aarch64, ppc64le and riscv.
> Not relativized last_sp on arm, zero and s390 but done some changes to cope with the changed generic code.
>
> By changing the "last_sp" member in interpreter frames from being an absolute address into an offset that is relative to the frame pointer, we don't need to change the value as we freeze and thaw frames of virtual threads. This is since we might freeze and thaw from and to different worker threads, so the absolute address to locals might change, but the offset from the frame pointer will be constant.
>
> This subtask only handles "last_sp" (and its close equivalent "top_frame_sp" on PowerPC). The relativization of other interpreter frame members are handled in other subtasks to JDK-8289296.
>
> Tested tier1-tier7 on supported platforms. The rest was sanity tested using Qemu.
This has passed hotspot_loom, jdk_loom and tier1-3 tests on linux-riscv64 platform. Minor suggestions for riscv code. Thanks.
src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp line 430:
> 428: // Restore stack bottom in case i2c adjusted stack
> 429: __ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
> 430: __ shadd(esp, t0, fp, t1, LogBytesPerWord);
Suggestion: `__ shadd(esp, t0, fp, t0, LogBytesPerWord);`
src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp line 488:
> 486: // Restore expression stack pointer
> 487: __ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
> 488: __ shadd(esp, t0, fp, t1, LogBytesPerWord);
Suggestion: `__ shadd(esp, t0, fp, t0, LogBytesPerWord);`
src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp line 1610:
> 1608: // Restore the last_sp and null it out
> 1609: __ ld(t0, Address(fp, frame::interpreter_frame_last_sp_offset * wordSize));
> 1610: __ shadd(esp, t0, fp, t1, LogBytesPerWord);
Suggestion: `__ shadd(esp, t0, fp, t0, LogBytesPerWord);`
-------------
Changes requested by fyang (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/14545#pullrequestreview-1553749311
PR Review Comment: https://git.openjdk.org/jdk/pull/14545#discussion_r1278649581
PR Review Comment: https://git.openjdk.org/jdk/pull/14545#discussion_r1278649627
PR Review Comment: https://git.openjdk.org/jdk/pull/14545#discussion_r1278649642
More information about the hotspot-dev
mailing list