changeset 12446:8b9a67a9fdb6

Deserialized StackTraceElement::toString should print the compacted representation
author mchung
date Wed, 14 Sep 2016 14:30:39 -0700
parents 22696cfa121b
children de2b914558cd
files src/share/vm/classfile/javaClasses.cpp src/share/vm/classfile/javaClasses.hpp
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/javaClasses.cpp	Wed Sep 14 04:38:38 2016 +0100
+++ b/src/share/vm/classfile/javaClasses.cpp	Wed Sep 14 14:30:39 2016 -0700
@@ -3651,7 +3651,7 @@
 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_StackTraceElement::classOrLoaderModuleClassName_offset;
 int java_lang_StackFrameInfo::_declaringClass_offset;
 int java_lang_StackFrameInfo::_memberName_offset;
 int java_lang_StackFrameInfo::_bci_offset;
@@ -3701,7 +3701,7 @@
 }
 
 void java_lang_StackTraceElement::set_declaringClassObject(oop element, oop value) {
-  element->obj_field_put(declaringClassObject_offset, value);
+  element->obj_field_put(classOrLoaderModuleClassName_offset, value);
 }
 
 // Support for java_lang_StackFrameInfo
@@ -3821,7 +3821,7 @@
   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::classOrLoaderModuleClassName_offset= java_lang_StackTraceElement::hc_classOrLoaderModuleClassName_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;
@@ -4024,10 +4024,14 @@
 
   // java.lang.StackTraceElement
 
-  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, declaringClass, "Ljava/lang/String;");
-  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, methodName, "Ljava/lang/String;");
-  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement,   fileName, "Ljava/lang/String;");
-  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, lineNumber, "I");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, classOrLoaderModuleClassName, "Ljava/lang/Object;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, classLoaderName, "Ljava/lang/String;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, moduleName,      "Ljava/lang/String;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, moduleVersion,   "Ljava/lang/String;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, declaringClass,  "Ljava/lang/String;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, methodName,      "Ljava/lang/String;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, fileName,        "Ljava/lang/String;");
+  CHECK_OFFSET("java/lang/StackTraceElement", java_lang_StackTraceElement, lineNumber,      "I");
 
   // java.lang.ref.Reference
 
--- a/src/share/vm/classfile/javaClasses.hpp	Wed Sep 14 04:38:38 2016 +0100
+++ b/src/share/vm/classfile/javaClasses.hpp	Wed Sep 14 14:30:39 2016 -0700
@@ -1305,7 +1305,7 @@
 class java_lang_StackTraceElement: AllStatic {
  private:
   enum {
-    hc_declaringClassObject_offset = 0,
+    hc_classOrLoaderModuleClassName_offset = 0,
     hc_classLoaderName_offset      = 1,
     hc_moduleName_offset           = 2,
     hc_moduleVersion_offset        = 3,
@@ -1315,17 +1315,16 @@
     hc_lineNumber_offset           = 7
   };
 
-  static int declaringClassObject_offset;
+  static int classOrLoaderModuleClassName_offset;
+  static int classLoaderName_offset;
   static int moduleName_offset;
   static int moduleVersion_offset;
-  static int classLoaderName_offset;
   static int declaringClass_offset;
   static int methodName_offset;
   static int fileName_offset;
   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);
@@ -1333,6 +1332,7 @@
   static void set_methodName(oop element, oop value);
   static void set_fileName(oop element, oop value);
   static void set_lineNumber(oop element, int value);
+  static void set_declaringClassObject(oop element, oop value);
 
  public:
   // Create an instance of StackTraceElement