8163011: AArch64: NMT detail stack trace cleanup
Summary: Makes aarch64 behavior similar to x86 one
Reviewed-by: aph, drwhite
--- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp Mon Nov 06 04:14:22 2017 -0800
+++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp Mon Nov 06 14:31:22 2017 +0000
@@ -233,8 +233,17 @@
}
intptr_t* _get_previous_fp() {
- register intptr_t **ebp __asm__ (SPELL_REG_FP);
- return (intptr_t*) *ebp; // we want what it points to.
+ register intptr_t **fp __asm__ (SPELL_REG_FP);
+
+ // fp is for this frame (_get_previous_fp). We want the fp for the
+ // caller of os::current_frame*(), so go up two frames. However, for
+ // optimized builds, _get_previous_fp() will be inlined, so only go
+ // up 1 frame in that case.
+ #ifdef _NMT_NOINLINE_
+ return **(intptr_t***)fp;
+ #else
+ return *fp;
+ #endif
}