RFR (XS): 8224110 [lworld] Reflective method invocation fails with assert: "illegal type"

Mandy Chung mandy.chung at oracle.com
Wed Jun 12 20:49:57 UTC 2019


David,

I expect "java.lang.IllegalArgumentException: wrong number of arguments" 
should be
thrown if MyValue3[] is passed to Method::invoke as a varargs (as 
opposed to
a single-element array parameter.

A bug is lying somewhere.  [1] is where IAE is being thrown.

Mandy
[1] 
http://hg.openjdk.java.net/valhalla/valhalla/file/f8687d139418/src/hotspot/share/runtime/reflection.cpp#l1147


On 6/12/19 9:53 AM, David Simms wrote:
>
> Updated the bug with comment, I was about say, sure let's use inline 
> type array if you want. But the use cases are thin:
>
> "The more I think about it the less I think we should allow inline 
> type array, not useless all the method args the same inline type, ie:
>
> "test(MyValue3 v1, MyValue3 v2, MyValue3 v3)", then passing MyValue3[] 
> would make sense...but only when all the arg types are the 
> same...seems like an edge case"
>
> All the parameter types have to be the same...is that worth a special 
> case ?
>
>
> On 12/06/2019 16:52, Roger Riggs wrote:
>> Hi,
>>
>> Would this be just a temporary restriction?
>> I could see the benefits of being able to use an inline array class 
>> for varargs.
>>
>> ?, Roger
>>
>> On 06/12/2019 09:27 AM, David Simms wrote:
>>> Greetings,
>>>
>>> Please review this small fix to prevent "inline type" arrays being 
>>> sent directly "JVM_InvokeMethod" and 
>>> "JVM_NewInstanceFromConstructor". I don't believe it is the 
>>> intention of these methods to receive such a type, in the original 
>>> problem, there was a javac warning of passing arg[0] implicitly 
>>> converted to args array.
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8224110
>>>
>>> Webrev: http://cr.openjdk.java.net/~dsimms/valhalla/8224110/
>>>
>>>
>>




More information about the valhalla-dev mailing list