comparison src/share/vm/interpreter/linkResolver.cpp @ 13433:769557390c43

8029415: java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java fails on all platforms with hs25-b61 Summary: Check first that a class is not a dynamically-generated bytecode associated with 1.4 reflection implementation, to emitting an ICCE of an invokespecial IMR of a method in an indirect superinterface. Reviewed-by: acorn, hseigel Contributed-by: lois.foltan@oracle.com
author hseigel
date Fri, 06 Dec 2013 11:33:10 -0500
parents 379f11bc04fc
children 9fbabcbb875b
comparison
equal deleted inserted replaced
13416:e84d2afb2fb0 13433:769557390c43
941 // check if invokespecial's interface method reference is in an indirect superinterface 941 // check if invokespecial's interface method reference is in an indirect superinterface
942 if (!current_klass.is_null() && resolved_klass->is_interface()) { 942 if (!current_klass.is_null() && resolved_klass->is_interface()) {
943 Klass *klass_to_check = !InstanceKlass::cast(current_klass())->is_anonymous() ? 943 Klass *klass_to_check = !InstanceKlass::cast(current_klass())->is_anonymous() ?
944 current_klass() : 944 current_klass() :
945 InstanceKlass::cast(current_klass())->host_klass(); 945 InstanceKlass::cast(current_klass())->host_klass();
946 946 // As of the fix for 4486457 we disable verification for all of the
947 if (!InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) { 947 // dynamically-generated bytecodes associated with the 1.4
948 // reflection implementation, not just those associated with
949 // sun/reflect/SerializationConstructorAccessor.
950 bool is_reflect = JDK_Version::is_gte_jdk14x_version() &&
951 UseNewReflection &&
952 klass_to_check->is_subclass_of(
953 SystemDictionary::reflect_MagicAccessorImpl_klass());
954
955 if (!is_reflect &&
956 !InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) {
948 ResourceMark rm(THREAD); 957 ResourceMark rm(THREAD);
949 char buf[200]; 958 char buf[200];
950 jio_snprintf(buf, sizeof(buf), 959 jio_snprintf(buf, sizeof(buf),
951 "Interface method reference: %s, is in an indirect superinterface of %s", 960 "Interface method reference: %s, is in an indirect superinterface of %s",
952 Method::name_and_sig_as_C_string(resolved_klass(), 961 Method::name_and_sig_as_C_string(resolved_klass(),