204 |
204 |
205 // Interface to java.lang.Class objects |
205 // Interface to java.lang.Class objects |
206 |
206 |
207 #define CLASS_INJECTED_FIELDS(macro) \ |
207 #define CLASS_INJECTED_FIELDS(macro) \ |
208 macro(java_lang_Class, klass, intptr_signature, false) \ |
208 macro(java_lang_Class, klass, intptr_signature, false) \ |
209 macro(java_lang_Class, resolved_constructor, intptr_signature, false) \ |
|
210 macro(java_lang_Class, array_klass, intptr_signature, false) \ |
209 macro(java_lang_Class, array_klass, intptr_signature, false) \ |
211 macro(java_lang_Class, oop_size, int_signature, false) \ |
210 macro(java_lang_Class, oop_size, int_signature, false) \ |
212 macro(java_lang_Class, static_oop_field_count, int_signature, false) |
211 macro(java_lang_Class, static_oop_field_count, int_signature, false) |
213 |
212 |
214 class java_lang_Class : AllStatic { |
213 class java_lang_Class : AllStatic { |
216 |
215 |
217 private: |
216 private: |
218 // The fake offsets are added by the class loader when java.lang.Class is loaded |
217 // The fake offsets are added by the class loader when java.lang.Class is loaded |
219 |
218 |
220 static int _klass_offset; |
219 static int _klass_offset; |
221 static int _resolved_constructor_offset; |
|
222 static int _array_klass_offset; |
220 static int _array_klass_offset; |
223 |
221 |
224 static int _oop_size_offset; |
222 static int _oop_size_offset; |
225 static int _static_oop_field_count_offset; |
223 static int _static_oop_field_count_offset; |
226 |
224 |
252 return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); |
250 return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); |
253 } |
251 } |
254 static bool is_primitive(oop java_class); |
252 static bool is_primitive(oop java_class); |
255 static BasicType primitive_type(oop java_class); |
253 static BasicType primitive_type(oop java_class); |
256 static oop primitive_mirror(BasicType t); |
254 static oop primitive_mirror(BasicType t); |
257 // JVM_NewInstance support |
|
258 static Method* resolved_constructor(oop java_class); |
|
259 static void set_resolved_constructor(oop java_class, Method* constructor); |
|
260 // JVM_NewArray support |
255 // JVM_NewArray support |
261 static Klass* array_klass(oop java_class); |
256 static Klass* array_klass(oop java_class); |
262 static void set_array_klass(oop java_class, Klass* klass); |
257 static void set_array_klass(oop java_class, Klass* klass); |
263 // compiler support for class operations |
258 // compiler support for class operations |
264 static int klass_offset_in_bytes() { return _klass_offset; } |
259 static int klass_offset_in_bytes() { return _klass_offset; } |
265 static int resolved_constructor_offset_in_bytes() { return _resolved_constructor_offset; } |
|
266 static int array_klass_offset_in_bytes() { return _array_klass_offset; } |
260 static int array_klass_offset_in_bytes() { return _array_klass_offset; } |
267 // Support for classRedefinedCount field |
261 // Support for classRedefinedCount field |
268 static int classRedefinedCount(oop the_class_mirror); |
262 static int classRedefinedCount(oop the_class_mirror); |
269 static void set_classRedefinedCount(oop the_class_mirror, int value); |
263 static void set_classRedefinedCount(oop the_class_mirror, int value); |
270 |
264 |