comparison src/share/vm/code/dependencies.cpp @ 23732:5dae5deb92fb

8162477: [JVMCI] assert(wf.check_method_context(ctxk, m)) failed: proper context Reviewed-by: kvn
author never
date Tue, 02 Aug 2016 17:12:16 -0700
parents dd9cc155639c
children
comparison
equal deleted inserted replaced
23731:1ceab3d13eb8 23732:5dae5deb92fb
1056 if (m->is_private()) 1056 if (m->is_private())
1057 return false; // Quick lose. Should not happen. 1057 return false; // Quick lose. Should not happen.
1058 if (!(m->is_public() || m->is_protected())) 1058 if (!(m->is_public() || m->is_protected()))
1059 // The override story is complex when packages get involved. 1059 // The override story is complex when packages get involved.
1060 return true; // Must punt the assertion to true. 1060 return true; // Must punt the assertion to true.
1061 Klass* k = ctxk; 1061 Method* lm = ctxk->lookup_method(m->name(), m->signature());
1062 Method* lm = k->lookup_method(m->name(), m->signature()); 1062 if (lm == NULL && ctxk->oop_is_instance()) {
1063 if (lm == NULL && k->oop_is_instance()) {
1064 // It might be an interface method 1063 // It might be an interface method
1065 lm = ((InstanceKlass*)k)->lookup_method_in_ordered_interfaces(m->name(), 1064 lm = ((InstanceKlass*)ctxk)->lookup_method_in_ordered_interfaces(m->name(),
1066 m->signature()); 1065 m->signature());
1067 } 1066 }
1068 if (lm == m) 1067 if (lm == m)
1069 // Method m is inherited into ctxk. 1068 // Method m is inherited into ctxk.
1070 return true; 1069 return true;
1071 if (lm != NULL) { 1070 if (lm != NULL) {
1075 } 1074 }
1076 if (lm->is_static()) { 1075 if (lm->is_static()) {
1077 // Static methods don't override non-static so punt 1076 // Static methods don't override non-static so punt
1078 return true; 1077 return true;
1079 } 1078 }
1080 if ( !Dependencies::is_concrete_method(lm, k) 1079 if (!Dependencies::is_concrete_method(lm, ctxk) &&
1081 && !Dependencies::is_concrete_method(m, ctxk) 1080 !Dependencies::is_concrete_method(m, ctxk)) {
1082 && lm->method_holder()->is_subtype_of(m->method_holder())) 1081 // They are both non-concrete
1083 // Method m is overridden by lm, but both are non-concrete. 1082 if (lm->method_holder()->is_subtype_of(m->method_holder())) {
1084 return true; 1083 // Method m is overridden by lm, but both are non-concrete.
1084 return true;
1085 }
1086 if (lm->method_holder()->is_interface() && m->method_holder()->is_interface() &&
1087 ctxk->is_subtype_of(m->method_holder()) && ctxk->is_subtype_of(lm->method_holder())) {
1088 // Interface method defined in multiple super interfaces
1089 return true;
1090 }
1091 }
1085 } 1092 }
1086 ResourceMark rm; 1093 ResourceMark rm;
1087 tty->print_cr("Dependency method not found in the associated context:"); 1094 tty->print_cr("Dependency method not found in the associated context:");
1088 tty->print_cr(" context = %s", ctxk->external_name()); 1095 tty->print_cr(" context = %s", ctxk->external_name());
1089 tty->print( " method = "); m->print_short_name(tty); tty->cr(); 1096 tty->print( " method = "); m->print_short_name(tty); tty->cr();