changeset 12444:b917f4db4bf6

Update stack traces with slash-based syntax
author mchung
date Mon, 12 Sep 2016 15:08:51 -0700
parents 1b3760ecfc24
children 22696cfa121b
files src/share/vm/classfile/javaClasses.cpp src/share/vm/classfile/javaClasses.hpp
diffstat 2 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/javaClasses.cpp	Mon Sep 12 04:04:55 2016 +0100
+++ b/src/share/vm/classfile/javaClasses.cpp	Mon Sep 12 15:08:51 2016 -0700
@@ -2142,9 +2142,11 @@
 
   // Fill in class name
   ResourceMark rm(THREAD);
+
   const char* str = holder->external_name();
   oop classname = StringTable::intern((char*) str, CHECK);
   java_lang_StackTraceElement::set_declaringClass(element(), classname);
+  java_lang_StackTraceElement::set_declaringClassObject(element(), holder->java_mirror());
 
   oop loader = holder->class_loader();
   if (loader != NULL) {
@@ -3642,13 +3644,14 @@
 int java_lang_System::static_out_offset;
 int java_lang_System::static_err_offset;
 int java_lang_System::static_security_offset;
-int java_lang_StackTraceElement::declaringClass_offset;
 int java_lang_StackTraceElement::methodName_offset;
 int java_lang_StackTraceElement::fileName_offset;
 int java_lang_StackTraceElement::lineNumber_offset;
 int java_lang_StackTraceElement::moduleName_offset;
 int java_lang_StackTraceElement::moduleVersion_offset;
 int java_lang_StackTraceElement::classLoaderName_offset;
+int java_lang_StackTraceElement::declaringClass_offset;
+int java_lang_StackTraceElement::declaringClassObject_offset;
 int java_lang_StackFrameInfo::_declaringClass_offset;
 int java_lang_StackFrameInfo::_memberName_offset;
 int java_lang_StackFrameInfo::_bci_offset;
@@ -3697,6 +3700,10 @@
   element->obj_field_put(classLoaderName_offset, value);
 }
 
+void java_lang_StackTraceElement::set_declaringClassObject(oop element, oop value) {
+  element->obj_field_put(declaringClassObject_offset, value);
+}
+
 // Support for java_lang_StackFrameInfo
 void java_lang_StackFrameInfo::set_declaringClass(oop element, oop value) {
   element->obj_field_put(_declaringClass_offset, value);
@@ -3814,9 +3821,10 @@
   java_lang_System::static_security_offset = java_lang_System::hc_static_security_offset * x;
 
   // java_lang_StackTraceElement
+  java_lang_StackTraceElement::declaringClassObject_offset = java_lang_StackTraceElement::hc_declaringClassObject_offset * x + header;
+  java_lang_StackTraceElement::classLoaderName_offset = java_lang_StackTraceElement::hc_classLoaderName_offset * x + header;
   java_lang_StackTraceElement::moduleName_offset = java_lang_StackTraceElement::hc_moduleName_offset * x + header;
   java_lang_StackTraceElement::moduleVersion_offset = java_lang_StackTraceElement::hc_moduleVersion_offset * x + header;
-  java_lang_StackTraceElement::classLoaderName_offset = java_lang_StackTraceElement::hc_classLoaderName_offset * x + header;
   java_lang_StackTraceElement::declaringClass_offset = java_lang_StackTraceElement::hc_declaringClass_offset  * x + header;
   java_lang_StackTraceElement::methodName_offset = java_lang_StackTraceElement::hc_methodName_offset * x + header;
   java_lang_StackTraceElement::fileName_offset   = java_lang_StackTraceElement::hc_fileName_offset   * x + header;
--- a/src/share/vm/classfile/javaClasses.hpp	Mon Sep 12 04:04:55 2016 +0100
+++ b/src/share/vm/classfile/javaClasses.hpp	Mon Sep 12 15:08:51 2016 -0700
@@ -1305,15 +1305,17 @@
 class java_lang_StackTraceElement: AllStatic {
  private:
   enum {
-    hc_moduleName_offset = 0,
-    hc_moduleVersion_offset = 1,
-    hc_classLoaderName_offset = 2,
-    hc_declaringClass_offset = 3,
-    hc_methodName_offset = 4,
-    hc_fileName_offset   = 5,
-    hc_lineNumber_offset = 6
+    hc_declaringClassObject_offset = 0,
+    hc_classLoaderName_offset      = 1,
+    hc_moduleName_offset           = 2,
+    hc_moduleVersion_offset        = 3,
+    hc_declaringClass_offset       = 4,
+    hc_methodName_offset           = 5,
+    hc_fileName_offset             = 6,
+    hc_lineNumber_offset           = 7
   };
 
+  static int declaringClassObject_offset;
   static int moduleName_offset;
   static int moduleVersion_offset;
   static int classLoaderName_offset;
@@ -1323,9 +1325,10 @@
   static int lineNumber_offset;
 
   // Setters
+  static void set_declaringClassObject(oop element, oop value);
+  static void set_classLoaderName(oop element, oop value);
   static void set_moduleName(oop element, oop value);
   static void set_moduleVersion(oop element, oop value);
-  static void set_classLoaderName(oop element, oop value);
   static void set_declaringClass(oop element, oop value);
   static void set_methodName(oop element, oop value);
   static void set_fileName(oop element, oop value);