< 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 class PackageEntry;
 74 class GCTimer;
 75 class EventClassLoad;
 76 class Symbol;
 77 
 78 class SystemDictionary : AllStatic {
 79   friend class BootstrapInfo;
 80   friend class vmClasses;
 81   friend class VMStructs;
 82 
 83  public:
 84 
 85   // Returns a class with a given class name and class loader.  Loads the
 86   // class if needed. If not found a NoClassDefFoundError or a
 87   // ClassNotFoundException is thrown, depending on the value on the
 88   // throw_error flag.  For most uses the throw_error argument should be set
 89   // to true.
 90 
 91   static Klass* resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, TRAPS);
 92   // Convenient call for null loader and protection domain.

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






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

 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 class PackageEntry;
 75 class GCTimer;
 76 class EventClassLoad;
 77 class Symbol;
 78 
 79 class SystemDictionary : AllStatic {
 80   friend class BootstrapInfo;
 81   friend class vmClasses;
 82   friend class VMStructs;
 83 
 84  public:
 85 
 86   // Returns a class with a given class name and class loader.  Loads the
 87   // class if needed. If not found a NoClassDefFoundError or a
 88   // ClassNotFoundException is thrown, depending on the value on the
 89   // throw_error flag.  For most uses the throw_error argument should be set
 90   // to true.
 91 
 92   static Klass* resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, TRAPS);
 93   // Convenient call for null loader and protection domain.

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