Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Runtime1.cpp @ 5595:ea9ac81f5645
limit log output to handle case where String object is invalid
removed false assertion about graal_log* stubs not needing oop maps
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 14 Jun 2012 12:06:44 +0200 |
parents | 69358a2182a3 |
children | 7d25723b7699 |
comparison
equal
deleted
inserted
replaced
5594:9b85ab3d3ab7 | 5595:ea9ac81f5645 |
---|---|
210 case graal_unwind_exception_call_id: | 210 case graal_unwind_exception_call_id: |
211 case graal_slow_subtype_check_id: | 211 case graal_slow_subtype_check_id: |
212 case graal_arithmetic_frem_id: | 212 case graal_arithmetic_frem_id: |
213 case graal_arithmetic_drem_id: | 213 case graal_arithmetic_drem_id: |
214 case graal_set_deopt_info_id: | 214 case graal_set_deopt_info_id: |
215 case graal_log_primitive_id: | |
216 case graal_log_object_id: | |
217 #endif | 215 #endif |
218 break; | 216 break; |
219 | 217 |
220 // All other stubs should have oopmaps | 218 // All other stubs should have oopmaps |
221 default: | 219 default: |
749 typeArrayOop value = java_lang_String::value(obj); | 747 typeArrayOop value = java_lang_String::value(obj); |
750 int offset = java_lang_String::offset(obj); | 748 int offset = java_lang_String::offset(obj); |
751 int length = java_lang_String::length(obj); | 749 int length = java_lang_String::length(obj); |
752 | 750 |
753 if (length != 0) { | 751 if (length != 0) { |
752 int printLength = MIN2(length, 1024); | |
754 if (value == NULL) { | 753 if (value == NULL) { |
755 // This can happen if, e.g., printing a String | 754 // This can happen if, e.g., printing a String |
756 // object before its initializer has been called | 755 // object before its initializer has been called |
757 tty->print("null"); | 756 tty->print("null"); |
758 } else if (length < 256 - 1) { | 757 } else if (printLength < 256 - 1) { |
759 // Use an intermediate buffer to try and prevent interlacing of multi-threaded output | 758 // Use an intermediate buffer to try and prevent interlacing of multi-threaded output |
760 char buf[256]; | 759 char buf[256]; |
761 for (int index = 0; index < length; index++) { | 760 for (int index = 0; index < printLength; index++) { |
762 buf[index] = value->char_at(index + offset); | 761 buf[index] = value->char_at(index + offset); |
763 } | 762 } |
764 buf[length] = 0; | 763 buf[printLength] = 0; |
765 tty->print("%s", buf); | 764 tty->print("%s", buf); |
765 if (printLength < length) { | |
766 tty->print("... (%d more)", length - printLength); | |
767 } | |
766 } else { | 768 } else { |
767 for (int index = 0; index < length; index++) { | 769 for (int index = 0; index < printLength; index++) { |
768 tty->print("%c", value->char_at(index + offset)); | 770 tty->print("%c", value->char_at(index + offset)); |
771 } | |
772 if (printLength < length) { | |
773 tty->print("... (%d more)", length - printLength); | |
769 } | 774 } |
770 } | 775 } |
771 } | 776 } |
772 } | 777 } |
773 if (newline) { | 778 if (newline) { |