changeset 47690:12c0996f50f4

8163011: AArch64: NMT detail stack trace cleanup Summary: Makes aarch64 behavior similar to x86 one Reviewed-by: aph, drwhite
author dsamersoff
date Mon, 06 Nov 2017 14:31:22 +0000
parents 11b8ac93804c
children 2a5b7592ca11
files src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
 }