changeset 6045:301df27023d4

8035648: Don't use Handle in java_lang_String::print Reviewed-by: coleenp, pliden
author stefank
date Thu, 27 Feb 2014 10:34:55 +0100
parents 3f406218c511
children 7f0e0366ec81
files src/share/vm/classfile/javaClasses.cpp src/share/vm/classfile/javaClasses.hpp src/share/vm/oops/instanceKlass.cpp
diffstat 3 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/javaClasses.cpp	Wed Feb 26 14:52:42 2014 +0100
+++ b/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/src/share/vm/classfile/javaClasses.hpp	Wed Feb 26 14:52:42 2014 +0100
+++ b/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/src/share/vm/oops/instanceKlass.cpp	Wed Feb 26 14:52:42 2014 +0100
+++ b/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
     }