177 while (len-- > 0) {
178 h = 31*h + (unsigned int) *s;
179 s++;
180 }
181 return h;
182 }
183
184 static unsigned int hash_code(const jbyte* s, int len) {
185 unsigned int h = 0;
186 while (len-- > 0) {
187 h = 31*h + (((unsigned int) *s) & 0xFF);
188 s++;
189 }
190 return h;
191 }
192
193 static unsigned int hash_code(oop java_string);
194
195 static bool equals(oop java_string, const jchar* chars, int len);
196 static bool equals(oop str1, oop str2);
197
198 // Conversion between '.' and '/' formats
199 static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
200 static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
201
202 // Conversion
203 static Symbol* as_symbol(oop java_string, TRAPS);
204 static Symbol* as_symbol_or_null(oop java_string);
205
206 // Testers
207 static bool is_instance(oop obj);
208 static inline bool is_instance_inlined(oop obj);
209
210 // Debugging
211 static void print(oop java_string, outputStream* st);
212 friend class JavaClasses;
213 friend class StringTable;
214 };
215
216
|
177 while (len-- > 0) {
178 h = 31*h + (unsigned int) *s;
179 s++;
180 }
181 return h;
182 }
183
184 static unsigned int hash_code(const jbyte* s, int len) {
185 unsigned int h = 0;
186 while (len-- > 0) {
187 h = 31*h + (((unsigned int) *s) & 0xFF);
188 s++;
189 }
190 return h;
191 }
192
193 static unsigned int hash_code(oop java_string);
194
195 static bool equals(oop java_string, const jchar* chars, int len);
196 static bool equals(oop str1, oop str2);
197 static inline bool values_equal(typeArrayOop str_value1, typeArrayOop str_value2);
198
199 // Conversion between '.' and '/' formats
200 static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
201 static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
202
203 // Conversion
204 static Symbol* as_symbol(oop java_string, TRAPS);
205 static Symbol* as_symbol_or_null(oop java_string);
206
207 // Testers
208 static bool is_instance(oop obj);
209 static inline bool is_instance_inlined(oop obj);
210
211 // Debugging
212 static void print(oop java_string, outputStream* st);
213 friend class JavaClasses;
214 friend class StringTable;
215 };
216
217
|