1219 |
1219 |
1220 if (link_info.check_access() && |
1220 if (link_info.check_access() && |
1221 // check if the method is not <init> |
1221 // check if the method is not <init> |
1222 resolved_method->name() != vmSymbols::object_initializer_name()) { |
1222 resolved_method->name() != vmSymbols::object_initializer_name()) { |
1223 |
1223 |
1224 // check if this is an old-style super call and do a new lookup if so |
|
1225 // a) check if ACC_SUPER flag is set for the current class |
|
1226 Klass* current_klass = link_info.current_klass(); |
1224 Klass* current_klass = link_info.current_klass(); |
1227 if ((current_klass->is_super() || !AllowNonVirtualCalls) && |
1225 |
1228 // b) check if the class of the resolved_klass is a superclass |
1226 // Check if the class of the resolved_klass is a superclass |
1229 // (not supertype in order to exclude interface classes) of the current class. |
1227 // (not supertype in order to exclude interface classes) of the current class. |
1230 // This check is not performed for super.invoke for interface methods |
1228 // This check is not performed for super.invoke for interface methods |
1231 // in super interfaces. |
1229 // in super interfaces. |
1232 current_klass->is_subclass_of(resolved_klass) && |
1230 if (current_klass->is_subclass_of(resolved_klass) && |
1233 current_klass != resolved_klass |
1231 current_klass != resolved_klass) { |
1234 ) { |
|
1235 // Lookup super method |
1232 // Lookup super method |
1236 Klass* super_klass = current_klass->super(); |
1233 Klass* super_klass = current_klass->super(); |
1237 sel_method = lookup_instance_method_in_klasses(super_klass, |
1234 sel_method = lookup_instance_method_in_klasses(super_klass, |
1238 resolved_method->name(), |
1235 resolved_method->name(), |
1239 resolved_method->signature(), |
1236 resolved_method->signature(), |