< prev index next >

src/hotspot/share/code/codeCache.hpp


174   // If any oops are not marked this method unloads (i.e., breaks root links                                                         
175   // to) any unmarked codeBlobs in the cache.  Sets "marked_for_unloading"                                                           
176   // to "true" iff some code got unloaded.                                                                                           
177   // "unloading_occurred" controls whether metadata should be cleaned because of class unloading.                                    
178   class UnloadingScope: StackObj {                                                                                                   
179     ClosureIsUnloadingBehaviour _is_unloading_behaviour;                                                                             
180 
181   public:                                                                                                                            
182     UnloadingScope(BoolObjectClosure* is_alive)                                                                                      
183       : _is_unloading_behaviour(is_alive)                                                                                            
184     {                                                                                                                                
185       IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);                                                                   
186       increment_unloading_cycle();                                                                                                   
187     }                                                                                                                                
188 
189     ~UnloadingScope() {                                                                                                              
190       IsUnloadingBehaviour::set_current(NULL);                                                                                       
191     }                                                                                                                                
192   };                                                                                                                                 
193   static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);                                                    
194   static uint16_t unloading_cycle() { return _unloading_cycle; }                                                                     
195   static void increment_unloading_cycle();                                                                                           
196   static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN;                                        
197   static void release_exception_cache(ExceptionCache* entry);                                                                        
198   static void purge_exception_caches();                                                                                              
199 
200   // Apply f to every live code blob in scavengable nmethods. Prune nmethods                                                         
201   // from the list of scavengable nmethods if f->fix_relocations() and a nmethod                                                     
202   // no longer has scavengable oops.  If f->fix_relocations(), then f must copy                                                      
203   // objects to their new location immediately to avoid fixing nmethods on the                                                       
204   // basis of the old object locations.                                                                                              
205   static void scavenge_root_nmethods_do(CodeBlobToOopClosure* f);                                                                    
206 
207   static nmethod* scavenge_root_nmethods()            { return _scavenge_root_nmethods; }                                            
208   // register_scavenge_root_nmethod() conditionally adds the nmethod to the list                                                     
209   // if it is not already on the list and has a scavengeable root                                                                    
210   static void register_scavenge_root_nmethod(nmethod* nm);                                                                           
211   static void verify_scavenge_root_nmethod(nmethod* nm);                                                                             
212   static void add_scavenge_root_nmethod(nmethod* nm);                                                                                
213   static void drop_scavenge_root_nmethod(nmethod* nm);                                                                               

174   // If any oops are not marked this method unloads (i.e., breaks root links
175   // to) any unmarked codeBlobs in the cache.  Sets "marked_for_unloading"
176   // to "true" iff some code got unloaded.
177   // "unloading_occurred" controls whether metadata should be cleaned because of class unloading.
178   class UnloadingScope: StackObj {
179     ClosureIsUnloadingBehaviour _is_unloading_behaviour;
180 
181   public:
182     UnloadingScope(BoolObjectClosure* is_alive)
183       : _is_unloading_behaviour(is_alive)
184     {
185       IsUnloadingBehaviour::set_current(&_is_unloading_behaviour);
186       increment_unloading_cycle();
187     }
188 
189     ~UnloadingScope() {
190       IsUnloadingBehaviour::set_current(NULL);
191     }
192   };
193   static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);
194   static uint8_t unloading_cycle() { return _unloading_cycle; }
195   static void increment_unloading_cycle();
196   static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN;
197   static void release_exception_cache(ExceptionCache* entry);
198   static void purge_exception_caches();
199 
200   // Apply f to every live code blob in scavengable nmethods. Prune nmethods
201   // from the list of scavengable nmethods if f->fix_relocations() and a nmethod
202   // no longer has scavengable oops.  If f->fix_relocations(), then f must copy
203   // objects to their new location immediately to avoid fixing nmethods on the
204   // basis of the old object locations.
205   static void scavenge_root_nmethods_do(CodeBlobToOopClosure* f);
206 
207   static nmethod* scavenge_root_nmethods()            { return _scavenge_root_nmethods; }
208   // register_scavenge_root_nmethod() conditionally adds the nmethod to the list
209   // if it is not already on the list and has a scavengeable root
210   static void register_scavenge_root_nmethod(nmethod* nm);
211   static void verify_scavenge_root_nmethod(nmethod* nm);
212   static void add_scavenge_root_nmethod(nmethod* nm);
213   static void drop_scavenge_root_nmethod(nmethod* nm);
< prev index next >