hotspot/src/share/vm/oops/klassVtable.cpp
changeset 22232 26acfad336c0
parent 21913 0e2fd7282ac6
child 23999 22eb7be3d99d
equal deleted inserted replaced
22231:1cca24bb3125 22232:26acfad336c0
   620   // miranda method in the super, whose entry it should re-use.
   620   // miranda method in the super, whose entry it should re-use.
   621   // Actually, to handle cases that javac would not generate, we need
   621   // Actually, to handle cases that javac would not generate, we need
   622   // this check for all access permissions.
   622   // this check for all access permissions.
   623   InstanceKlass *sk = InstanceKlass::cast(super);
   623   InstanceKlass *sk = InstanceKlass::cast(super);
   624   if (sk->has_miranda_methods()) {
   624   if (sk->has_miranda_methods()) {
   625     if (sk->lookup_method_in_all_interfaces(name, signature) != NULL) {
   625     if (sk->lookup_method_in_all_interfaces(name, signature, false) != NULL) {
   626       return false;  // found a matching miranda; we do not need a new entry
   626       return false;  // found a matching miranda; we do not need a new entry
   627     }
   627     }
   628   }
   628   }
   629   return true; // found no match; we need a new entry
   629   return true; // found no match; we need a new entry
   630 }
   630 }
   741 
   741 
   742     if (!is_duplicate) { // we don't want duplicate miranda entries in the vtable
   742     if (!is_duplicate) { // we don't want duplicate miranda entries in the vtable
   743       if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all?
   743       if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all?
   744         InstanceKlass *sk = InstanceKlass::cast(super);
   744         InstanceKlass *sk = InstanceKlass::cast(super);
   745         // check if it is a duplicate of a super's miranda
   745         // check if it is a duplicate of a super's miranda
   746         if (sk->lookup_method_in_all_interfaces(im->name(), im->signature()) == NULL) {
   746         if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), false) == NULL) {
   747           new_mirandas->append(im);
   747           new_mirandas->append(im);
   748         }
   748         }
   749         if (all_mirandas != NULL) {
   749         if (all_mirandas != NULL) {
   750           all_mirandas->append(im);
   750           all_mirandas->append(im);
   751         }
   751         }
  1083   int ime_count = method_count_for_interface(interf_h());
  1083   int ime_count = method_count_for_interface(interf_h());
  1084   for (int i = 0; i < nof_methods; i++) {
  1084   for (int i = 0; i < nof_methods; i++) {
  1085     Method* m = methods->at(i);
  1085     Method* m = methods->at(i);
  1086     methodHandle target;
  1086     methodHandle target;
  1087     if (m->has_itable_index()) {
  1087     if (m->has_itable_index()) {
       
  1088       // This search must match the runtime resolution, i.e. selection search for invokeinterface
       
  1089       // to correctly enforce loader constraints for interface method inheritance
  1088       LinkResolver::lookup_instance_method_in_klasses(target, _klass, m->name(), m->signature(), CHECK);
  1090       LinkResolver::lookup_instance_method_in_klasses(target, _klass, m->name(), m->signature(), CHECK);
  1089     }
  1091     }
  1090     if (target == NULL || !target->is_public() || target->is_abstract()) {
  1092     if (target == NULL || !target->is_public() || target->is_abstract()) {
  1091       // Entry does not resolve. Leave it empty for AbstractMethodError.
  1093       // Entry does not resolve. Leave it empty for AbstractMethodError.
  1092         if (!(target == NULL) && !target->is_public()) {
  1094         if (!(target == NULL) && !target->is_public()) {