Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/symbolOop.cpp @ 222:2a1a77d3458f
6718676: putback for 6604014 is incomplete
Reviewed-by: kvn, jrose
author | never |
---|---|
date | Tue, 24 Jun 2008 16:00:14 -0700 |
parents | a61af66fc99e |
children | dd57230ba8fe |
comparison
equal
deleted
inserted
replaced
221:1e026f8da827 | 222:2a1a77d3458f |
---|---|
66 return as_C_string(str, buf_len); | 66 return as_C_string(str, buf_len); |
67 } | 67 } |
68 | 68 |
69 void symbolOopDesc::print_symbol_on(outputStream* st) { | 69 void symbolOopDesc::print_symbol_on(outputStream* st) { |
70 st = st ? st : tty; | 70 st = st ? st : tty; |
71 for (int index = 0; index < utf8_length(); index++) | 71 int length = UTF8::unicode_length((const char*)bytes(), utf8_length()); |
72 st->put((char)byte_at(index)); | 72 const char *ptr = (const char *)bytes(); |
73 jchar value; | |
74 for (int index = 0; index < length; index++) { | |
75 ptr = UTF8::next(ptr, &value); | |
76 if (value >= 32 && value < 127 || value == '\'' || value == '\\') { | |
77 st->put(value); | |
78 } else { | |
79 st->print("\\u%04x", value); | |
80 } | |
81 } | |
73 } | 82 } |
74 | 83 |
75 jchar* symbolOopDesc::as_unicode(int& length) const { | 84 jchar* symbolOopDesc::as_unicode(int& length) const { |
76 symbolOopDesc* this_ptr = (symbolOopDesc*)this; | 85 symbolOopDesc* this_ptr = (symbolOopDesc*)this; |
77 length = UTF8::unicode_length((char*)this_ptr->bytes(), utf8_length()); | 86 length = UTF8::unicode_length((char*)this_ptr->bytes(), utf8_length()); |