comparison hotspot/src/share/vm/utilities/utf8.hpp @ 46545:b970b6e40209

8181450: assert in BasicHashtable::verify_table Summary: remove assert as it has small probability of happening and added logging Reviewed-by: kbarrett, sspitsyn
author coleenp
date Fri, 16 Jun 2017 09:13:56 -0400
parents 287c4ebd11b0
children
comparison
equal deleted inserted replaced
9:288d991424fc 10:8aa1441f6e2b
95 // returns the utf8 size of a unicode character 95 // returns the utf8 size of a unicode character
96 static int utf8_size(jchar c); 96 static int utf8_size(jchar c);
97 static int utf8_size(jbyte c); 97 static int utf8_size(jbyte c);
98 98
99 // returns the utf8 length of a unicode string 99 // returns the utf8 length of a unicode string
100 static int utf8_length(jchar* base, int length); 100 template<typename T> static int utf8_length(T* base, int length);
101 static int utf8_length(jbyte* base, int length);
102 101
103 // converts a unicode string to utf8 string 102 // converts a unicode string to utf8 string
104 static void convert_to_utf8(const jchar* base, int length, char* utf8_buffer); 103 static void convert_to_utf8(const jchar* base, int length, char* utf8_buffer);
105 104
106 // converts a unicode string to a utf8 string; result is allocated 105 // converts a unicode string to a utf8 string; result is allocated
107 // in resource area unless a buffer is provided. 106 // in resource area unless a buffer is provided. The unicode 'length'
108 static char* as_utf8(jchar* base, int length); 107 // parameter is set to the length of the result utf8 string.
109 static char* as_utf8(jbyte* base, int length); 108 template<typename T> static char* as_utf8(T* base, int& length);
110 static char* as_utf8(jchar* base, int length, char* buf, int buflen); 109 static char* as_utf8(jchar* base, int length, char* buf, int buflen);
111 static char* as_utf8(jbyte* base, int length, char* buf, int buflen); 110 static char* as_utf8(jbyte* base, int length, char* buf, int buflen);
112 111
113 // returns the quoted ascii length of a unicode string 112 // returns the quoted ascii length of a unicode string
114 template<typename T> static int quoted_ascii_length(T* base, int length); 113 template<typename T> static int quoted_ascii_length(T* base, int length);