-
Enhancement
-
Resolution: Fixed
-
P3
-
11
-
None
-
b09
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.
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.
- csr for
-
JDK-8201268 Require first parameter type of a condy bootstrap to be Lookup
-
- Closed
-
- relates to
-
JDK-8199051 5.4.3.6: Require first parameter type of a condy bootstrap to be Lookup
-
- Resolved
-
-
JDK-8206177 Invoke dynamic constant bootstrap methods that are ordinary static methods
-
- Open
-