# HG changeset patch # User andrew # Date 1360053877 0 # Node ID 76c46d4d4ad04e444f0981a559ceff81c74bf1b9 # Parent 3f345e5f65eba764ba9e6c64e3102f05877772bf 8001307: Modify ACC_SUPER behavior Summary: Disallow non-virtual calls even when ACC_SUPER is absent. Reviewed-by: kvn, acorn diff -r 3f345e5f65eb -r 76c46d4d4ad0 src/share/vm/interpreter/linkResolver.cpp --- a/src/share/vm/interpreter/linkResolver.cpp Mon Jan 14 22:22:14 2013 +0000 +++ b/src/share/vm/interpreter/linkResolver.cpp Tue Feb 05 08:44:37 2013 +0000 @@ -709,7 +709,7 @@ if (check_access && // a) check if ACC_SUPER flag is set for the current class - current_klass->is_super() && + (current_klass->is_super() || !AllowNonVirtualCalls) && // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!) current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() && // c) check if the method is not diff -r 3f345e5f65eb -r 76c46d4d4ad0 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon Jan 14 22:22:14 2013 +0000 +++ b/src/share/vm/runtime/globals.hpp Tue Feb 05 08:44:37 2013 +0000 @@ -3837,7 +3837,10 @@ product(bool, UseVMInterruptibleIO, false, \ "(Unstable, Solaris-specific) Thread interrupt before or with " \ "EINTR for I/O operations results in OS_INTRPT. The default value"\ - " of this flag is true for JDK 6 and earliers") + " of this flag is true for JDK 6 and earlier") \ + \ + product(bool, AllowNonVirtualCalls, false, \ + "Obey the ACC_SUPER flag and allow invokenonvirtual calls") /* * Macros for factoring of globals