< prev index next >

src/hotspot/share/classfile/classLoaderData.hpp

klass is_unloading no cache v2

318   void methods_do(void f(Method*));                                                                                                  
319   void modules_do(void f(ModuleEntry*));                                                                                             
320   void packages_do(void f(PackageEntry*));                                                                                           
321 
322   // Deallocate free list during class unloading.                                                                                    
323   void free_deallocate_list();                      // for the classes that are not unloaded                                         
324   void free_deallocate_list_C_heap_structures();    // for the classes that are unloaded                                             
325 
326   // Allocate out of this class loader data                                                                                          
327   MetaWord* allocate(size_t size);                                                                                                   
328 
329   Dictionary* create_dictionary();                                                                                                   
330 
331   void initialize_name(Handle class_loader);                                                                                         
332  public:                                                                                                                             
333   // GC interface.                                                                                                                   
334   void clear_claimed() { _claimed = 0; }                                                                                             
335   bool claimed() const { return _claimed == 1; }                                                                                     
336   bool claim();                                                                                                                      
337 
                                                                                                                                     
                                                                                                                                     
338   bool is_alive() const;                                                                                                             
339 
340   // Accessors                                                                                                                       
341   ClassLoaderMetaspace* metaspace_or_null() const { return _metaspace; }                                                             
342 
343   static ClassLoaderData* the_null_class_loader_data() {                                                                             
344     return _the_null_class_loader_data;                                                                                              
345   }                                                                                                                                  
346 
347   Mutex* metaspace_lock() const { return _metaspace_lock; }                                                                          
348 
349   bool is_unsafe_anonymous() const { return _is_unsafe_anonymous; }                                                                  
350 
351   static void init_null_class_loader_data();                                                                                         
352 
353   bool is_the_null_class_loader_data() const {                                                                                       
354     return this == _the_null_class_loader_data;                                                                                      
355   }                                                                                                                                  
356 

318   void methods_do(void f(Method*));
319   void modules_do(void f(ModuleEntry*));
320   void packages_do(void f(PackageEntry*));
321 
322   // Deallocate free list during class unloading.
323   void free_deallocate_list();                      // for the classes that are not unloaded
324   void free_deallocate_list_C_heap_structures();    // for the classes that are unloaded
325 
326   // Allocate out of this class loader data
327   MetaWord* allocate(size_t size);
328 
329   Dictionary* create_dictionary();
330 
331   void initialize_name(Handle class_loader);
332  public:
333   // GC interface.
334   void clear_claimed() { _claimed = 0; }
335   bool claimed() const { return _claimed == 1; }
336   bool claim();
337 
338   // Computes if the CLD is alive or not. This is safe to call in concurrent
339   // contexts.
340   bool is_alive() const;
341 
342   // Accessors
343   ClassLoaderMetaspace* metaspace_or_null() const { return _metaspace; }
344 
345   static ClassLoaderData* the_null_class_loader_data() {
346     return _the_null_class_loader_data;
347   }
348 
349   Mutex* metaspace_lock() const { return _metaspace_lock; }
350 
351   bool is_unsafe_anonymous() const { return _is_unsafe_anonymous; }
352 
353   static void init_null_class_loader_data();
354 
355   bool is_the_null_class_loader_data() const {
356     return this == _the_null_class_loader_data;
357   }
358 

359   bool is_system_class_loader_data() const;                                                                                          
360 
361   // Returns true if this class loader data is for the platform class loader.                                                        
362   // (Note that the class loader data may be unsafe anonymous.)                                                                      
363   bool is_platform_class_loader_data() const;                                                                                        
364 
365   // Returns true if this class loader data is for the boot class loader.                                                            
366   // (Note that the class loader data may be unsafe anonymous.)                                                                      
367   inline bool is_boot_class_loader_data() const;                                                                                     
368 
369   bool is_builtin_class_loader_data() const;                                                                                         
370   bool is_permanent_class_loader_data() const;                                                                                       
371 
372   // The Metaspace is created lazily so may be NULL.  This                                                                           
373   // method will allocate a Metaspace if needed.                                                                                     
374   ClassLoaderMetaspace* metaspace_non_null();                                                                                        
375 
376   inline oop class_loader() const;                                                                                                   
377 
378   // Returns true if this class loader data is for a loader going away.                                                              
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
379   bool is_unloading() const     {                                                                                                    
380     assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");                         
381     return _unloading;                                                                                                               
382   }                                                                                                                                  
383 
384   // Used to refcount an unsafe anonymous class's CLD in order to                                                                    
385   // indicate their aliveness.                                                                                                       
386   void inc_keep_alive();                                                                                                             
387   void dec_keep_alive();                                                                                                             
388 
389   void initialize_holder(Handle holder);                                                                                             
390 
391   void oops_do(OopClosure* f, bool must_claim, bool clear_modified_oops = false);                                                    
392 
393   void classes_do(KlassClosure* klass_closure);                                                                                      
394   Klass* klasses() { return _klasses; }                                                                                              
395 
396   JNIMethodBlock* jmethod_ids() const              { return _jmethod_ids; }                                                          
397   void set_jmethod_ids(JNIMethodBlock* new_block)  { _jmethod_ids = new_block; }                                                     

361   bool is_system_class_loader_data() const;
362 
363   // Returns true if this class loader data is for the platform class loader.
364   // (Note that the class loader data may be unsafe anonymous.)
365   bool is_platform_class_loader_data() const;
366 
367   // Returns true if this class loader data is for the boot class loader.
368   // (Note that the class loader data may be unsafe anonymous.)
369   inline bool is_boot_class_loader_data() const;
370 
371   bool is_builtin_class_loader_data() const;
372   bool is_permanent_class_loader_data() const;
373 
374   // The Metaspace is created lazily so may be NULL.  This
375   // method will allocate a Metaspace if needed.
376   ClassLoaderMetaspace* metaspace_non_null();
377 
378   inline oop class_loader() const;
379 
380   // Returns true if this class loader data is for a loader going away.
381   // Note that this is only safe after the GC has computed if the CLD is
382   // unloaded or not. In concurrent contexts where there are no such
383   // guarantees, is_alive() should be used instead.
384   bool is_unloading() const     {
385     assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");
386     return _unloading;
387   }
388 
389   // Used to refcount an unsafe anonymous class's CLD in order to
390   // indicate their aliveness.
391   void inc_keep_alive();
392   void dec_keep_alive();
393 
394   void initialize_holder(Handle holder);
395 
396   void oops_do(OopClosure* f, bool must_claim, bool clear_modified_oops = false);
397 
398   void classes_do(KlassClosure* klass_closure);
399   Klass* klasses() { return _klasses; }
400 
401   JNIMethodBlock* jmethod_ids() const              { return _jmethod_ids; }
402   void set_jmethod_ids(JNIMethodBlock* new_block)  { _jmethod_ids = new_block; }
< prev index next >