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

5.4.3.6: Require first parameter type of a condy bootstrap to be Lookup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 11
    • 11
    • specification
    • vm

    Description

      CONSTANT_Dynamic resolution occurs by invoking a bootstrap method via 'invokeWithArguments', passing an array of arguments. The first three arguments are invocation metadata—a Lookup, a name, and a Class. If the arguments can't be cast to the bootstrap method's input types, the invocation fails.

      To facilitate more flexible bootstrap method calling conventions in the future, we'd like to require that the first parameter has type MethodHandles.Lookup. If a bootstrap does not conform, an error will occur, with the possibility of using a different calling convention in the future.

      This change rejects bootstraps like the following, which can currently be invoked without error:
      static Foo bootstrap(Object lookup, String name, Class<?> type)
      static Foo bootstrap(Object... args)

      For compatibility, no change is proposed to the resolution behavior for invokedynamic bootstraps.

      Attachments

        Issue Links

          Activity

            People

              abuckley Alex Buckley
              dlsmith Dan Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: