Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8189163

[Nestmates] Updated invokeInterface selection/resolution rules



    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:


      With reference to the updated JVMS spec.

      On 11/10/2017 6:34 AM, Dan Smith wrote:>> On Oct 8, 2017, at 8:27 PM, David Holmes <David.Holmes@oracle.com> wrote:
      >> 2. This addresses JDK-8024806: invokeinterface may select a non-public method without error, aligning it with invokevirtual.
      >> I'm not at all sure exactly what the intent or consequence of this is. If I'm trying to invoke a private interface method and I find it, then obviously I don't want IAE thrown. But if I'm expecting to invoke a non-private method and I find a private one instead, then I do not expect the private method to be invoked! What exactly will this change allow?
      > Old behavior:
      > 1) Perform resolution. If resolved method is private, ICCE. (Otherwise, resolved method is public.)
      > 2) Perform selection. If selected method is not public, IAE.
      > New behavior:
      > - Resolving to a private interface method is fine, selection will select that same method (due to the revised rules), which is also fine.
      > - If I resolve to a public method and select a package or protected method, that's allowed, too.
      > (Note that it is impossible to resolve to a public method and select a private method, due to the revised selection rules.)
      > The first bullet is the behavior we need to make nestmates work. The second bullet addresses technical debt by eliminating an unnecessary distinction between invokevirtual and invokeinterface.

      We need to ensure we have tests that verify these rules - and that the implemented selection/resolution processes follow them.




            dholmes David Holmes
            dholmes David Holmes
            0 Vote for this issue
            2 Start watching this issue