changeset 12238:dbbfe9e68ad9

8166679: JNI AsyncGetCallTrace replaces topmost frame name with <no Java callstack recorded> starting with Java 9 b133 Summary: Partly undid the changes for 8159284, which are the cause of this CR. Reviewed-by: dholmes, coleenp, dcubed
author cjplummer
date Mon, 24 Oct 2016 14:12:32 -0700
parents a47416372bd6
children 0207c729b674
files src/cpu/aarch64/vm/frame_aarch64.cpp src/cpu/sparc/vm/frame_sparc.cpp src/cpu/x86/vm/frame_x86.cpp
diffstat 3 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/frame_aarch64.cpp	Mon Oct 24 11:48:30 2016 -0700
+++ b/src/cpu/aarch64/vm/frame_aarch64.cpp	Mon Oct 24 14:12:32 2016 -0700
@@ -204,8 +204,15 @@
       }
 
       // construct the potential sender
+
       frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
-      return sender.is_entry_frame_valid(thread);
+
+      // Validate the JavaCallWrapper an entry frame must have
+      address jcw = (address)sender.entry_frame_call_wrapper();
+
+      bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)sender.fp());
+
+      return jcw_safe;
     }
 
     CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
--- a/src/cpu/sparc/vm/frame_sparc.cpp	Mon Oct 24 11:48:30 2016 -0700
+++ b/src/cpu/sparc/vm/frame_sparc.cpp	Mon Oct 24 14:12:32 2016 -0700
@@ -279,7 +279,13 @@
     }
 
     if (sender.is_entry_frame()) {
-      return sender.is_entry_frame_valid(thread);
+      // Validate the JavaCallWrapper an entry frame must have
+
+      address jcw = (address)sender.entry_frame_call_wrapper();
+
+      bool jcw_safe = (jcw <= thread->stack_base()) && (jcw > sender_fp);
+
+      return jcw_safe;
     }
 
     // If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
--- a/src/cpu/x86/vm/frame_x86.cpp	Mon Oct 24 11:48:30 2016 -0700
+++ b/src/cpu/x86/vm/frame_x86.cpp	Mon Oct 24 14:12:32 2016 -0700
@@ -203,8 +203,15 @@
       }
 
       // construct the potential sender
+
       frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
-      return sender.is_entry_frame_valid(thread);
+
+      // Validate the JavaCallWrapper an entry frame must have
+      address jcw = (address)sender.entry_frame_call_wrapper();
+
+      bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)sender.fp());
+
+      return jcw_safe;
     }
 
     CompiledMethod* nm = sender_blob->as_compiled_method_or_null();