RFR: 8256843: [PPC64] runtime/logging/RedefineClasses.java fails with assert: registers not saved on stack
Richard Reingruber
rrich at openjdk.java.net
Mon Dec 14 14:16:55 UTC 2020
On Mon, 14 Dec 2020 13:43:28 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
> I was not aware of that __builtin_frame_address is available on all PPC64 platforms. Makes sense to use it and to get rid of the inline assembly.
Me neither. I found it in the implementation for x86_64 and learned that xlC supports it as well.
>
> > Currently I don't understand why the result of __builtin_frame_address(0) has to be dereferenced?
>
> I don't understand that, either. Seems like it was implemented by trial and error. I think trying to predict the C++ compiler's inlining is a terrible design, but it's only used by non-critical code like NMT stack traces, so we can focus on more critical issues.
>
> We could use __builtin_frame_address(1) and remove the dereferencing. I think we should use that also in os::current_stack_pointer(). What do you think?
According to the documentation (https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html) this is not really safe.
Calling this function with a nonzero argument can have unpredictable effects, including crashing the calling program
So I wouldn't do it.
We could still use it in os::current_stack_pointer() _and_ in os::current_frame().
>
> Anyway, I like your proposal. Would you mind creating a PR for jdk16 as we need it there? I'm closing this one.
That's fine for me.
Thanks, Richard.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1724
More information about the hotspot-dev
mailing list