changeset 48130:e0cc140aabc3 nestmates

8193112: [Nestmates] Remove nestmate access check from invokespecial interface invocation check Reviewed-by: acorn
author dholmes
date Wed, 06 Dec 2017 16:27:34 -0500
parents c01b0975db3c
children 4f9cf77aa0ee
files src/hotspot/share/interpreter/linkResolver.cpp
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/interpreter/linkResolver.cpp	Mon Dec 04 22:41:54 2017 -0500
+++ b/src/hotspot/share/interpreter/linkResolver.cpp	Wed Dec 06 16:27:34 2017 -0500
@@ -1146,8 +1146,7 @@
     return NULL;
   }
 
-  // check that invokespecial's interface method reference is in a direct superinterface,
-  // unless we are dealing with nestmates.
+  // check that invokespecial's interface method reference is in an indirect superinterface
   Klass* current_klass = link_info.current_klass();
   if (current_klass != NULL && resolved_klass->is_interface()) {
     InstanceKlass* ck = InstanceKlass::cast(current_klass);
@@ -1159,13 +1158,11 @@
                         SystemDictionary::reflect_MagicAccessorImpl_klass());
 
     if (!is_reflect &&
-        !klass_to_check->is_same_or_direct_interface(resolved_klass) &&
-        (ck == klass_to_check && // don't check nestmate access for anonymous classes
-         !klass_to_check->has_nestmate_access_to(InstanceKlass::cast(resolved_klass), THREAD))) {
+        !klass_to_check->is_same_or_direct_interface(resolved_klass)) {
       ResourceMark rm(THREAD);
       char buf[200];
       jio_snprintf(buf, sizeof(buf),
-                   "Interface method reference: %s, is not in a direct superinterface of %s",
+                   "Interface method reference: %s, is in an indirect superinterface of %s",
                    Method::name_and_sig_as_C_string(resolved_klass,
                                                                            resolved_method->name(),
                                                                            resolved_method->signature()),