181 // the same as String.hashCode or an alternate hash code.
182 static unsigned int hash_string(oop java_string);
183
184 static bool equals(oop java_string, jchar* chars, int len);
185 static bool equals(oop str1, oop str2);
186
187 // Conversion between '.' and '/' formats
188 static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
189 static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
190
191 // Conversion
192 static Symbol* as_symbol(Handle java_string, TRAPS);
193 static Symbol* as_symbol_or_null(oop java_string);
194
195 // Testers
196 static bool is_instance(oop obj) {
197 return obj != NULL && obj->klass() == SystemDictionary::String_klass();
198 }
199
200 // Debugging
201 static void print(Handle java_string, outputStream* st);
202 friend class JavaClasses;
203 };
204
205
206 // Interface to java.lang.Class objects
207
208 #define CLASS_INJECTED_FIELDS(macro) \
209 macro(java_lang_Class, klass, intptr_signature, false) \
210 macro(java_lang_Class, array_klass, intptr_signature, false) \
211 macro(java_lang_Class, oop_size, int_signature, false) \
212 macro(java_lang_Class, static_oop_field_count, int_signature, false) \
213 macro(java_lang_Class, protection_domain, object_signature, false) \
214 macro(java_lang_Class, init_lock, object_signature, false) \
215 macro(java_lang_Class, signers, object_signature, false)
216
217 class java_lang_Class : AllStatic {
218 friend class VMStructs;
219
220 private:
221 // The fake offsets are added by the class loader when java.lang.Class is loaded
|
181 // the same as String.hashCode or an alternate hash code.
182 static unsigned int hash_string(oop java_string);
183
184 static bool equals(oop java_string, jchar* chars, int len);
185 static bool equals(oop str1, oop str2);
186
187 // Conversion between '.' and '/' formats
188 static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
189 static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
190
191 // Conversion
192 static Symbol* as_symbol(Handle java_string, TRAPS);
193 static Symbol* as_symbol_or_null(oop java_string);
194
195 // Testers
196 static bool is_instance(oop obj) {
197 return obj != NULL && obj->klass() == SystemDictionary::String_klass();
198 }
199
200 // Debugging
201 static void print(oop java_string, outputStream* st);
202 friend class JavaClasses;
203 };
204
205
206 // Interface to java.lang.Class objects
207
208 #define CLASS_INJECTED_FIELDS(macro) \
209 macro(java_lang_Class, klass, intptr_signature, false) \
210 macro(java_lang_Class, array_klass, intptr_signature, false) \
211 macro(java_lang_Class, oop_size, int_signature, false) \
212 macro(java_lang_Class, static_oop_field_count, int_signature, false) \
213 macro(java_lang_Class, protection_domain, object_signature, false) \
214 macro(java_lang_Class, init_lock, object_signature, false) \
215 macro(java_lang_Class, signers, object_signature, false)
216
217 class java_lang_Class : AllStatic {
218 friend class VMStructs;
219
220 private:
221 // The fake offsets are added by the class loader when java.lang.Class is loaded
|