RFR: 8265218: trace_method_handle_stub fails to find calling frame on x86

Daniel D.Daugherty dcubed at openjdk.java.net
Mon Apr 19 20:06:06 UTC 2021


On Mon, 19 Apr 2021 13:46:57 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> src/hotspot/cpu/x86/methodHandles_x86.cpp line 558:
>> 
>>> 556:       FrameValues values;
>>> 557: 
>>> 558:       frame cur_frame = os::current_frame(); // reports caller's frame!
>> 
>> It is unclear what "caller" is relative to in that comment - is it the caller of os::current_frame() as seen by os::current_frame(), or is it the caller of the current method that is invoking os::current_frame() ?
>
> As opposed to "current C frame", it is about "caller's C frame" ;-)
> 
> I'll think about a way to make the comment less ambiguous.

It's always difficult to document a call to `os::current_frame()`.
I ran into this all the time when working with `AsyncGetCallTrace()`...

When I see the comment that you wrote here:

- I expect that comment to apply to the context in which I find that comment.
- In this case, I expect the `os::current_frame()` to return the caller's frame and since that comment is in `trace_method_handle_stub` AND that's the code that's calling `os::current_frame()`, I expect the "caller's frame" to mean `trace_method_handle_stub`.

If that's what you mean, then we're okay from my POV. If that's not what  you mean, then I'm confused.

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

PR: https://git.openjdk.java.net/jdk/pull/3554


More information about the hotspot-runtime-dev mailing list