8190478: Improved interface method selection

Tue, 05 Dec 2017 13:25:09 -0500

author
hseigel
date
Tue, 05 Dec 2017 13:25:09 -0500
changeset 9076
07275619e52e
parent 9075
48900d625d66
child 9077
d487949b2e97

8190478: Improved interface method selection
Reviewed-by: acorn, ahgross, jwilhelm, rhalade
Contributed-by: harold.seigel@oracle.com

src/share/vm/oops/cpCache.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/oops/cpCache.cpp	Tue Nov 28 12:14:30 2017 +0100
     1.2 +++ b/src/share/vm/oops/cpCache.cpp	Tue Dec 05 13:25:09 2017 -0500
     1.3 @@ -226,14 +226,13 @@
     1.4        // virtual method in java.lang.Object. This is a corner case in the spec
     1.5        // but is presumably legal. javac does not generate this code.
     1.6        //
     1.7 -      // We set bytecode_1() to _invokeinterface, because that is the
     1.8 -      // bytecode # used by the interpreter to see if it is resolved.
     1.9 +      // We do not set bytecode_1() to _invokeinterface, because that is the
    1.10 +      // bytecode # used by the interpreter to see if it is resolved.  In this
    1.11 +      // case, the method gets reresolved with caller for each interface call
    1.12 +      // because the actual selected method may not be public.
    1.13 +      //
    1.14        // We set bytecode_2() to _invokevirtual.
    1.15        // See also interpreterRuntime.cpp. (8/25/2000)
    1.16 -      // Only set resolved for the invokeinterface case if method is public.
    1.17 -      // Otherwise, the method needs to be reresolved with caller for each
    1.18 -      // interface call.
    1.19 -      if (method->is_public()) set_bytecode_1(invoke_code);
    1.20      } else {
    1.21        assert(invoke_code == Bytecodes::_invokevirtual, "");
    1.22      }

mercurial