< prev index next >

src/hotspot/share/classfile/systemDictionary.hpp

Print this page




 114 //         an entry  (an entry cannot be deleted from under a reader)
 115 //    - entries must be fully formed before they are available to concurrent
 116 //         readers (we must ensure write ordering)
 117 //
 118 // Note that placeholders are deleted at any time, as they are removed
 119 // when a class is completely loaded. Therefore, readers as well as writers
 120 // of placeholders must hold the SystemDictionary_lock.
 121 //
 122 
 123 class BootstrapInfo;
 124 class ClassFileStream;
 125 class Dictionary;
 126 class PlaceholderTable;
 127 class LoaderConstraintTable;
 128 template <MEMFLAGS F> class HashtableBucket;
 129 class ResolutionErrorTable;
 130 class SymbolPropertyTable;
 131 class ProtectionDomainCacheTable;
 132 class ProtectionDomainCacheEntry;
 133 class GCTimer;

 134 
 135 #define WK_KLASS_ENUM_NAME(kname)    kname##_knum
 136 
 137 // Certain classes, such as java.lang.Object and java.lang.String,
 138 // are "well-known", in the sense that no class loader is allowed
 139 // to provide a different definition.
 140 //
 141 // Each well-known class has a short klass name (like object_klass),
 142 // and a vmSymbol name (like java_lang_Object).
 143 //
 144 // The order of these definitions is significant: the classes are
 145 // resolved during early VM start-up by resolve_well_known_classes
 146 // in this order. Changing the order may require careful restructuring
 147 // of the VM start-up sequence.
 148 //
 149 #define WK_KLASSES_DO(do_klass)                                                                                 \
 150   /* well-known classes */                                                                                      \
 151   do_klass(Object_klass,                                java_lang_Object                                      ) \
 152   do_klass(String_klass,                                java_lang_String                                      ) \
 153   do_klass(Class_klass,                                 java_lang_Class                                       ) \


 593   // Resolution errors
 594   static ResolutionErrorTable*   _resolution_errors;
 595 
 596   // Invoke methods (JSR 292)
 597   static SymbolPropertyTable*    _invoke_method_table;
 598 
 599   // ProtectionDomain cache
 600   static ProtectionDomainCacheTable*   _pd_cache_table;
 601 
 602 protected:
 603   static void validate_protection_domain(InstanceKlass* klass,
 604                                          Handle class_loader,
 605                                          Handle protection_domain, TRAPS);
 606 
 607   friend class VM_PopulateDumpSharedSpace;
 608   friend class TraversePlaceholdersClosure;
 609   static PlaceholderTable*   placeholders() { return _placeholders; }
 610   static LoaderConstraintTable* constraints() { return _loader_constraints; }
 611   static ResolutionErrorTable* resolution_errors() { return _resolution_errors; }
 612   static SymbolPropertyTable* invoke_method_table() { return _invoke_method_table; }

 613 
 614   // Basic loading operations
 615   static InstanceKlass* resolve_instance_class_or_null_helper(Symbol* name,
 616                                                               Handle class_loader,
 617                                                               Handle protection_domain,
 618                                                               TRAPS);
 619   static InstanceKlass* resolve_instance_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
 620   static Klass* resolve_array_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
 621   static InstanceKlass* handle_parallel_super_load(Symbol* class_name, Symbol* supername, Handle class_loader, Handle protection_domain, Handle lockObject, TRAPS);
 622   // Wait on SystemDictionary_lock; unlocks lockObject before
 623   // waiting; relocks lockObject with correct recursion count
 624   // after waiting, but before reentering SystemDictionary_lock
 625   // to preserve lock order semantics.
 626   static void double_lock_wait(Handle lockObject, TRAPS);
 627   static void define_instance_class(InstanceKlass* k, TRAPS);
 628   static InstanceKlass* find_or_define_instance_class(Symbol* class_name,
 629                                                 Handle class_loader,
 630                                                 InstanceKlass* k, TRAPS);
 631   static bool is_shared_class_visible(Symbol* class_name, InstanceKlass* ik,
 632                                       PackageEntry* pkg_entry,
 633                                       Handle class_loader, TRAPS);
 634   static bool check_shared_class_super_type(InstanceKlass* child, InstanceKlass* super,
 635                                             Handle class_loader,  Handle protection_domain,
 636                                             bool is_superclass, TRAPS);
 637   static bool check_shared_class_super_types(InstanceKlass* ik, Handle class_loader,
 638                                                Handle protection_domain, TRAPS);





 639   static InstanceKlass* load_shared_class(InstanceKlass* ik,
 640                                           Handle class_loader,
 641                                           Handle protection_domain,
 642                                           const ClassFileStream *cfs,
 643                                           PackageEntry* pkg_entry,
 644                                           TRAPS);
 645   // Second part of load_shared_class
 646   static void load_shared_class_misc(InstanceKlass* ik, ClassLoaderData* loader_data, TRAPS) NOT_CDS_RETURN;
 647   static InstanceKlass* load_shared_boot_class(Symbol* class_name,
 648                                                PackageEntry* pkg_entry,
 649                                                TRAPS);
 650   static InstanceKlass* load_instance_class(Symbol* class_name, Handle class_loader, TRAPS);
 651   static Handle compute_loader_lock_object(Handle class_loader, TRAPS);
 652   static void check_loader_lock_contention(Handle loader_lock, TRAPS);
 653   static bool is_parallelCapable(Handle class_loader);
 654   static bool is_parallelDefine(Handle class_loader);
 655 
 656 public:
 657   static bool is_system_class_loader(oop class_loader);
 658   static bool is_platform_class_loader(oop class_loader);




 114 //         an entry  (an entry cannot be deleted from under a reader)
 115 //    - entries must be fully formed before they are available to concurrent
 116 //         readers (we must ensure write ordering)
 117 //
 118 // Note that placeholders are deleted at any time, as they are removed
 119 // when a class is completely loaded. Therefore, readers as well as writers
 120 // of placeholders must hold the SystemDictionary_lock.
 121 //
 122 
 123 class BootstrapInfo;
 124 class ClassFileStream;
 125 class Dictionary;
 126 class PlaceholderTable;
 127 class LoaderConstraintTable;
 128 template <MEMFLAGS F> class HashtableBucket;
 129 class ResolutionErrorTable;
 130 class SymbolPropertyTable;
 131 class ProtectionDomainCacheTable;
 132 class ProtectionDomainCacheEntry;
 133 class GCTimer;
 134 class EventClassLoad;
 135 
 136 #define WK_KLASS_ENUM_NAME(kname)    kname##_knum
 137 
 138 // Certain classes, such as java.lang.Object and java.lang.String,
 139 // are "well-known", in the sense that no class loader is allowed
 140 // to provide a different definition.
 141 //
 142 // Each well-known class has a short klass name (like object_klass),
 143 // and a vmSymbol name (like java_lang_Object).
 144 //
 145 // The order of these definitions is significant: the classes are
 146 // resolved during early VM start-up by resolve_well_known_classes
 147 // in this order. Changing the order may require careful restructuring
 148 // of the VM start-up sequence.
 149 //
 150 #define WK_KLASSES_DO(do_klass)                                                                                 \
 151   /* well-known classes */                                                                                      \
 152   do_klass(Object_klass,                                java_lang_Object                                      ) \
 153   do_klass(String_klass,                                java_lang_String                                      ) \
 154   do_klass(Class_klass,                                 java_lang_Class                                       ) \


 594   // Resolution errors
 595   static ResolutionErrorTable*   _resolution_errors;
 596 
 597   // Invoke methods (JSR 292)
 598   static SymbolPropertyTable*    _invoke_method_table;
 599 
 600   // ProtectionDomain cache
 601   static ProtectionDomainCacheTable*   _pd_cache_table;
 602 
 603 protected:
 604   static void validate_protection_domain(InstanceKlass* klass,
 605                                          Handle class_loader,
 606                                          Handle protection_domain, TRAPS);
 607 
 608   friend class VM_PopulateDumpSharedSpace;
 609   friend class TraversePlaceholdersClosure;
 610   static PlaceholderTable*   placeholders() { return _placeholders; }
 611   static LoaderConstraintTable* constraints() { return _loader_constraints; }
 612   static ResolutionErrorTable* resolution_errors() { return _resolution_errors; }
 613   static SymbolPropertyTable* invoke_method_table() { return _invoke_method_table; }
 614   static void post_class_load_event(EventClassLoad* event, const InstanceKlass* k, const ClassLoaderData* init_cld);
 615 
 616   // Basic loading operations
 617   static InstanceKlass* resolve_instance_class_or_null_helper(Symbol* name,
 618                                                               Handle class_loader,
 619                                                               Handle protection_domain,
 620                                                               TRAPS);
 621   static InstanceKlass* resolve_instance_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
 622   static Klass* resolve_array_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS);
 623   static InstanceKlass* handle_parallel_super_load(Symbol* class_name, Symbol* supername, Handle class_loader, Handle protection_domain, Handle lockObject, TRAPS);
 624   // Wait on SystemDictionary_lock; unlocks lockObject before
 625   // waiting; relocks lockObject with correct recursion count
 626   // after waiting, but before reentering SystemDictionary_lock
 627   // to preserve lock order semantics.
 628   static void double_lock_wait(Handle lockObject, TRAPS);
 629   static void define_instance_class(InstanceKlass* k, TRAPS);
 630   static InstanceKlass* find_or_define_instance_class(Symbol* class_name,
 631                                                 Handle class_loader,
 632                                                 InstanceKlass* k, TRAPS);
 633   static bool is_shared_class_visible(Symbol* class_name, InstanceKlass* ik,
 634                                       PackageEntry* pkg_entry,
 635                                       Handle class_loader, TRAPS);
 636   static bool check_shared_class_super_type(InstanceKlass* child, InstanceKlass* super,
 637                                             Handle class_loader,  Handle protection_domain,
 638                                             bool is_superclass, TRAPS);
 639   static bool check_shared_class_super_types(InstanceKlass* ik, Handle class_loader,
 640                                                Handle protection_domain, TRAPS);
 641   static InstanceKlass* load_shared_lambda_proxy_class(InstanceKlass* ik,
 642                                                        Handle class_loader,
 643                                                        Handle protection_domain,
 644                                                        PackageEntry* pkg_entry,
 645                                                        TRAPS);
 646   static InstanceKlass* load_shared_class(InstanceKlass* ik,
 647                                           Handle class_loader,
 648                                           Handle protection_domain,
 649                                           const ClassFileStream *cfs,
 650                                           PackageEntry* pkg_entry,
 651                                           TRAPS);
 652   // Second part of load_shared_class
 653   static void load_shared_class_misc(InstanceKlass* ik, ClassLoaderData* loader_data, TRAPS) NOT_CDS_RETURN;
 654   static InstanceKlass* load_shared_boot_class(Symbol* class_name,
 655                                                PackageEntry* pkg_entry,
 656                                                TRAPS);
 657   static InstanceKlass* load_instance_class(Symbol* class_name, Handle class_loader, TRAPS);
 658   static Handle compute_loader_lock_object(Handle class_loader, TRAPS);
 659   static void check_loader_lock_contention(Handle loader_lock, TRAPS);
 660   static bool is_parallelCapable(Handle class_loader);
 661   static bool is_parallelDefine(Handle class_loader);
 662 
 663 public:
 664   static bool is_system_class_loader(oop class_loader);
 665   static bool is_platform_class_loader(oop class_loader);


< prev index next >