8035648: Don't use Handle in java_lang_String::print
authorstefank
Thu, 27 Feb 2014 10:34:55 +0100
changeset 22907 f978a4a64728
parent 22906 528490ea7e82
child 22908 8c4f06f6ea15
8035648: Don't use Handle in java_lang_String::print Reviewed-by: coleenp, pliden
hotspot/src/share/vm/classfile/javaClasses.cpp
hotspot/src/share/vm/classfile/javaClasses.hpp
hotspot/src/share/vm/oops/instanceKlass.cpp
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Feb 26 14:52:42 2014 +0100
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu Feb 27 10:34:55 2014 +0100
@@ -461,12 +461,11 @@
   return true;
 }
 
-void java_lang_String::print(Handle java_string, outputStream* st) {
-  oop          obj    = java_string();
-  assert(obj->klass() == SystemDictionary::String_klass(), "must be java_string");
-  typeArrayOop value  = java_lang_String::value(obj);
-  int          offset = java_lang_String::offset(obj);
-  int          length = java_lang_String::length(obj);
+void java_lang_String::print(oop java_string, outputStream* st) {
+  assert(java_string->klass() == SystemDictionary::String_klass(), "must be java_string");
+  typeArrayOop value  = java_lang_String::value(java_string);
+  int          offset = java_lang_String::offset(java_string);
+  int          length = java_lang_String::length(java_string);
 
   int end = MIN2(length, 100);
   if (value == NULL) {
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Wed Feb 26 14:52:42 2014 +0100
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Thu Feb 27 10:34:55 2014 +0100
@@ -198,7 +198,7 @@
   }
 
   // Debugging
-  static void print(Handle java_string, outputStream* st);
+  static void print(oop java_string, outputStream* st);
   friend class JavaClasses;
 };
 
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Feb 26 14:52:42 2014 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Thu Feb 27 10:34:55 2014 +0100
@@ -2987,8 +2987,7 @@
         offset          <= (juint) value->length() &&
         offset + length <= (juint) value->length()) {
       st->print(BULLET"string: ");
-      Handle h_obj(obj);
-      java_lang_String::print(h_obj, st);
+      java_lang_String::print(obj, st);
       st->cr();
       if (!WizardMode)  return;  // that is enough
     }