CONSTANT_Dynamic bootstrap signature restriction
daniel.smith at oracle.com
Wed Mar 7 21:52:32 UTC 2018
> On Mar 7, 2018, at 7:48 AM, Remi Forax <forax at univ-mlv.fr> wrote:
>> This might not pan out, and if so we can drop the error check and return to where we were.
>> But it seems promising, and we don't want to get stuck in 11 making compatibility promises
>> about the interpretation of things like 'bootstrap(Object... args)'.
> I think it's too late for that, once we had said that the bsm is called with methodhandle.invoke (or more recently invokeWithArguments), bootstrap(Object... args) is already a valid construct.
The proposed rule detects a CONSTANT_Dynamic bootstrap of this form and rejects it, because the first parameter's type is not Lookup. This is an explicit check, not a side-effect of invokeWithArguments.
In a plausible future (one that we want to make space for), rather than reporting an error, CONSTANT_Dynamic resolution will notice the lack of Lookup as a first parameter, and so pass an argument array to invokeWithArguments that doesn't contain the Lookup, name, or type.
More information about the valhalla-spec-observers