RFR: JDK-8267985: Allow AsyncGetCallTrace and JFR to walk a stub frame
Ludovic Henry
luhenry at openjdk.java.net
Mon May 31 16:13:29 UTC 2021
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 preserver 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.
-------------
Commit messages:
- JDK-8267985: Allow AsyncGetCallTrace and JFR to walk a stub frame
Changes: https://git.openjdk.java.net/jdk/pull/4274/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4274&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8267985
Stats: 41 lines in 1 file changed: 31 ins; 0 del; 10 mod
Patch: https://git.openjdk.java.net/jdk/pull/4274.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/4274/head:pull/4274
PR: https://git.openjdk.java.net/jdk/pull/4274
More information about the hotspot-dev
mailing list