RFR: 8313419: Template interpreter produces no safepoint check for return bytecodes

Patricio Chilano Mateo pchilanomate at openjdk.org
Thu Aug 17 17:07:31 UTC 2023


On Fri, 11 Aug 2023 13:22:19 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:

> The template interpreter produces a safepoint check for return bytecodes (TemplateTable::_return(TosState state)) on x86, ppc64le and s390, but not on aarch64, arm32, and riscv64.
> 
> This PR adds the missing  safepoint check to  aarch64, arm32, and riscv64.
> 
> Tested tier1-tier7 on aarch64. Both arm32, and riscv64 was sanity tested using Qemu.

Looks good to me.

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 2206:

> 2204:     __ push(state);
> 2205:     __ push_cont_fastpath(rthread);
> 2206:     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint));

Looking at the code generated for the existing safepoint poll (`TemplateInterpreterGenerator::generate_safept_entry_for()`) I see we add a full memory barrier after the return from `InterpreterRuntime::at_safepoint()`. That would call for adding it here too although I don't see why we need that. The SafepointMechanism logic already executes the proper barriers after we process pending operations. Same thing for riscv.

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

Marked as reviewed by pchilanomate (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15248#pullrequestreview-1583055387
PR Review Comment: https://git.openjdk.org/jdk/pull/15248#discussion_r1297495880


More information about the hotspot-dev mailing list