RFR: JDK-8267985: Allow AsyncGetCallTrace and JFR to walk a stub frame
Ludovic Henry
luhenry at openjdk.java.net
Thu Jun 3 14:30:38 UTC 2021
On Mon, 31 May 2021 16:06:10 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:
> When the signal sent for AsyncGetCallTrace or JFR would land on a stub
> (like arraycopy), it wouldn't be able to detect the sender (caller)
> frame because `_cb->frame_size() == 0`.
>
> Because we fully control how the prolog and epilog of stub code is
> generated, we know there are two cases:
> 1. A stack frame is allocated via macroAssembler->enter(), and consists
> in `push rbp; mov rsp, rbp;`.
> 2. No stack frames are allocated and rbp is left unchanged and rsp is
> decremented with the `call` instruction that push the return `pc` on the
> stack.
>
> For case 1., we can easily know the sender frame by simply looking at
> rbp, especially since we know that all stubs preserve the frame pointer
> (on x86 at least).
>
> For case 2., we end up returning the sender's sender, but that already
> gives us more information than what we have today.
Depends on https://github.com/openjdk/jdk/pull/4337
-------------
PR: https://git.openjdk.java.net/jdk/pull/4274
More information about the hotspot-dev
mailing list