comparison src/share/vm/oops/symbol.cpp @ 6972:bd7a7ce2e264

6830717: replay of compilations would help with debugging Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method. Reviewed-by: kvn, twisti, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 12 Nov 2012 14:03:53 -0800
parents da91efe96a93
children fcc9e7681d63
comparison
equal deleted inserted replaced
6965:3be318ecfae5 6972:bd7a7ce2e264
151 return as_C_string(str, buf_len); 151 return as_C_string(str, buf_len);
152 } 152 }
153 153
154 void Symbol::print_symbol_on(outputStream* st) const { 154 void Symbol::print_symbol_on(outputStream* st) const {
155 st = st ? st : tty; 155 st = st ? st : tty;
156 int length = UTF8::unicode_length((const char*)bytes(), utf8_length()); 156 st->print("%s", as_quoted_ascii());
157 const char *ptr = (const char *)bytes(); 157 }
158 jchar value; 158
159 for (int index = 0; index < length; index++) { 159 char* Symbol::as_quoted_ascii() const {
160 ptr = UTF8::next(ptr, &value); 160 const char *ptr = (const char *)&_body[0];
161 if (value >= 32 && value < 127 || value == '\'' || value == '\\') { 161 int quoted_length = UTF8::quoted_ascii_length(ptr, utf8_length());
162 st->put(value); 162 char* result = NEW_RESOURCE_ARRAY(char, quoted_length + 1);
163 } else { 163 UTF8::as_quoted_ascii(ptr, result, quoted_length + 1);
164 st->print("\\u%04x", value); 164 return result;
165 }
166 }
167 } 165 }
168 166
169 jchar* Symbol::as_unicode(int& length) const { 167 jchar* Symbol::as_unicode(int& length) const {
170 Symbol* this_ptr = (Symbol*)this; 168 Symbol* this_ptr = (Symbol*)this;
171 length = UTF8::unicode_length((char*)this_ptr->bytes(), utf8_length()); 169 length = UTF8::unicode_length((char*)this_ptr->bytes(), utf8_length());