162
163 static int blob_count(); // Returns the total number of CodeBlobs in the cache
164 static int blob_count(int code_blob_type);
165 static int adapter_count(); // Returns the total number of Adapters in the cache
166 static int adapter_count(int code_blob_type);
167 static int nmethod_count(); // Returns the total number of nmethods in the cache
168 static int nmethod_count(int code_blob_type);
169
170 // GC support
171 static void gc_epilogue();
172 static void gc_prologue();
173 static void verify_oops();
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);
|
162
163 static int blob_count(); // Returns the total number of CodeBlobs in the cache
164 static int blob_count(int code_blob_type);
165 static int adapter_count(); // Returns the total number of Adapters in the cache
166 static int adapter_count(int code_blob_type);
167 static int nmethod_count(); // Returns the total number of nmethods in the cache
168 static int nmethod_count(int code_blob_type);
169
170 // GC support
171 static void gc_epilogue();
172 static void gc_prologue();
173 static void verify_oops();
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 ~UnloadingScope();
184 };
185
186 static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);
187 static uint8_t unloading_cycle() { return _unloading_cycle; }
188 static void increment_unloading_cycle();
189 static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN;
190 static void release_exception_cache(ExceptionCache* entry);
191 static void purge_exception_caches();
192
193 // Apply f to every live code blob in scavengable nmethods. Prune nmethods
194 // from the list of scavengable nmethods if f->fix_relocations() and a nmethod
195 // no longer has scavengable oops. If f->fix_relocations(), then f must copy
196 // objects to their new location immediately to avoid fixing nmethods on the
197 // basis of the old object locations.
198 static void scavenge_root_nmethods_do(CodeBlobToOopClosure* f);
199
200 static nmethod* scavenge_root_nmethods() { return _scavenge_root_nmethods; }
201 // register_scavenge_root_nmethod() conditionally adds the nmethod to the list
202 // if it is not already on the list and has a scavengeable root
203 static void register_scavenge_root_nmethod(nmethod* nm);
204 static void verify_scavenge_root_nmethod(nmethod* nm);
|