8163011: AArch64: NMT detail stack trace cleanup
authordsamersoff
Mon, 06 Nov 2017 14:31:22 +0000
changeset 47788 12c0996f50f4
parent 47787 11b8ac93804c
child 47792 2a5b7592ca11
8163011: AArch64: NMT detail stack trace cleanup Summary: Makes aarch64 behavior similar to x86 one Reviewed-by: aph, drwhite
src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
--- 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
 }