< prev index next >

src/hotspot/share/classfile/systemDictionary.hpp

Print this page

 53 // domain field of the dictionary entry has not yet been filled in when
 54 // the "real" dictionary entry is created.
 55 //
 56 // Clients of this class who are interested in finding if a class has
 57 // been completely loaded -- not classes in the process of being loaded --
 58 // can read the dictionary unlocked. This is safe because
 59 //    - entries are only deleted when the class loader is not alive, when the
 60 //      entire dictionary is deleted.
 61 //    - entries must be fully formed before they are available to concurrent
 62 //         readers (we must ensure write ordering)
 63 //
 64 // Note that placeholders are deleted at any time, as they are removed
 65 // when a class is completely loaded. Therefore, readers as well as writers
 66 // of placeholders must hold the SystemDictionary_lock.
 67 //
 68 
 69 class BootstrapInfo;
 70 class ClassFileStream;
 71 class ClassLoadInfo;
 72 class Dictionary;

 73 template <MEMFLAGS F> class HashtableBucket;
 74 class ResolutionErrorTable;
 75 class SymbolPropertyTable;
 76 class PackageEntry;
 77 class ProtectionDomainCacheTable;
 78 class ProtectionDomainCacheEntry;
 79 class GCTimer;
 80 class EventClassLoad;
 81 class Symbol;
 82 class TableStatistics;
 83 
 84 class SystemDictionary : AllStatic {
 85   friend class BootstrapInfo;
 86   friend class vmClasses;
 87   friend class VMStructs;
 88 
 89  public:
 90 
 91   // Returns a class with a given class name and class loader.  Loads the
 92   // class if needed. If not found a NoClassDefFoundError or a

118                                               bool is_superclass,
119                                               TRAPS);
120  private:
121   // Parse the stream to create a hidden class.
122   // Used by jvm_lookup_define_class.
123   static InstanceKlass* resolve_hidden_class_from_stream(ClassFileStream* st,
124                                                          Symbol* class_name,
125                                                          Handle class_loader,
126                                                          const ClassLoadInfo& cl_info,
127                                                          TRAPS);
128 
129   // Resolve a class from stream (called by jni_DefineClass and JVM_DefineClass)
130   // This class is added to the SystemDictionary.
131   static InstanceKlass* resolve_class_from_stream(ClassFileStream* st,
132                                                   Symbol* class_name,
133                                                   Handle class_loader,
134                                                   const ClassLoadInfo& cl_info,
135                                                   TRAPS);
136 
137  public:






138   // Resolve either a hidden or normal class from a stream of bytes, based on ClassLoadInfo
139   static InstanceKlass* resolve_from_stream(ClassFileStream* st,
140                                             Symbol* class_name,
141                                             Handle class_loader,
142                                             const ClassLoadInfo& cl_info,
143                                             TRAPS);
144 
145   // Lookup an already loaded class. If not found NULL is returned.
146   static InstanceKlass* find_instance_klass(Symbol* class_name, Handle class_loader, Handle protection_domain);
147 
148   // Lookup an already loaded instance or array class.
149   // Do not make any queries to class loaders; consult only the cache.
150   // If not found NULL is returned.
151   static Klass* find_instance_or_array_klass(Symbol* class_name,
152                                              Handle class_loader,
153                                              Handle protection_domain);
154 
155   // Lookup an instance or array class that has already been loaded
156   // either into the given class loader, or else into another class
157   // loader that is constrained (via loader constraints) to produce

 53 // domain field of the dictionary entry has not yet been filled in when
 54 // the "real" dictionary entry is created.
 55 //
 56 // Clients of this class who are interested in finding if a class has
 57 // been completely loaded -- not classes in the process of being loaded --
 58 // can read the dictionary unlocked. This is safe because
 59 //    - entries are only deleted when the class loader is not alive, when the
 60 //      entire dictionary is deleted.
 61 //    - entries must be fully formed before they are available to concurrent
 62 //         readers (we must ensure write ordering)
 63 //
 64 // Note that placeholders are deleted at any time, as they are removed
 65 // when a class is completely loaded. Therefore, readers as well as writers
 66 // of placeholders must hold the SystemDictionary_lock.
 67 //
 68 
 69 class BootstrapInfo;
 70 class ClassFileStream;
 71 class ClassLoadInfo;
 72 class Dictionary;
 73 class AllFieldStream;
 74 template <MEMFLAGS F> class HashtableBucket;
 75 class ResolutionErrorTable;
 76 class SymbolPropertyTable;
 77 class PackageEntry;
 78 class ProtectionDomainCacheTable;
 79 class ProtectionDomainCacheEntry;
 80 class GCTimer;
 81 class EventClassLoad;
 82 class Symbol;
 83 class TableStatistics;
 84 
 85 class SystemDictionary : AllStatic {
 86   friend class BootstrapInfo;
 87   friend class vmClasses;
 88   friend class VMStructs;
 89 
 90  public:
 91 
 92   // Returns a class with a given class name and class loader.  Loads the
 93   // class if needed. If not found a NoClassDefFoundError or a

119                                               bool is_superclass,
120                                               TRAPS);
121  private:
122   // Parse the stream to create a hidden class.
123   // Used by jvm_lookup_define_class.
124   static InstanceKlass* resolve_hidden_class_from_stream(ClassFileStream* st,
125                                                          Symbol* class_name,
126                                                          Handle class_loader,
127                                                          const ClassLoadInfo& cl_info,
128                                                          TRAPS);
129 
130   // Resolve a class from stream (called by jni_DefineClass and JVM_DefineClass)
131   // This class is added to the SystemDictionary.
132   static InstanceKlass* resolve_class_from_stream(ClassFileStream* st,
133                                                   Symbol* class_name,
134                                                   Handle class_loader,
135                                                   const ClassLoadInfo& cl_info,
136                                                   TRAPS);
137 
138  public:
139   static Klass* resolve_inline_type_field_or_fail(AllFieldStream* fs,
140                                                   Handle class_loader,
141                                                   Handle protection_domain,
142                                                   bool throw_error,
143                                                   TRAPS);
144 
145   // Resolve either a hidden or normal class from a stream of bytes, based on ClassLoadInfo
146   static InstanceKlass* resolve_from_stream(ClassFileStream* st,
147                                             Symbol* class_name,
148                                             Handle class_loader,
149                                             const ClassLoadInfo& cl_info,
150                                             TRAPS);
151 
152   // Lookup an already loaded class. If not found NULL is returned.
153   static InstanceKlass* find_instance_klass(Symbol* class_name, Handle class_loader, Handle protection_domain);
154 
155   // Lookup an already loaded instance or array class.
156   // Do not make any queries to class loaders; consult only the cache.
157   // If not found NULL is returned.
158   static Klass* find_instance_or_array_klass(Symbol* class_name,
159                                              Handle class_loader,
160                                              Handle protection_domain);
161 
162   // Lookup an instance or array class that has already been loaded
163   // either into the given class loader, or else into another class
164   // loader that is constrained (via loader constraints) to produce
< prev index next >