src/share/vm/oops/klassVtable.cpp

Print this page




1215           }
1216           // RC_TRACE macro has an embedded ResourceMark
1217           RC_TRACE(0x00200000, ("itable method update: %s(%s)",
1218             new_method->name()->as_C_string(),
1219             new_method->signature()->as_C_string()));
1220         }
1221         // cannot 'break' here; see for-loop comment above.
1222       }
1223       ime++;
1224     }
1225   }
1226 }
1227 
1228 // an itable should never contain old or obsolete methods
1229 bool klassItable::check_no_old_or_obsolete_entries() {
1230   itableMethodEntry* ime = method_entry(0);
1231   for (int i = 0; i < _size_method_table; i++) {
1232     Method* m = ime->method();
1233     if (m != NULL &&
1234         (NOT_PRODUCT(!m->is_valid() ||) m->is_old() || m->is_obsolete())) {


1235       return false;
1236     }




1237     ime++;
1238   }
1239   return true;
1240 }
1241 
1242 void klassItable::dump_itable() {
1243   itableMethodEntry* ime = method_entry(0);
1244   tty->print_cr("itable dump --");
1245   for (int i = 0; i < _size_method_table; i++) {
1246     Method* m = ime->method();
1247     if (m != NULL) {
1248       tty->print("      (%5d)  ", i);
1249       m->access_flags().print_on(tty);
1250       if (m->is_default_method()) {
1251         tty->print("default ");
1252       }
1253       tty->print(" --  ");
1254       m->print_name(tty);
1255       tty->cr();
1256     }




1215           }
1216           // RC_TRACE macro has an embedded ResourceMark
1217           RC_TRACE(0x00200000, ("itable method update: %s(%s)",
1218             new_method->name()->as_C_string(),
1219             new_method->signature()->as_C_string()));
1220         }
1221         // cannot 'break' here; see for-loop comment above.
1222       }
1223       ime++;
1224     }
1225   }
1226 }
1227 
1228 // an itable should never contain old or obsolete methods
1229 bool klassItable::check_no_old_or_obsolete_entries() {
1230   itableMethodEntry* ime = method_entry(0);
1231   for (int i = 0; i < _size_method_table; i++) {
1232     Method* m = ime->method();
1233     if (m != NULL &&
1234         (NOT_PRODUCT(!m->is_valid() ||) m->is_old() || m->is_obsolete())) {
1235       if (m->method_holder() != SystemDictionary::misc_Unsafe_klass() ||
1236           m->name() != vmSymbols::throwIllegalAccessError_name()) {
1237         return false;
1238       }
1239       // replace the old Unsafe.throwIllegalAccessError() method
1240       // with the latest version
1241       ime->initialize(Universe::throw_illegal_access_error());
1242     }
1243     ime++;
1244   }
1245   return true;
1246 }
1247 
1248 void klassItable::dump_itable() {
1249   itableMethodEntry* ime = method_entry(0);
1250   tty->print_cr("itable dump --");
1251   for (int i = 0; i < _size_method_table; i++) {
1252     Method* m = ime->method();
1253     if (m != NULL) {
1254       tty->print("      (%5d)  ", i);
1255       m->access_flags().print_on(tty);
1256       if (m->is_default_method()) {
1257         tty->print("default ");
1258       }
1259       tty->print(" --  ");
1260       m->print_name(tty);
1261       tty->cr();
1262     }