RFR: 8287325: AArch64: fix virtual threads with -XX:UseBranchProtection=pac-ret [v6]

Andrew Haley aph at openjdk.org
Mon Sep 11 09:37:45 UTC 2023


On Mon, 11 Sep 2023 08:15:16 GMT, Hao Sun <haosun at openjdk.org> wrote:

>> src/hotspot/cpu/ppc/continuationHelper_ppc.inline.hpp line 64:
>> 
>>> 62:   *(address*)sp = pc;
>>> 63: }
>>> 64: 
>> 
>> Is it possible to make put methods in the superclass, and override then only for AArch64?
>
> I doubt that.
> 
> In current design, we declare member functions in the shared `ContinuationHelper.hpp`, and define them in the architecture specific `ContinuationHelper_xx.inline.hpp` (e.g, `ContinuationHelper_aarch64.inline.hpp` for AArch64 backend).
> 
> Following current design, if we introduce one base class(e.g., `class ContinuationCommonHelper`) and the default `patch_return_address_at()` implementation, we still have to declare `ContinuationHelper::patch_return_address_at()` in the shared `ContinuationHelper.hpp` and define it for all architectures inevitably.
> 
> Otherwise, we have to 
> 1) only declare `ContinuationHelper::patch_return_address_at()` in `ContinuationHelper.hpp` for AArch64 target with the help of conditional compilation directives. OR
> 2) put the declaration of `class ContinuationHelper` to `ContinuationHelper_xx.inline.hpp` and only overwride `patch_return_address_at()` for AArch64.
> 
> But I think neither way is neat. WDYT? Thanks.

Why not define the default `BaseContinuationHelper::patch_return_address_at()` in ContinuationHelper.hpp?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13322#discussion_r1321267980


More information about the hotspot-dev mailing list