RFR: 8314508: Improve how relativized pointers are printed by frame::describe [v2]
Coleen Phillimore
coleenp at openjdk.org
Thu Mar 7 21:05:55 UTC 2024
On Tue, 5 Mar 2024 13:07:02 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:
>> The output from frame::describe has been improved so that it now prints the actual derelativized pointer value, regardless if it's on the stack or on the heap. It also clearly shows which members of the fixed stackframe are relativized. See sample output of a riscv64 stackframe below:
>>
>>
>> [6.693s][trace][continuations] 0x000000409e14cc88: 0x00000000eeceaf58 locals for #10
>> [6.693s][trace][continuations] local 0
>> [6.693s][trace][continuations] oop for #10
>> [6.693s][trace][continuations] 0x000000409e14cc80: 0x00000000eec34548 local 1
>> [6.693s][trace][continuations] oop for #10
>> [6.693s][trace][continuations] 0x000000409e14cc78: 0x00000000eeceac58 local 2
>> [6.693s][trace][continuations] oop for #10
>> [6.693s][trace][continuations] 0x000000409e14cc70: 0x00000000eee03eb0 #10 method java.lang.invoke.LambdaForm$DMH/0x0000000050001000.invokeVirtual(Ljava/lang/Object;Ljava/lang/Object;)V @ 10
>> [6.693s][trace][continuations] - 3 locals 3 max stack
>> [6.693s][trace][continuations] - codelet: return entry points
>> [6.693s][trace][continuations] saved fp
>> [6.693s][trace][continuations] 0x000000409e14cc68: 0x00000040137dc790 return address
>> [6.693s][trace][continuations] 0x000000409e14cc60: 0x000000409e14ccf0
>> [6.693s][trace][continuations] 0x000000409e14cc58: 0x000000409e14cc60 interpreter_frame_sender_sp
>> [6.693s][trace][continuations] 0x000000409e14cc50: 0x000000409e14cc00 interpreter_frame_last_sp (relativized: fp-14)
>> [6.693s][trace][continuations] 0x000000409e14cc48: 0x0000004050401a88 interpreter_frame_method
>> [6.693s][trace][continuations] 0x000000409e14cc40: 0x0000000000000000 interpreter_frame_mdp
>> [6.693s][trace][continuations] 0x000000409e14cc38: 0x000000409e14cbe0 interpreter_frame_extended_sp (relativized: fp-18)
>> [6.693s][trace][continuations] 0x000000409e14cc30: 0x00000000ef093110 interpreter_frame_mirror
>> [6.693s][trace][continuations] oop for #10
>> [6.693s][trace][continuations] 0x000000409e14cc28: 0x0000004050401c68 interpreter_frame_cache
>> [6.693s][trace][continuations] 0x000000409e14cc20: 0x000000409e14cc88 interpreter_frame_locals (relativized: fp+3)
>> [6.693s][trace][continuatio...
>
> Fredrik Bredberg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - Merge branch 'master' into 8314508_relativized_ptr_frame_describe
> - Small white space fix
> - 8314508: Improve how relativized pointers are printed by frame::describe
I don't know this code that well but I had a couple of questions.
src/hotspot/share/runtime/frame.cpp line 1634:
> 1632: st->print_cr(" %s %s %s", spacer, spacer, fv.description);
> 1633: } else {
> 1634: if (*fv.description == '#' && isdigit(fv.description[1])) {
Is it possible for fv.description to be null? its sort of unclear from the context. There are several pointer dereferences here.
Can you add a comment about what the format of this is? What is fv.description supposed to be? #<what number?>
And fp.location is the relativized offset, if fp.description is NOT #<number>?
This really does need some comment. And maybe a local variable to say what *fv.location is.
And after testing the #<some number> output, the code still has to see if fv.location is between -100 and 100? Should it not just check fp != nullptr ?
-------------
PR Review: https://git.openjdk.org/jdk/pull/18102#pullrequestreview-1923498105
PR Review Comment: https://git.openjdk.org/jdk/pull/18102#discussion_r1516797746
More information about the hotspot-dev
mailing list