src/hotspot/share/oops/instanceKlass.cpp
changeset 49821 02c08e20d66c
parent 49738 a7bc87a63dd8
child 49824 e242740a92b8
equal deleted inserted replaced
49820:663f5d90f0e8 49821:02c08e20d66c
  1889 bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
  1889 bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
  1890   return dependencies().is_dependent_nmethod(nm);
  1890   return dependencies().is_dependent_nmethod(nm);
  1891 }
  1891 }
  1892 #endif //PRODUCT
  1892 #endif //PRODUCT
  1893 
  1893 
  1894 void InstanceKlass::clean_weak_instanceklass_links(BoolObjectClosure* is_alive) {
  1894 void InstanceKlass::clean_weak_instanceklass_links() {
  1895   clean_implementors_list(is_alive);
  1895   clean_implementors_list();
  1896   clean_method_data(is_alive);
  1896   clean_method_data();
  1897 
  1897 
  1898   // Since GC iterates InstanceKlasses sequentially, it is safe to remove stale entries here.
  1898   // Since GC iterates InstanceKlasses sequentially, it is safe to remove stale entries here.
  1899   DependencyContext dep_context(&_dep_context);
  1899   DependencyContext dep_context(&_dep_context);
  1900   dep_context.expunge_stale_entries();
  1900   dep_context.expunge_stale_entries();
  1901 }
  1901 }
  1902 
  1902 
  1903 void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) {
  1903 void InstanceKlass::clean_implementors_list() {
  1904   assert(class_loader_data()->is_alive(), "this klass should be live");
  1904   assert(is_loader_alive(), "this klass should be live");
  1905   if (is_interface()) {
  1905   if (is_interface()) {
  1906     if (ClassUnloading) {
  1906     if (ClassUnloading) {
  1907       Klass* impl = implementor();
  1907       Klass* impl = implementor();
  1908       if (impl != NULL) {
  1908       if (impl != NULL) {
  1909         if (!impl->is_loader_alive(is_alive)) {
  1909         if (!impl->is_loader_alive()) {
  1910           // remove this guy
  1910           // remove this guy
  1911           Klass** klass = adr_implementor();
  1911           Klass** klass = adr_implementor();
  1912           assert(klass != NULL, "null klass");
  1912           assert(klass != NULL, "null klass");
  1913           if (klass != NULL) {
  1913           if (klass != NULL) {
  1914             *klass = NULL;
  1914             *klass = NULL;
  1917       }
  1917       }
  1918     }
  1918     }
  1919   }
  1919   }
  1920 }
  1920 }
  1921 
  1921 
  1922 void InstanceKlass::clean_method_data(BoolObjectClosure* is_alive) {
  1922 void InstanceKlass::clean_method_data() {
  1923   for (int m = 0; m < methods()->length(); m++) {
  1923   for (int m = 0; m < methods()->length(); m++) {
  1924     MethodData* mdo = methods()->at(m)->method_data();
  1924     MethodData* mdo = methods()->at(m)->method_data();
  1925     if (mdo != NULL) {
  1925     if (mdo != NULL) {
  1926       mdo->clean_method_data(is_alive);
  1926       mdo->clean_method_data(/*always_clean*/false);
  1927     }
  1927     }
  1928   }
  1928   }
  1929 }
  1929 }
  1930 
  1930 
  1931 bool InstanceKlass::supers_have_passed_fingerprint_checks() {
  1931 bool InstanceKlass::supers_have_passed_fingerprint_checks() {