changeset 5825:8b0587cd6277

8190478: Improved interface method selection Reviewed-by: acorn, ahgross, jwilhelm, rhalade Contributed-by: harold.seigel@oracle.com
author hseigel
date Sat, 14 Apr 2018 07:26:03 +0100
parents 13fda368122a
children 7d1eb0dcab5a
files src/share/vm/oops/cpCacheOop.cpp
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/oops/cpCacheOop.cpp	Tue Apr 10 22:46:22 2018 +0100
+++ b/src/share/vm/oops/cpCacheOop.cpp	Sat Apr 14 07:26:03 2018 +0100
@@ -231,14 +231,13 @@
       // virtual method in java.lang.Object. This is a corner case in the spec
       // but is presumably legal. javac does not generate this code.
       //
-      // We set bytecode_1() to _invokeinterface, because that is the
-      // bytecode # used by the interpreter to see if it is resolved.
+      // We do not set bytecode_1() to _invokeinterface, because that is the
+      // bytecode # used by the interpreter to see if it is resolved.  In this
+      // case, the method gets reresolved with caller for each interface call
+      // because the actual selected method may not be public.
+      //
       // We set bytecode_2() to _invokevirtual.
       // See also interpreterRuntime.cpp. (8/25/2000)
-      // Only set resolved for the invokeinterface case if method is public.
-      // Otherwise, the method needs to be reresolved with caller for each
-      // interface call.
-      if (method->is_public()) set_bytecode_1(invoke_code);
     } else {
       assert(invoke_code == Bytecodes::_invokevirtual, "");
     }