202
203 // Testers
204 static bool is_instance(oop obj);
205 static inline bool is_instance_inlined(oop obj);
206
207 // Debugging
208 static void print(oop java_string, outputStream* st);
209 friend class JavaClasses;
210 friend class StringTable;
211 };
212
213
214 // Interface to java.lang.Class objects
215
216 #define CLASS_INJECTED_FIELDS(macro) \
217 macro(java_lang_Class, klass, intptr_signature, false) \
218 macro(java_lang_Class, array_klass, intptr_signature, false) \
219 macro(java_lang_Class, oop_size, int_signature, false) \
220 macro(java_lang_Class, static_oop_field_count, int_signature, false) \
221 macro(java_lang_Class, protection_domain, object_signature, false) \
222 macro(java_lang_Class, signers, object_signature, false)
223
224 class java_lang_Class : AllStatic {
225 friend class VMStructs;
226 friend class JVMCIVMStructs;
227
228 private:
229 // The fake offsets are added by the class loader when java.lang.Class is loaded
230
231 static int _klass_offset;
232 static int _array_klass_offset;
233
234 static int _oop_size_offset;
235 static int _static_oop_field_count_offset;
236
237 static int _protection_domain_offset;
238 static int _init_lock_offset;
239 static int _signers_offset;
240 static int _class_loader_offset;
241 static int _module_offset;
242 static int _component_mirror_offset;
243 static int _name_offset;
244
245 static bool offsets_computed;
246 static int classRedefinedCount_offset;
247
248 static GrowableArray<Klass*>* _fixup_mirror_list;
249 static GrowableArray<Klass*>* _fixup_module_field_list;
250
251 static void set_init_lock(oop java_class, oop init_lock);
252 static void set_protection_domain(oop java_class, oop protection_domain);
253 static void set_class_loader(oop java_class, oop class_loader);
254 static void set_component_mirror(oop java_class, oop comp_mirror);
255 static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain, TRAPS);
256 static void set_mirror_module_field(Klass* K, Handle mirror, Handle module, TRAPS);
257 public:
258 static void allocate_fixup_lists();
259 static void compute_offsets();
260
261 // Instance creation
262 static void create_mirror(Klass* k, Handle class_loader, Handle module,
263 Handle protection_domain, TRAPS);
295 static void release_set_array_klass(oop java_class, Klass* klass);
296 // compiler support for class operations
297 static int klass_offset_in_bytes() { return _klass_offset; }
298 static int array_klass_offset_in_bytes() { return _array_klass_offset; }
299 // Support for classRedefinedCount field
300 static int classRedefinedCount(oop the_class_mirror);
301 static void set_classRedefinedCount(oop the_class_mirror, int value);
302
303 // Support for embedded per-class oops
304 static oop protection_domain(oop java_class);
305 static oop init_lock(oop java_class);
306 static oop component_mirror(oop java_class);
307 static objArrayOop signers(oop java_class);
308 static void set_signers(oop java_class, objArrayOop signers);
309
310 static oop class_loader(oop java_class);
311 static void set_module(oop java_class, oop module);
312 static oop module(oop java_class);
313
314 static oop name(Handle java_class, TRAPS);
315
316 static int oop_size(oop java_class);
317 static int oop_size_raw(oop java_class);
318 static void set_oop_size(HeapWord* java_class, int size);
319 static int static_oop_field_count(oop java_class);
320 static int static_oop_field_count_raw(oop java_class);
321 static void set_static_oop_field_count(oop java_class, int size);
322
323 static GrowableArray<Klass*>* fixup_mirror_list() {
324 return _fixup_mirror_list;
325 }
326 static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
327 _fixup_mirror_list = v;
328 }
329
330 static GrowableArray<Klass*>* fixup_module_field_list() {
331 return _fixup_module_field_list;
332 }
333 static void set_fixup_module_field_list(GrowableArray<Klass*>* v) {
334 _fixup_module_field_list = v;
|
202
203 // Testers
204 static bool is_instance(oop obj);
205 static inline bool is_instance_inlined(oop obj);
206
207 // Debugging
208 static void print(oop java_string, outputStream* st);
209 friend class JavaClasses;
210 friend class StringTable;
211 };
212
213
214 // Interface to java.lang.Class objects
215
216 #define CLASS_INJECTED_FIELDS(macro) \
217 macro(java_lang_Class, klass, intptr_signature, false) \
218 macro(java_lang_Class, array_klass, intptr_signature, false) \
219 macro(java_lang_Class, oop_size, int_signature, false) \
220 macro(java_lang_Class, static_oop_field_count, int_signature, false) \
221 macro(java_lang_Class, protection_domain, object_signature, false) \
222 macro(java_lang_Class, signers, object_signature, false) \
223 macro(java_lang_Class, source_file, object_signature, false) \
224
225 class java_lang_Class : AllStatic {
226 friend class VMStructs;
227 friend class JVMCIVMStructs;
228
229 private:
230 // The fake offsets are added by the class loader when java.lang.Class is loaded
231
232 static int _klass_offset;
233 static int _array_klass_offset;
234
235 static int _oop_size_offset;
236 static int _static_oop_field_count_offset;
237
238 static int _protection_domain_offset;
239 static int _init_lock_offset;
240 static int _signers_offset;
241 static int _class_loader_offset;
242 static int _module_offset;
243 static int _component_mirror_offset;
244 static int _name_offset;
245 static int _source_file_offset;
246
247 static bool offsets_computed;
248 static int classRedefinedCount_offset;
249
250 static GrowableArray<Klass*>* _fixup_mirror_list;
251 static GrowableArray<Klass*>* _fixup_module_field_list;
252
253 static void set_init_lock(oop java_class, oop init_lock);
254 static void set_protection_domain(oop java_class, oop protection_domain);
255 static void set_class_loader(oop java_class, oop class_loader);
256 static void set_component_mirror(oop java_class, oop comp_mirror);
257 static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain, TRAPS);
258 static void set_mirror_module_field(Klass* K, Handle mirror, Handle module, TRAPS);
259 public:
260 static void allocate_fixup_lists();
261 static void compute_offsets();
262
263 // Instance creation
264 static void create_mirror(Klass* k, Handle class_loader, Handle module,
265 Handle protection_domain, TRAPS);
297 static void release_set_array_klass(oop java_class, Klass* klass);
298 // compiler support for class operations
299 static int klass_offset_in_bytes() { return _klass_offset; }
300 static int array_klass_offset_in_bytes() { return _array_klass_offset; }
301 // Support for classRedefinedCount field
302 static int classRedefinedCount(oop the_class_mirror);
303 static void set_classRedefinedCount(oop the_class_mirror, int value);
304
305 // Support for embedded per-class oops
306 static oop protection_domain(oop java_class);
307 static oop init_lock(oop java_class);
308 static oop component_mirror(oop java_class);
309 static objArrayOop signers(oop java_class);
310 static void set_signers(oop java_class, objArrayOop signers);
311
312 static oop class_loader(oop java_class);
313 static void set_module(oop java_class, oop module);
314 static oop module(oop java_class);
315
316 static oop name(Handle java_class, TRAPS);
317
318 static oop source_file(oop java_class);
319 static void set_source_file(oop java_class, oop source_file);
320
321 static int oop_size(oop java_class);
322 static int oop_size_raw(oop java_class);
323 static void set_oop_size(HeapWord* java_class, int size);
324 static int static_oop_field_count(oop java_class);
325 static int static_oop_field_count_raw(oop java_class);
326 static void set_static_oop_field_count(oop java_class, int size);
327
328 static GrowableArray<Klass*>* fixup_mirror_list() {
329 return _fixup_mirror_list;
330 }
331 static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
332 _fixup_mirror_list = v;
333 }
334
335 static GrowableArray<Klass*>* fixup_module_field_list() {
336 return _fixup_module_field_list;
337 }
338 static void set_fixup_module_field_list(GrowableArray<Klass*>* v) {
339 _fixup_module_field_list = v;
|