src/share/vm/classfile/classLoaderData.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8055008_3 Sdiff src/share/vm/classfile

src/share/vm/classfile/classLoaderData.cpp

Print this page




 759 
 760   return false;
 761 }
 762 #endif // PRODUCT
 763 
 764 
 765 // Move class loader data from main list to the unloaded list for unloading
 766 // and deallocation later.
 767 bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) {
 768   ClassLoaderData* data = _head;
 769   ClassLoaderData* prev = NULL;
 770   bool seen_dead_loader = false;
 771 
 772   // Save previous _unloading pointer for CMS which may add to unloading list before
 773   // purging and we don't want to rewalk the previously unloaded class loader data.
 774   _saved_unloading = _unloading;
 775 
 776   // mark metadata seen on the stack and code cache so we can delete
 777   // unneeded entries.
 778   bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
 779   MetadataOnStackMark md_on_stack;
 780   if (has_redefined_a_class) {
 781     // purge_previous_versions also cleans weak method links. Because
 782     // one method's MDO can reference another method from another
 783     // class loader, we need to first clean weak method links for all
 784     // class loaders here. Below, we can then free redefined methods
 785     // for all class loaders.
 786     while (data != NULL) {
 787       if (data->is_alive(is_alive_closure)) {
 788         data->classes_do(InstanceKlass::purge_previous_versions);
 789       }
 790       data = data->next();
 791     }
 792   }
 793   data = _head;
 794   while (data != NULL) {
 795     if (data->is_alive(is_alive_closure)) {
 796       data->free_deallocate_list();
 797       prev = data;
 798       data = data->next();
 799       continue;




 759 
 760   return false;
 761 }
 762 #endif // PRODUCT
 763 
 764 
 765 // Move class loader data from main list to the unloaded list for unloading
 766 // and deallocation later.
 767 bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) {
 768   ClassLoaderData* data = _head;
 769   ClassLoaderData* prev = NULL;
 770   bool seen_dead_loader = false;
 771 
 772   // Save previous _unloading pointer for CMS which may add to unloading list before
 773   // purging and we don't want to rewalk the previously unloaded class loader data.
 774   _saved_unloading = _unloading;
 775 
 776   // mark metadata seen on the stack and code cache so we can delete
 777   // unneeded entries.
 778   bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
 779   MetadataOnStackMark md_on_stack(has_redefined_a_class);
 780   if (has_redefined_a_class) {
 781     // purge_previous_versions also cleans weak method links. Because
 782     // one method's MDO can reference another method from another
 783     // class loader, we need to first clean weak method links for all
 784     // class loaders here. Below, we can then free redefined methods
 785     // for all class loaders.
 786     while (data != NULL) {
 787       if (data->is_alive(is_alive_closure)) {
 788         data->classes_do(InstanceKlass::purge_previous_versions);
 789       }
 790       data = data->next();
 791     }
 792   }
 793   data = _head;
 794   while (data != NULL) {
 795     if (data->is_alive(is_alive_closure)) {
 796       data->free_deallocate_list();
 797       prev = data;
 798       data = data->next();
 799       continue;


src/share/vm/classfile/classLoaderData.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File