Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
8256843: [PPC64] runtime/logging/RedefineClasses.java fails with asse…
Browse files Browse the repository at this point in the history
…rt: registers not saved on stack

Reviewed-by: mdoerr, lucy
  • Loading branch information
reinrich committed Dec 18, 2020
1 parent 45a150b commit 1ce2e94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
21 changes: 4 additions & 17 deletions src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Expand Up @@ -65,16 +65,7 @@
# include <ucontext.h>

address os::current_stack_pointer() {
address csp;

#if !defined(USE_XLC_BUILTINS)
// inline assembly for `mr regno(csp), R1_SP':
__asm__ __volatile__ ("mr %0, 1":"=r"(csp):);
#else
csp = (address) __builtin_frame_address(0);
#endif

return csp;
return (address)__builtin_frame_address(0);
}

char* os::non_memory_address_word() {
Expand Down Expand Up @@ -159,13 +150,9 @@ frame os::get_sender_for_C_frame(frame* fr) {


frame os::current_frame() {
intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
// hack.
frame topframe(csp, (address)0x8);
// Return sender of sender of current topframe which hopefully
// both have pc != NULL.
frame tmp = os::get_sender_for_C_frame(&topframe);
return os::get_sender_for_C_frame(&tmp);
intptr_t* csp = *(intptr_t**) __builtin_frame_address(0);
frame topframe(csp, CAST_FROM_FN_PTR(address, os::current_frame));
return os::get_sender_for_C_frame(&topframe);
}

bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
Expand Down
17 changes: 4 additions & 13 deletions src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Expand Up @@ -78,12 +78,7 @@


address os::current_stack_pointer() {
intptr_t* csp;

// inline assembly `mr regno(csp), R1_SP':
__asm__ __volatile__ ("mr %0, 1":"=r"(csp):);

return (address) csp;
return (address)__builtin_frame_address(0);
}

char* os::non_memory_address_word() {
Expand Down Expand Up @@ -179,13 +174,9 @@ frame os::get_sender_for_C_frame(frame* fr) {


frame os::current_frame() {
intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
// hack.
frame topframe(csp, (address)0x8);
// Return sender of sender of current topframe which hopefully
// both have pc != NULL.
frame tmp = os::get_sender_for_C_frame(&topframe);
return os::get_sender_for_C_frame(&tmp);
intptr_t* csp = *(intptr_t**) __builtin_frame_address(0);
frame topframe(csp, CAST_FROM_FN_PTR(address, os::current_frame));
return os::get_sender_for_C_frame(&topframe);
}

bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/utilities/nativeCallStack.cpp
Expand Up @@ -36,7 +36,7 @@ NativeCallStack::NativeCallStack(int toSkip, bool fillStack) :
// to call os::get_native_stack. A tail call is used if _NMT_NOINLINE_ is not defined
// (which means this is not a slowdebug build), and we are on 64-bit (except Windows).
// This is not necessarily a rule, but what has been obvserved to date.
#if (defined(_NMT_NOINLINE_) || defined(_WINDOWS) || !defined(_LP64))
#if (defined(_NMT_NOINLINE_) || defined(_WINDOWS) || !defined(_LP64) || defined(PPC64))
// Not a tail call.
toSkip++;
#if (defined(_NMT_NOINLINE_) && defined(BSD) && defined(_LP64))
Expand Down

1 comment on commit 1ce2e94

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.