changeset 6273:8d65cf10c446

8039348: -XX:+TraceDeoptimization -XX:+Verbose -Xcomp can crash VM Reviewed-by: kvn, sla
author mgronlun
date Tue, 08 Apr 2014 11:50:01 +0200
parents 2ae98255c689
children b60835354c41
files src/share/vm/classfile/javaClasses.cpp
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/javaClasses.cpp	Tue Apr 08 08:14:14 2014 +0200
+++ b/src/share/vm/classfile/javaClasses.cpp	Tue Apr 08 11:50:01 2014 +0200
@@ -464,21 +464,22 @@
 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) {
     // This can happen if, e.g., printing a String
     // object before its initializer has been called
-    st->print_cr("NULL");
-  } else {
-    st->print("\"");
-    for (int index = 0; index < length; index++) {
-      st->print("%c", value->char_at(index + offset));
-    }
-    st->print("\"");
+    st->print("NULL");
+    return;
   }
+
+  int offset = java_lang_String::offset(java_string);
+  int length = java_lang_String::length(java_string);
+
+  st->print("\"");
+  for (int index = 0; index < length; index++) {
+    st->print("%c", value->char_at(index + offset));
+  }
+  st->print("\"");
 }
 
 static void initialize_static_field(fieldDescriptor* fd, TRAPS) {