< prev index next >

src/hotspot/share/oops/klass.hpp

Access_GetLoadedClasses

209   bool can_be_primary_super() const {                                                                                      
210     const juint secondary_offset = in_bytes(secondary_super_cache_offset());                                               
211     return super_check_offset() != secondary_offset;                                                                       
212   }                                                                                                                        
213   virtual bool can_be_primary_super_slow() const;                                                                          
214 
215   // Returns number of primary supers; may be a number in the inclusive range [0, primary_super_limit].                    
216   juint super_depth() const {                                                                                              
217     if (!can_be_primary_super()) {                                                                                         
218       return primary_super_limit();                                                                                        
219     } else {                                                                                                               
220       juint d = (super_check_offset() - in_bytes(primary_supers_offset())) / sizeof(Klass*);                               
221       assert(d < primary_super_limit(), "oob");                                                                            
222       assert(_primary_supers[d] == this, "proper init");                                                                   
223       return d;                                                                                                            
224     }                                                                                                                      
225   }                                                                                                                        
226 
227   // java mirror                                                                                                           
228   oop java_mirror() const;                                                                                                 
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
229   void set_java_mirror(Handle m);                                                                                          
230 
231   // Temporary mirror switch used by RedefineClasses                                                                       
232   // Both mirrors are on the ClassLoaderData::_handles list already so no                                                  
233   // barriers are needed.                                                                                                  
234   void set_java_mirror_handle(OopHandle mirror) { _java_mirror = mirror; }                                                 
235   OopHandle java_mirror_handle() const          { return _java_mirror; }                                                   
236 
237   // modifier flags                                                                                                        
238   jint modifier_flags() const          { return _modifier_flags; }                                                         
239   void set_modifier_flags(jint flags)  { _modifier_flags = flags; }                                                        
240 
241   // size helper                                                                                                           
242   int layout_helper() const            { return _layout_helper; }                                                          
243   void set_layout_helper(int lh)       { _layout_helper = lh; }                                                            
244 
245   // Note: for instances layout_helper() may include padding.                                                              
246   // Use InstanceKlass::contains_field_offset to classify field offsets.                                                   
247 

209   bool can_be_primary_super() const {
210     const juint secondary_offset = in_bytes(secondary_super_cache_offset());
211     return super_check_offset() != secondary_offset;
212   }
213   virtual bool can_be_primary_super_slow() const;
214 
215   // Returns number of primary supers; may be a number in the inclusive range [0, primary_super_limit].
216   juint super_depth() const {
217     if (!can_be_primary_super()) {
218       return primary_super_limit();
219     } else {
220       juint d = (super_check_offset() - in_bytes(primary_supers_offset())) / sizeof(Klass*);
221       assert(d < primary_super_limit(), "oob");
222       assert(_primary_supers[d] == this, "proper init");
223       return d;
224     }
225   }
226 
227   // java mirror
228   oop java_mirror() const;
229   // Load the java_mirror as a phantom. This is useful when a weak Klass
230   // pointer has been "peeked" and then must be kept alive before it may
231   // be used safely. The Klass will be kept alive and not be unloaded due
232   // to concurrent marking.
233   virtual oop java_mirror_phantom();
234   void set_java_mirror(Handle m);
235 
236   // Temporary mirror switch used by RedefineClasses
237   // Both mirrors are on the ClassLoaderData::_handles list already so no
238   // barriers are needed.
239   void set_java_mirror_handle(OopHandle mirror) { _java_mirror = mirror; }
240   OopHandle java_mirror_handle() const          { return _java_mirror; }
241 
242   // modifier flags
243   jint modifier_flags() const          { return _modifier_flags; }
244   void set_modifier_flags(jint flags)  { _modifier_flags = flags; }
245 
246   // size helper
247   int layout_helper() const            { return _layout_helper; }
248   void set_layout_helper(int lh)       { _layout_helper = lh; }
249 
250   // Note: for instances layout_helper() may include padding.
251   // Use InstanceKlass::contains_field_offset to classify field offsets.
252 

436   Method* lookup_method(const Symbol* name, const Symbol* signature) const {                                               
437     return uncached_lookup_method(name, signature, find_overpass);                                                         
438   }                                                                                                                        
439 
440   // array class with specific rank                                                                                        
441   Klass* array_klass(int rank, TRAPS)         {  return array_klass_impl(false, rank, THREAD); }                           
442 
443   // array class with this klass as element type                                                                           
444   Klass* array_klass(TRAPS)                   {  return array_klass_impl(false, THREAD); }                                 
445 
446   // These will return NULL instead of allocating on the heap:                                                             
447   // NB: these can block for a mutex, like other functions with TRAPS arg.                                                 
448   Klass* array_klass_or_null(int rank);                                                                                    
449   Klass* array_klass_or_null();                                                                                            
450 
451   virtual oop protection_domain() const = 0;                                                                               
452 
453   oop class_loader() const;                                                                                                
454 
455   virtual oop klass_holder() const      { return class_loader(); }                                                         
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
456 
457  protected:                                                                                                                
458   virtual Klass* array_klass_impl(bool or_null, int rank, TRAPS);                                                          
459   virtual Klass* array_klass_impl(bool or_null, TRAPS);                                                                    
460 
461   void set_vtable_length(int len) { _vtable_len= len; }                                                                    
462 
463   vtableEntry* start_of_vtable() const;                                                                                    
464  public:                                                                                                                   
465   Method* method_at_vtable(int index);                                                                                     
466 
467   static ByteSize vtable_start_offset();                                                                                   
468   static ByteSize vtable_length_offset() {                                                                                 
469     return byte_offset_of(Klass, _vtable_len);                                                                             
470   }                                                                                                                        
471 
472   // CDS support - remove and restore oops from metadata. Oops are not shared.                                             
473   virtual void remove_unshareable_info();                                                                                  
474   virtual void remove_java_mirror();                                                                                       

441   Method* lookup_method(const Symbol* name, const Symbol* signature) const {
442     return uncached_lookup_method(name, signature, find_overpass);
443   }
444 
445   // array class with specific rank
446   Klass* array_klass(int rank, TRAPS)         {  return array_klass_impl(false, rank, THREAD); }
447 
448   // array class with this klass as element type
449   Klass* array_klass(TRAPS)                   {  return array_klass_impl(false, THREAD); }
450 
451   // These will return NULL instead of allocating on the heap:
452   // NB: these can block for a mutex, like other functions with TRAPS arg.
453   Klass* array_klass_or_null(int rank);
454   Klass* array_klass_or_null();
455 
456   virtual oop protection_domain() const = 0;
457 
458   oop class_loader() const;
459 
460   virtual oop klass_holder() const      { return class_loader(); }
461   // Load the klass_holder as a phantom. This is useful when a weak Klass
462   // pointer has been "peeked" and then must be kept alive before it may
463   // be used safely. The Klass will be kept alive and not be unloaded due
464   // to concurrent marking.
465   virtual oop klass_holder_phantom();
466 
467  protected:
468   virtual Klass* array_klass_impl(bool or_null, int rank, TRAPS);
469   virtual Klass* array_klass_impl(bool or_null, TRAPS);
470 
471   void set_vtable_length(int len) { _vtable_len= len; }
472 
473   vtableEntry* start_of_vtable() const;
474  public:
475   Method* method_at_vtable(int index);
476 
477   static ByteSize vtable_start_offset();
478   static ByteSize vtable_length_offset() {
479     return byte_offset_of(Klass, _vtable_len);
480   }
481 
482   // CDS support - remove and restore oops from metadata. Oops are not shared.
483   virtual void remove_unshareable_info();
484   virtual void remove_java_mirror();
< prev index next >