RFR: 8028739: javac generates incorrect descriptor for MethodHandle::invoke

Robert Field robert.field at oracle.com
Fri Nov 22 13:13:04 PST 2013


On 11/22/13 12:59, Jonathan Gibbons wrote:
> Robert,
>
> In this code:
>> 2121             final boolean isSignaturePolymorphic() {
>> 2122                 return  tree.sym instanceof MethodSymbol &&
>> 2123                         types.isSignaturePolymorphic((MethodSymbol)tree.sym);
>> 2124             }
> it is not javac style to do instanceof like that -- the normal style is
> to check the kind, as in
>       tree.sym.kind == MTH

OK.

Even if you are about to do a cast?

-Robert

>
> -- Jon
>
>
>
>
> On 11/22/2013 10:31 AM, Robert Field wrote:
>> Thanks John!
>>
>> Updated webrev:
>>
>> http://cr.openjdk.java.net/~rfield/8028739v1/
>> <http://cr.openjdk.java.net/%7Erfield/8028739v1/>
>>
>> Only change is to use the pre-existing test for signature polymorphic:
>>
>> 2121             final boolean isSignaturePolymorphic() {
>> 2122                 return  tree.sym instanceof MethodSymbol &&
>> 2123                         types.isSignaturePolymorphic((MethodSymbol)tree.sym);
>> 2124             }
>>
>>
>> -Robert
>>
>>
>> On 11/21/13 22:55, John Rose wrote:
>>> I think you will get a false positive on MethodHandle.invokeWithArguments.
>>>
>>> There are more precise tests for sig. polymorphism. It must be native final; the code should check for that.
>>>
>>> -- John  (on my iPhone)
>>>
>>> On Nov 21, 2013, at 8:21 PM, Robert Field <robert.field at oracle.com> wrote:
>>>
>>>> Please review fix for:
>>>>
>>>> https://bugs.openjdk.java.net/browse/JDK-8028739
>>>>
>>>> Webrev:
>>>>
>>>> http://cr.openjdk.java.net/~rfield/8028739v0/
>>>> <http://cr.openjdk.java.net/%7Erfield/8028739v0/>
>>>>
>>>> Thank you,
>>>> Robert
>>>>
>>>>
>



More information about the lambda-dev mailing list