< prev index next >

src/hotspot/share/classfile/javaClasses.hpp

Print this page

 217 
 218  private:
 219 
 220   // The fake offsets are added by the class loader when java.lang.Class is loaded
 221 
 222   static int _klass_offset;
 223   static int _array_klass_offset;
 224 
 225   static int _oop_size_offset;
 226   static int _static_oop_field_count_offset;
 227 
 228   static int _protection_domain_offset;
 229   static int _signers_offset;
 230   static int _class_loader_offset;
 231   static int _module_offset;
 232   static int _component_mirror_offset;
 233   static int _name_offset;
 234   static int _source_file_offset;
 235   static int _classData_offset;
 236   static int _classRedefinedCount_offset;

 237 
 238   static bool _offsets_computed;
 239 
 240   static GrowableArray<Klass*>* _fixup_mirror_list;
 241   static GrowableArray<Klass*>* _fixup_module_field_list;
 242 
 243   static void set_protection_domain(oop java_class, oop protection_domain);
 244   static void set_class_loader(oop java_class, oop class_loader);
 245   static void set_component_mirror(oop java_class, oop comp_mirror);
 246   static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
 247                                        Handle classData, TRAPS);
 248   static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
 249  public:
 250   static void allocate_fixup_lists();
 251   static void compute_offsets();
 252 
 253   // Instance creation
 254   static void allocate_mirror(Klass* k, bool is_scratch, Handle protection_domain, Handle classData,
 255                               Handle& mirror, Handle& comp_mirror, TRAPS); // returns mirror and comp_mirror
 256   static void create_mirror(Klass* k, Handle class_loader, Handle module,

 281   static BasicType primitive_type(oop java_class);
 282   static oop primitive_mirror(BasicType t);
 283   // JVM_NewArray support
 284   static Klass* array_klass_acquire(oop java_class);
 285   static void release_set_array_klass(oop java_class, Klass* klass);
 286   // compiler support for class operations
 287   static int klass_offset()                { CHECK_INIT(_klass_offset); }
 288   static int array_klass_offset()          { CHECK_INIT(_array_klass_offset); }
 289   // Support for classRedefinedCount field
 290   static int classRedefinedCount(oop the_class_mirror);
 291   static void set_classRedefinedCount(oop the_class_mirror, int value);
 292 
 293   // Support for embedded per-class oops
 294   static oop  protection_domain(oop java_class);
 295   static oop  component_mirror(oop java_class);
 296   static objArrayOop  signers(oop java_class);
 297   static void set_signers(oop java_class, objArrayOop signers);
 298   static oop  class_data(oop java_class);
 299   static void set_class_data(oop java_class, oop classData);
 300 




 301   static int component_mirror_offset() { return _component_mirror_offset; }
 302 
 303   static oop class_loader(oop java_class);
 304   static void set_module(oop java_class, oop module);
 305   static oop module(oop java_class);
 306 
 307   static oop name(Handle java_class, TRAPS);
 308 
 309   static oop source_file(oop java_class);
 310   static void set_source_file(oop java_class, oop source_file);
 311 
 312   static size_t oop_size(oop java_class);
 313   static void set_oop_size(HeapWord* java_class, size_t size);
 314   static int static_oop_field_count(oop java_class);
 315   static void set_static_oop_field_count(oop java_class, int size);
 316 
 317   static GrowableArray<Klass*>* fixup_mirror_list() {
 318     return _fixup_mirror_list;
 319   }
 320   static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {

 603   static Symbol* detail_message(oop throwable);
 604   static void print_stack_element(outputStream *st, Method* method, int bci);
 605 
 606   static void compute_offsets();
 607   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 608 
 609   // Allocate space for backtrace (created but stack trace not filled in)
 610   static void allocate_backtrace(Handle throwable, TRAPS);
 611   // Fill in current stack trace for throwable with preallocated backtrace (no GC)
 612   static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
 613   // Fill in current stack trace, can cause GC
 614   static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
 615   static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
 616 
 617   // Programmatic access to stack trace
 618   static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
 619 
 620   // For recreating class initialization error exceptions.
 621   static Handle create_initialization_error(JavaThread* current, Handle throwable);
 622 
 623   // Printing


 624   static void print(oop throwable, outputStream* st);
 625   static void print_stack_trace(Handle throwable, outputStream* st);
 626   static void java_printStackTrace(Handle throwable, TRAPS);
 627   // Debugging
 628   friend class JavaClasses;
 629   // Gets the method and bci of the top frame (TOS). Returns false if this failed.
 630   static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
 631 };
 632 
 633 
 634 // Interface to java.lang.reflect.AccessibleObject objects
 635 
 636 class java_lang_reflect_AccessibleObject: AllStatic {
 637  private:
 638   // Note that to reduce dependencies on the JDK we compute these
 639   // offsets at run-time.
 640   static int _override_offset;
 641 
 642   static void compute_offsets();
 643 

 217 
 218  private:
 219 
 220   // The fake offsets are added by the class loader when java.lang.Class is loaded
 221 
 222   static int _klass_offset;
 223   static int _array_klass_offset;
 224 
 225   static int _oop_size_offset;
 226   static int _static_oop_field_count_offset;
 227 
 228   static int _protection_domain_offset;
 229   static int _signers_offset;
 230   static int _class_loader_offset;
 231   static int _module_offset;
 232   static int _component_mirror_offset;
 233   static int _name_offset;
 234   static int _source_file_offset;
 235   static int _classData_offset;
 236   static int _classRedefinedCount_offset;
 237   static int _reflectionData_offset;
 238 
 239   static bool _offsets_computed;
 240 
 241   static GrowableArray<Klass*>* _fixup_mirror_list;
 242   static GrowableArray<Klass*>* _fixup_module_field_list;
 243 
 244   static void set_protection_domain(oop java_class, oop protection_domain);
 245   static void set_class_loader(oop java_class, oop class_loader);
 246   static void set_component_mirror(oop java_class, oop comp_mirror);
 247   static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
 248                                        Handle classData, TRAPS);
 249   static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
 250  public:
 251   static void allocate_fixup_lists();
 252   static void compute_offsets();
 253 
 254   // Instance creation
 255   static void allocate_mirror(Klass* k, bool is_scratch, Handle protection_domain, Handle classData,
 256                               Handle& mirror, Handle& comp_mirror, TRAPS); // returns mirror and comp_mirror
 257   static void create_mirror(Klass* k, Handle class_loader, Handle module,

 282   static BasicType primitive_type(oop java_class);
 283   static oop primitive_mirror(BasicType t);
 284   // JVM_NewArray support
 285   static Klass* array_klass_acquire(oop java_class);
 286   static void release_set_array_klass(oop java_class, Klass* klass);
 287   // compiler support for class operations
 288   static int klass_offset()                { CHECK_INIT(_klass_offset); }
 289   static int array_klass_offset()          { CHECK_INIT(_array_klass_offset); }
 290   // Support for classRedefinedCount field
 291   static int classRedefinedCount(oop the_class_mirror);
 292   static void set_classRedefinedCount(oop the_class_mirror, int value);
 293 
 294   // Support for embedded per-class oops
 295   static oop  protection_domain(oop java_class);
 296   static oop  component_mirror(oop java_class);
 297   static objArrayOop  signers(oop java_class);
 298   static void set_signers(oop java_class, objArrayOop signers);
 299   static oop  class_data(oop java_class);
 300   static void set_class_data(oop java_class, oop classData);
 301 
 302   static oop  reflection_data(oop java_class);
 303   static void set_reflection_data(oop java_class, oop reflection_data);
 304   static bool has_reflection_data(oop java_class);
 305 
 306   static int component_mirror_offset() { return _component_mirror_offset; }
 307 
 308   static oop class_loader(oop java_class);
 309   static void set_module(oop java_class, oop module);
 310   static oop module(oop java_class);
 311 
 312   static oop name(Handle java_class, TRAPS);
 313 
 314   static oop source_file(oop java_class);
 315   static void set_source_file(oop java_class, oop source_file);
 316 
 317   static size_t oop_size(oop java_class);
 318   static void set_oop_size(HeapWord* java_class, size_t size);
 319   static int static_oop_field_count(oop java_class);
 320   static void set_static_oop_field_count(oop java_class, int size);
 321 
 322   static GrowableArray<Klass*>* fixup_mirror_list() {
 323     return _fixup_mirror_list;
 324   }
 325   static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {

 608   static Symbol* detail_message(oop throwable);
 609   static void print_stack_element(outputStream *st, Method* method, int bci);
 610 
 611   static void compute_offsets();
 612   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 613 
 614   // Allocate space for backtrace (created but stack trace not filled in)
 615   static void allocate_backtrace(Handle throwable, TRAPS);
 616   // Fill in current stack trace for throwable with preallocated backtrace (no GC)
 617   static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
 618   // Fill in current stack trace, can cause GC
 619   static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
 620   static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
 621 
 622   // Programmatic access to stack trace
 623   static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
 624 
 625   // For recreating class initialization error exceptions.
 626   static Handle create_initialization_error(JavaThread* current, Handle throwable);
 627 
 628   static oop create_exception_instance(Symbol* class_name, TRAPS);
 629 
 630     // Printing
 631   static void print(oop throwable, outputStream* st);
 632   static void print_stack_trace(Handle throwable, outputStream* st);
 633   static void java_printStackTrace(Handle throwable, TRAPS);
 634   // Debugging
 635   friend class JavaClasses;
 636   // Gets the method and bci of the top frame (TOS). Returns false if this failed.
 637   static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
 638 };
 639 
 640 
 641 // Interface to java.lang.reflect.AccessibleObject objects
 642 
 643 class java_lang_reflect_AccessibleObject: AllStatic {
 644  private:
 645   // Note that to reduce dependencies on the JDK we compute these
 646   // offsets at run-time.
 647   static int _override_offset;
 648 
 649   static void compute_offsets();
 650 
< prev index next >