< prev index next >

src/hotspot/share/oops/klass.hpp


122   //                                                                                                                                 
123   // Where to look to observe a supertype (it is &_secondary_super_cache for                                                         
124   // secondary supers, else is &_primary_supers[depth()].                                                                            
125   juint       _super_check_offset;                                                                                                   
126 
127   // Class name.  Instance classes: java/lang/String, etc.  Array classes: [I,                                                       
128   // [Ljava/lang/String;, etc.  Set to zero for all other kinds of classes.                                                          
129   Symbol*     _name;                                                                                                                 
130 
131   // Cache of last observed secondary supertype                                                                                      
132   Klass*      _secondary_super_cache;                                                                                                
133   // Array of all secondary supertypes                                                                                               
134   Array<Klass*>* _secondary_supers;                                                                                                  
135   // Ordered list of all primary supertypes                                                                                          
136   Klass*      _primary_supers[_primary_super_limit];                                                                                 
137   // java/lang/Class instance mirroring this class                                                                                   
138   OopHandle _java_mirror;                                                                                                            
139   // Superclass                                                                                                                      
140   Klass*      _super;                                                                                                                
141   // First subclass (NULL if none); _subklass->next_sibling() is next one                                                            
142   Klass*      _subklass;                                                                                                             
143   // Sibling link (or NULL); links all subklasses of a klass                                                                         
144   Klass*      _next_sibling;                                                                                                         
145 
146   // All klasses loaded by a class loader are chained through these links                                                            
147   Klass*      _next_link;                                                                                                            
148 
149   // The VM's representation of the ClassLoader used to load this class.                                                             
150   // Provide access the corresponding instance java.lang.ClassLoader.                                                                
151   ClassLoaderData* _class_loader_data;                                                                                               
152 
153   jint        _modifier_flags;  // Processed access flags, for use by Class.getModifiers.                                            
154   AccessFlags _access_flags;    // Access flags. The class/interface distinction is stored here.                                     
155 
156   JFR_ONLY(DEFINE_TRACE_ID_FIELD;)                                                                                                   
157 
158   // Biased locking implementation and statistics                                                                                    
159   // (the 64-bit chunk goes first, to avoid some fragmentation)                                                                      
160   jlong    _last_biased_lock_bulk_revocation_time;                                                                                   
161   markOop  _prototype_header;   // Used when biased locking is both enabled and disabled for this type                               
162   jint     _biased_lock_revocation_count;                                                                                            
163 

122   //
123   // Where to look to observe a supertype (it is &_secondary_super_cache for
124   // secondary supers, else is &_primary_supers[depth()].
125   juint       _super_check_offset;
126 
127   // Class name.  Instance classes: java/lang/String, etc.  Array classes: [I,
128   // [Ljava/lang/String;, etc.  Set to zero for all other kinds of classes.
129   Symbol*     _name;
130 
131   // Cache of last observed secondary supertype
132   Klass*      _secondary_super_cache;
133   // Array of all secondary supertypes
134   Array<Klass*>* _secondary_supers;
135   // Ordered list of all primary supertypes
136   Klass*      _primary_supers[_primary_super_limit];
137   // java/lang/Class instance mirroring this class
138   OopHandle _java_mirror;
139   // Superclass
140   Klass*      _super;
141   // First subclass (NULL if none); _subklass->next_sibling() is next one
142   Klass* volatile _subklass;
143   // Sibling link (or NULL); links all subklasses of a klass
144   Klass* volatile _next_sibling;
145 
146   // All klasses loaded by a class loader are chained through these links
147   Klass*      _next_link;
148 
149   // The VM's representation of the ClassLoader used to load this class.
150   // Provide access the corresponding instance java.lang.ClassLoader.
151   ClassLoaderData* _class_loader_data;
152 
153   jint        _modifier_flags;  // Processed access flags, for use by Class.getModifiers.
154   AccessFlags _access_flags;    // Access flags. The class/interface distinction is stored here.
155 
156   JFR_ONLY(DEFINE_TRACE_ID_FIELD;)
157 
158   // Biased locking implementation and statistics
159   // (the 64-bit chunk goes first, to avoid some fragmentation)
160   jlong    _last_biased_lock_bulk_revocation_time;
161   markOop  _prototype_header;   // Used when biased locking is both enabled and disabled for this type
162   jint     _biased_lock_revocation_count;
163 

266   // Temporary mirror switch used by RedefineClasses                                                                                 
267   // Both mirrors are on the ClassLoaderData::_handles list already so no                                                            
268   // barriers are needed.                                                                                                            
269   void set_java_mirror_handle(OopHandle mirror) { _java_mirror = mirror; }                                                           
270   OopHandle java_mirror_handle() const          {                                                                                    
271     return _java_mirror;                                                                                                             
272   }                                                                                                                                  
273 
274   // modifier flags                                                                                                                  
275   jint modifier_flags() const          { return _modifier_flags; }                                                                   
276   void set_modifier_flags(jint flags)  { _modifier_flags = flags; }                                                                  
277 
278   // size helper                                                                                                                     
279   int layout_helper() const            { return _layout_helper; }                                                                    
280   void set_layout_helper(int lh)       { _layout_helper = lh; }                                                                      
281 
282   // Note: for instances layout_helper() may include padding.                                                                        
283   // Use InstanceKlass::contains_field_offset to classify field offsets.                                                             
284 
285   // sub/superklass links                                                                                                            
286   Klass* subklass() const              { return _subklass; }                                                                         
287   Klass* next_sibling() const          { return _next_sibling; }                                                                     
                                                                                                                                     
288   InstanceKlass* superklass() const;                                                                                                 
289   void append_to_sibling_list();           // add newly created receiver to superklass' subklass list                                
290 
291   void set_next_link(Klass* k) { _next_link = k; }                                                                                   
292   Klass* next_link() const { return _next_link; }   // The next klass defined by the class loader.                                   
293 
294   // class loader data                                                                                                               
295   ClassLoaderData* class_loader_data() const               { return _class_loader_data; }                                            
296   void set_class_loader_data(ClassLoaderData* loader_data) {  _class_loader_data = loader_data; }                                    
297 
298   int shared_classpath_index() const   {                                                                                             
299     return _shared_class_path_index;                                                                                                 
300   };                                                                                                                                 
301 
302   void set_shared_classpath_index(int index) {                                                                                       
303     _shared_class_path_index = index;                                                                                                
304   };                                                                                                                                 
305 
306   void set_has_raw_archived_mirror() {                                                                                               

266   // Temporary mirror switch used by RedefineClasses
267   // Both mirrors are on the ClassLoaderData::_handles list already so no
268   // barriers are needed.
269   void set_java_mirror_handle(OopHandle mirror) { _java_mirror = mirror; }
270   OopHandle java_mirror_handle() const          {
271     return _java_mirror;
272   }
273 
274   // modifier flags
275   jint modifier_flags() const          { return _modifier_flags; }
276   void set_modifier_flags(jint flags)  { _modifier_flags = flags; }
277 
278   // size helper
279   int layout_helper() const            { return _layout_helper; }
280   void set_layout_helper(int lh)       { _layout_helper = lh; }
281 
282   // Note: for instances layout_helper() may include padding.
283   // Use InstanceKlass::contains_field_offset to classify field offsets.
284 
285   // sub/superklass links
286   Klass* subklass(bool log = false) const;
287   Klass* next_sibling(bool log = false) const;
288 
289   InstanceKlass* superklass() const;
290   void append_to_sibling_list();           // add newly created receiver to superklass' subklass list
291 
292   void set_next_link(Klass* k) { _next_link = k; }
293   Klass* next_link() const { return _next_link; }   // The next klass defined by the class loader.
294 
295   // class loader data
296   ClassLoaderData* class_loader_data() const               { return _class_loader_data; }
297   void set_class_loader_data(ClassLoaderData* loader_data) {  _class_loader_data = loader_data; }
298 
299   int shared_classpath_index() const   {
300     return _shared_class_path_index;
301   };
302 
303   void set_shared_classpath_index(int index) {
304     _shared_class_path_index = index;
305   };
306 
307   void set_has_raw_archived_mirror() {

649   // Atomically increments biased_lock_revocation_count and returns updated value                                                    
650   int atomic_incr_biased_lock_revocation_count();                                                                                    
651   void set_biased_lock_revocation_count(int val) { _biased_lock_revocation_count = (jint) val; }                                     
652   jlong last_biased_lock_bulk_revocation_time() { return _last_biased_lock_bulk_revocation_time; }                                   
653   void  set_last_biased_lock_bulk_revocation_time(jlong cur_time) { _last_biased_lock_bulk_revocation_time = cur_time; }             
654 
655   JFR_ONLY(DEFINE_TRACE_ID_METHODS;)                                                                                                 
656 
657   virtual void metaspace_pointers_do(MetaspaceClosure* iter);                                                                        
658   virtual MetaspaceObj::Type type() const { return ClassType; }                                                                      
659 
660   // Iff the class loader (or mirror for unsafe anonymous classes) is alive the                                                      
661   // Klass is considered alive. This is safe to call before the CLD is marked as                                                     
662   // unloading, and hence during concurrent class unloading.                                                                         
663   bool is_loader_alive() const { return class_loader_data()->is_alive(); }                                                           
664 
665   // Load the klass's holder as a phantom. This is useful when a weak Klass                                                          
666   // pointer has been "peeked" and then must be kept alive before it may                                                             
667   // be used safely.                                                                                                                 
668   oop holder_phantom() const;                                                                                                        
                                                                                                                                     
                                                                                                                                     
669 
670   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);                                      
671   static void clean_subklass_tree() {                                                                                                
672     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);                                           
673   }                                                                                                                                  
674 
675   virtual void array_klasses_do(void f(Klass* k)) {}                                                                                 
676 
677   // Return self, except for abstract classes with exactly 1                                                                         
678   // implementor.  Then return the 1 concrete implementation.                                                                        
679   Klass *up_cast_abstract();                                                                                                         
680 
681   // klass name                                                                                                                      
682   Symbol* name() const                   { return _name; }                                                                           
683   void set_name(Symbol* n);                                                                                                          
684 
685  public:                                                                                                                             
686   // jvm support                                                                                                                     
687   virtual jint compute_modifier_flags(TRAPS) const;                                                                                  

650   // Atomically increments biased_lock_revocation_count and returns updated value
651   int atomic_incr_biased_lock_revocation_count();
652   void set_biased_lock_revocation_count(int val) { _biased_lock_revocation_count = (jint) val; }
653   jlong last_biased_lock_bulk_revocation_time() { return _last_biased_lock_bulk_revocation_time; }
654   void  set_last_biased_lock_bulk_revocation_time(jlong cur_time) { _last_biased_lock_bulk_revocation_time = cur_time; }
655 
656   JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
657 
658   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
659   virtual MetaspaceObj::Type type() const { return ClassType; }
660 
661   // Iff the class loader (or mirror for unsafe anonymous classes) is alive the
662   // Klass is considered alive. This is safe to call before the CLD is marked as
663   // unloading, and hence during concurrent class unloading.
664   bool is_loader_alive() const { return class_loader_data()->is_alive(); }
665 
666   // Load the klass's holder as a phantom. This is useful when a weak Klass
667   // pointer has been "peeked" and then must be kept alive before it may
668   // be used safely.
669   oop holder_phantom() const;
670 
671   void clean_subklass();
672 
673   static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
674   static void clean_subklass_tree() {
675     clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
676   }
677 
678   virtual void array_klasses_do(void f(Klass* k)) {}
679 
680   // Return self, except for abstract classes with exactly 1
681   // implementor.  Then return the 1 concrete implementation.
682   Klass *up_cast_abstract();
683 
684   // klass name
685   Symbol* name() const                   { return _name; }
686   void set_name(Symbol* n);
687 
688  public:
689   // jvm support
690   virtual jint compute_modifier_flags(TRAPS) const;
< prev index next >