268 static void set_protection_domain(oop java_class, oop protection_domain);
269 static void set_class_loader(oop java_class, oop class_loader);
270 static void set_component_mirror(oop java_class, oop comp_mirror);
271 static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
272 Handle classData, TRAPS);
273 static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
274 public:
275 static void allocate_fixup_lists();
276 static void compute_offsets();
277
278 // Instance creation
279 static void allocate_mirror(Klass* k, bool is_scratch, Handle protection_domain, Handle classData,
280 Handle& mirror, Handle& comp_mirror, TRAPS); // returns mirror and comp_mirror
281 static void create_mirror(Klass* k, Handle class_loader, Handle module,
282 Handle protection_domain, Handle classData, TRAPS);
283 static void fixup_mirror(Klass* k, TRAPS);
284 static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
285
286 // Archiving
287 static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
288 static void create_scratch_mirror(Klass* k, TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
289 static bool restore_archived_mirror(Klass *k, Handle class_loader, Handle module,
290 Handle protection_domain,
291 TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(false);
292
293 static void fixup_module_field(Klass* k, Handle module);
294
295 // Conversion
296 static Klass* as_Klass(oop java_class);
297 static void set_klass(oop java_class, Klass* klass);
298 static BasicType as_BasicType(oop java_class, Klass** reference_klass = nullptr);
299 static Symbol* as_signature(oop java_class, bool intern_if_not_found);
300 static void print_signature(oop java_class, outputStream *st);
301 static const char* as_external_name(oop java_class);
302 // Testing
303 static bool is_instance(oop obj);
304
305 static bool is_primitive(oop java_class);
306 static void set_is_primitive(oop java_class);
307 static BasicType primitive_type(oop java_class);
308 static oop primitive_mirror(BasicType t);
310 static Klass* array_klass_acquire(oop java_class);
311 static void release_set_array_klass(oop java_class, Klass* klass);
312 // compiler support for class operations
313 static int klass_offset() { CHECK_INIT(_klass_offset); }
314 static int array_klass_offset() { CHECK_INIT(_array_klass_offset); }
315 // Support for classRedefinedCount field
316 static int classRedefinedCount(oop the_class_mirror);
317 static void set_classRedefinedCount(oop the_class_mirror, int value);
318
319 // Support for embedded per-class oops
320 static oop protection_domain(oop java_class);
321 static oop init_lock(oop java_class);
322 static void clear_init_lock(oop java_class) {
323 set_init_lock(java_class, nullptr);
324 }
325 static oop component_mirror(oop java_class);
326 static int component_mirror_offset() { return _component_mirror_offset; }
327 static objArrayOop signers(oop java_class);
328 static oop class_data(oop java_class);
329 static void set_class_data(oop java_class, oop classData);
330 static void set_reflection_data(oop java_class, oop reflection_data);
331 static int reflection_data_offset() { return _reflectionData_offset; }
332
333 static oop class_loader(oop java_class);
334 static void set_module(oop java_class, oop module);
335 static oop module(oop java_class);
336
337 static oop name(Handle java_class, TRAPS);
338
339 static oop source_file(oop java_class);
340 static void set_source_file(oop java_class, oop source_file);
341
342 static int modifiers(oop java_class);
343 static void set_modifiers(oop java_class, u2 value);
344
345 static size_t oop_size(oop java_class);
346 static void set_oop_size(HeapWord* java_class, size_t size);
347 static int static_oop_field_count(oop java_class);
348 static void set_static_oop_field_count(oop java_class, int size);
349
350 static GrowableArray<Klass*>* fixup_mirror_list() {
667
668 static void print_stack_element(outputStream *st, Method* method, int bci);
669
670 static void compute_offsets();
671 static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
672
673 // Allocate space for backtrace (created but stack trace not filled in)
674 static void allocate_backtrace(Handle throwable, TRAPS);
675 // Fill in current stack trace for throwable with preallocated backtrace (no GC)
676 static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
677 // Fill in current stack trace, can cause GC
678 static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
679 static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
680
681 // Programmatic access to stack trace
682 static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
683
684 // For recreating class initialization error exceptions.
685 static Handle create_initialization_error(JavaThread* current, Handle throwable);
686
687 // Printing
688 static void print(oop throwable, outputStream* st);
689 static void print_stack_trace(Handle throwable, outputStream* st);
690 static void java_printStackTrace(Handle throwable, TRAPS);
691 // Debugging
692 friend class JavaClasses;
693 // Gets the method and bci of the top frame (TOS). Returns false if this failed.
694 static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
695 };
696
697
698 // Interface to java.lang.reflect.AccessibleObject objects
699
700 class java_lang_reflect_AccessibleObject: AllStatic {
701 private:
702 // Note that to reduce dependencies on the JDK we compute these
703 // offsets at run-time.
704 static int _override_offset;
705
706 static void compute_offsets();
707
|
268 static void set_protection_domain(oop java_class, oop protection_domain);
269 static void set_class_loader(oop java_class, oop class_loader);
270 static void set_component_mirror(oop java_class, oop comp_mirror);
271 static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
272 Handle classData, TRAPS);
273 static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
274 public:
275 static void allocate_fixup_lists();
276 static void compute_offsets();
277
278 // Instance creation
279 static void allocate_mirror(Klass* k, bool is_scratch, Handle protection_domain, Handle classData,
280 Handle& mirror, Handle& comp_mirror, TRAPS); // returns mirror and comp_mirror
281 static void create_mirror(Klass* k, Handle class_loader, Handle module,
282 Handle protection_domain, Handle classData, TRAPS);
283 static void fixup_mirror(Klass* k, TRAPS);
284 static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
285
286 // Archiving
287 static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
288 static void create_scratch_mirror(Klass* k, Handle protection_domain, TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
289 static bool restore_archived_mirror(Klass *k, Handle class_loader, Handle module,
290 Handle protection_domain,
291 TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(false);
292
293 static void fixup_module_field(Klass* k, Handle module);
294
295 // Conversion
296 static Klass* as_Klass(oop java_class);
297 static void set_klass(oop java_class, Klass* klass);
298 static BasicType as_BasicType(oop java_class, Klass** reference_klass = nullptr);
299 static Symbol* as_signature(oop java_class, bool intern_if_not_found);
300 static void print_signature(oop java_class, outputStream *st);
301 static const char* as_external_name(oop java_class);
302 // Testing
303 static bool is_instance(oop obj);
304
305 static bool is_primitive(oop java_class);
306 static void set_is_primitive(oop java_class);
307 static BasicType primitive_type(oop java_class);
308 static oop primitive_mirror(BasicType t);
310 static Klass* array_klass_acquire(oop java_class);
311 static void release_set_array_klass(oop java_class, Klass* klass);
312 // compiler support for class operations
313 static int klass_offset() { CHECK_INIT(_klass_offset); }
314 static int array_klass_offset() { CHECK_INIT(_array_klass_offset); }
315 // Support for classRedefinedCount field
316 static int classRedefinedCount(oop the_class_mirror);
317 static void set_classRedefinedCount(oop the_class_mirror, int value);
318
319 // Support for embedded per-class oops
320 static oop protection_domain(oop java_class);
321 static oop init_lock(oop java_class);
322 static void clear_init_lock(oop java_class) {
323 set_init_lock(java_class, nullptr);
324 }
325 static oop component_mirror(oop java_class);
326 static int component_mirror_offset() { return _component_mirror_offset; }
327 static objArrayOop signers(oop java_class);
328 static oop class_data(oop java_class);
329 static void set_class_data(oop java_class, oop classData);
330
331 static oop reflection_data(oop java_class);
332 static void set_reflection_data(oop java_class, oop reflection_data);
333 static bool has_reflection_data(oop java_class);
334 static int reflection_data_offset() { return _reflectionData_offset; }
335
336 static oop class_loader(oop java_class);
337 static void set_module(oop java_class, oop module);
338 static oop module(oop java_class);
339
340 static oop name(Handle java_class, TRAPS);
341
342 static oop source_file(oop java_class);
343 static void set_source_file(oop java_class, oop source_file);
344
345 static int modifiers(oop java_class);
346 static void set_modifiers(oop java_class, u2 value);
347
348 static size_t oop_size(oop java_class);
349 static void set_oop_size(HeapWord* java_class, size_t size);
350 static int static_oop_field_count(oop java_class);
351 static void set_static_oop_field_count(oop java_class, int size);
352
353 static GrowableArray<Klass*>* fixup_mirror_list() {
670
671 static void print_stack_element(outputStream *st, Method* method, int bci);
672
673 static void compute_offsets();
674 static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
675
676 // Allocate space for backtrace (created but stack trace not filled in)
677 static void allocate_backtrace(Handle throwable, TRAPS);
678 // Fill in current stack trace for throwable with preallocated backtrace (no GC)
679 static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
680 // Fill in current stack trace, can cause GC
681 static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
682 static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
683
684 // Programmatic access to stack trace
685 static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
686
687 // For recreating class initialization error exceptions.
688 static Handle create_initialization_error(JavaThread* current, Handle throwable);
689
690 static oop create_exception_instance(Symbol* class_name, TRAPS);
691
692 // Printing
693 static void print(oop throwable, outputStream* st);
694 static void print_stack_trace(Handle throwable, outputStream* st);
695 static void java_printStackTrace(Handle throwable, TRAPS);
696 // Debugging
697 friend class JavaClasses;
698 // Gets the method and bci of the top frame (TOS). Returns false if this failed.
699 static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
700 };
701
702
703 // Interface to java.lang.reflect.AccessibleObject objects
704
705 class java_lang_reflect_AccessibleObject: AllStatic {
706 private:
707 // Note that to reduce dependencies on the JDK we compute these
708 // offsets at run-time.
709 static int _override_offset;
710
711 static void compute_offsets();
712
|