< prev index next >

src/hotspot/share/classfile/javaClasses.hpp

Print this page

 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 _init_lock_offset;
 230   static int _signers_offset;
 231   static int _class_loader_offset;
 232   static int _module_offset;
 233   static int _component_mirror_offset;
 234   static int _name_offset;
 235   static int _source_file_offset;
 236   static int _classData_offset;
 237   static int _classRedefinedCount_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_init_lock(oop java_class, oop init_lock);
 245   static void set_protection_domain(oop java_class, oop protection_domain);
 246   static void set_class_loader(oop java_class, oop class_loader);
 247   static void set_component_mirror(oop java_class, oop comp_mirror);
 248   static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
 249                                        Handle classData, TRAPS);
 250   static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
 251  public:
 252   static void allocate_fixup_lists();
 253   static void compute_offsets();
 254 
 255   // Instance creation
 256   static void allocate_mirror(Klass* k, bool is_scratch, Handle protection_domain, Handle classData,
 257                               Handle& mirror, Handle& comp_mirror, TRAPS); // returns mirror and comp_mirror
 258   static void create_mirror(Klass* k, Handle class_loader, Handle module,
 259                             Handle protection_domain, Handle classData, TRAPS);
 260   static void fixup_mirror(Klass* k, TRAPS);
 261   static oop  create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
 262 
 263   // Archiving
 264   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 265   static void create_scratch_mirror(Klass* k, TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
 266   static bool restore_archived_mirror(Klass *k, Handle class_loader, Handle module,
 267                                       Handle protection_domain,
 268                                       TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(false);
 269 
 270   static void fixup_module_field(Klass* k, Handle module);
 271 
 272   // Conversion
 273   static Klass* as_Klass(oop java_class);
 274   static void set_klass(oop java_class, Klass* klass);
 275   static BasicType as_BasicType(oop java_class, Klass** reference_klass = nullptr);
 276   static Symbol* as_signature(oop java_class, bool intern_if_not_found);
 277   static void print_signature(oop java_class, outputStream *st);
 278   static const char* as_external_name(oop java_class);
 279   // Testing
 280   static bool is_instance(oop obj);
 281 
 282   static bool is_primitive(oop java_class);
 283   static BasicType primitive_type(oop java_class);
 284   static oop primitive_mirror(BasicType t);
 285   // JVM_NewArray support

 287   static void release_set_array_klass(oop java_class, Klass* klass);
 288   // compiler support for class operations
 289   static int klass_offset()                { CHECK_INIT(_klass_offset); }
 290   static int array_klass_offset()          { CHECK_INIT(_array_klass_offset); }
 291   // Support for classRedefinedCount field
 292   static int classRedefinedCount(oop the_class_mirror);
 293   static void set_classRedefinedCount(oop the_class_mirror, int value);
 294 
 295   // Support for embedded per-class oops
 296   static oop  protection_domain(oop java_class);
 297   static oop  init_lock(oop java_class);
 298   static void clear_init_lock(oop java_class) {
 299     set_init_lock(java_class, nullptr);
 300   }
 301   static oop  component_mirror(oop java_class);
 302   static objArrayOop  signers(oop java_class);
 303   static void set_signers(oop java_class, objArrayOop signers);
 304   static oop  class_data(oop java_class);
 305   static void set_class_data(oop java_class, oop classData);
 306 




 307   static int component_mirror_offset() { return _component_mirror_offset; }
 308 
 309   static oop class_loader(oop java_class);
 310   static void set_module(oop java_class, oop module);
 311   static oop module(oop java_class);
 312 
 313   static oop name(Handle java_class, TRAPS);
 314 
 315   static oop source_file(oop java_class);
 316   static void set_source_file(oop java_class, oop source_file);
 317 
 318   static size_t oop_size(oop java_class);
 319   static void set_oop_size(HeapWord* java_class, size_t size);
 320   static int static_oop_field_count(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) {

 614 
 615   static void print_stack_element(outputStream *st, Method* method, int bci);
 616 
 617   static void compute_offsets();
 618   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 619 
 620   // Allocate space for backtrace (created but stack trace not filled in)
 621   static void allocate_backtrace(Handle throwable, TRAPS);
 622   // Fill in current stack trace for throwable with preallocated backtrace (no GC)
 623   static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
 624   // Fill in current stack trace, can cause GC
 625   static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
 626   static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
 627 
 628   // Programmatic access to stack trace
 629   static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
 630 
 631   // For recreating class initialization error exceptions.
 632   static Handle create_initialization_error(JavaThread* current, Handle throwable);
 633 
 634   // Printing


 635   static void print(oop throwable, outputStream* st);
 636   static void print_stack_trace(Handle throwable, outputStream* st);
 637   static void java_printStackTrace(Handle throwable, TRAPS);
 638   // Debugging
 639   friend class JavaClasses;
 640   // Gets the method and bci of the top frame (TOS). Returns false if this failed.
 641   static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
 642 };
 643 
 644 
 645 // Interface to java.lang.reflect.AccessibleObject objects
 646 
 647 class java_lang_reflect_AccessibleObject: AllStatic {
 648  private:
 649   // Note that to reduce dependencies on the JDK we compute these
 650   // offsets at run-time.
 651   static int _override_offset;
 652 
 653   static void compute_offsets();
 654 

 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 _init_lock_offset;
 230   static int _signers_offset;
 231   static int _class_loader_offset;
 232   static int _module_offset;
 233   static int _component_mirror_offset;
 234   static int _name_offset;
 235   static int _source_file_offset;
 236   static int _classData_offset;
 237   static int _classRedefinedCount_offset;
 238   static int _reflectionData_offset;
 239 
 240   static bool _offsets_computed;
 241 
 242   static GrowableArray<Klass*>* _fixup_mirror_list;
 243   static GrowableArray<Klass*>* _fixup_module_field_list;
 244 
 245   static void set_init_lock(oop java_class, oop init_lock);
 246   static void set_protection_domain(oop java_class, oop protection_domain);
 247   static void set_class_loader(oop java_class, oop class_loader);
 248   static void set_component_mirror(oop java_class, oop comp_mirror);
 249   static void initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain,
 250                                        Handle classData, TRAPS);
 251   static void set_mirror_module_field(JavaThread* current, Klass* K, Handle mirror, Handle module);
 252  public:
 253   static void allocate_fixup_lists();
 254   static void compute_offsets();
 255 
 256   // Instance creation
 257   static void allocate_mirror(Klass* k, bool is_scratch, Handle protection_domain, Handle classData,
 258                               Handle& mirror, Handle& comp_mirror, TRAPS); // returns mirror and comp_mirror
 259   static void create_mirror(Klass* k, Handle class_loader, Handle module,
 260                             Handle protection_domain, Handle classData, TRAPS);
 261   static void fixup_mirror(Klass* k, TRAPS);
 262   static oop  create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
 263 
 264   // Archiving
 265   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 266   static void create_scratch_mirror(Klass* k, Handle protection_domain, TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
 267   static bool restore_archived_mirror(Klass *k, Handle class_loader, Handle module,
 268                                       Handle protection_domain,
 269                                       TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(false);
 270 
 271   static void fixup_module_field(Klass* k, Handle module);
 272 
 273   // Conversion
 274   static Klass* as_Klass(oop java_class);
 275   static void set_klass(oop java_class, Klass* klass);
 276   static BasicType as_BasicType(oop java_class, Klass** reference_klass = nullptr);
 277   static Symbol* as_signature(oop java_class, bool intern_if_not_found);
 278   static void print_signature(oop java_class, outputStream *st);
 279   static const char* as_external_name(oop java_class);
 280   // Testing
 281   static bool is_instance(oop obj);
 282 
 283   static bool is_primitive(oop java_class);
 284   static BasicType primitive_type(oop java_class);
 285   static oop primitive_mirror(BasicType t);
 286   // JVM_NewArray support

 288   static void release_set_array_klass(oop java_class, Klass* klass);
 289   // compiler support for class operations
 290   static int klass_offset()                { CHECK_INIT(_klass_offset); }
 291   static int array_klass_offset()          { CHECK_INIT(_array_klass_offset); }
 292   // Support for classRedefinedCount field
 293   static int classRedefinedCount(oop the_class_mirror);
 294   static void set_classRedefinedCount(oop the_class_mirror, int value);
 295 
 296   // Support for embedded per-class oops
 297   static oop  protection_domain(oop java_class);
 298   static oop  init_lock(oop java_class);
 299   static void clear_init_lock(oop java_class) {
 300     set_init_lock(java_class, nullptr);
 301   }
 302   static oop  component_mirror(oop java_class);
 303   static objArrayOop  signers(oop java_class);
 304   static void set_signers(oop java_class, objArrayOop signers);
 305   static oop  class_data(oop java_class);
 306   static void set_class_data(oop java_class, oop classData);
 307 
 308   static oop  reflection_data(oop java_class);
 309   static void set_reflection_data(oop java_class, oop reflection_data);
 310   static bool has_reflection_data(oop java_class);
 311 
 312   static int component_mirror_offset() { return _component_mirror_offset; }
 313 
 314   static oop class_loader(oop java_class);
 315   static void set_module(oop java_class, oop module);
 316   static oop module(oop java_class);
 317 
 318   static oop name(Handle java_class, TRAPS);
 319 
 320   static oop source_file(oop java_class);
 321   static void set_source_file(oop java_class, oop source_file);
 322 
 323   static size_t oop_size(oop java_class);
 324   static void set_oop_size(HeapWord* java_class, size_t size);
 325   static int static_oop_field_count(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) {

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