From d85cc43f84f943c6d04636e0acee7577c2ad5421 Mon Sep 17 00:00:00 2001 From: hseigel Date: Tue, 5 Dec 2017 13:25:09 -0500 Subject: [PATCH] 8190478: Improved interface method selection Reviewed-by: acorn, ahgross, jwilhelm, rhalade Contributed-by: harold.seigel@oracle.com --- src/share/vm/oops/cpCache.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/share/vm/oops/cpCache.cpp b/src/share/vm/oops/cpCache.cpp index e8838a644..8899fa7b9 100644 --- a/src/share/vm/oops/cpCache.cpp +++ b/src/share/vm/oops/cpCache.cpp @@ -226,14 +226,13 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co // 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, ""); } -- GitLab