RFR: 8365166: ARM32: missing os::fetch_bcp_from_context implementation

Boris Ulasevich bulasevich at openjdk.org
Tue Aug 12 19:38:50 UTC 2025


On Fri, 8 Aug 2025 17:07:06 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Since [JDK-8352251](https://bugs.openjdk.org/browse/JDK-8352251) (JEP 518: JFR Cooperative Sampling), jfrSampleRequest calls os::fetch_bcp_from_context(). On ARM32 port it is still Unimplemented(). It should read the corresponding field from uc_mcontext and return the BCP value.
>
> src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp line 215:
> 
>> 213:   const ucontext_t* uc = (const ucontext_t*)ucVoid;
>> 214:   assert(os::Posix::ucontext_is_interpreter(uc), "invariant");
>> 215:   return (intptr_t*)uc->uc_mcontext.arm_r7;
> 
> You sure it is always R7? The `Rbcp` register definition seems to choose between R7 and R11: https://github.com/openjdk/jdk/blob/241808e13fb032b0ec192e0b7ff94891a653ac94/src/hotspot/cpu/arm/register_arm.hpp#L414-L415

Right. It seems a relic, but for consistency I added support for alternative Rbcp.
Thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26699#discussion_r2270973006


More information about the hotspot-runtime-dev mailing list