Review Request: JDK-8225462: [lworld] MethodHandle support of the static <init> factory method

Mandy Chung mandy.chung at oracle.com
Mon Jun 10 15:51:20 UTC 2019



On 6/10/19 8:27 AM, Roger Riggs wrote:
> Hi Mandy,
>
> On the renaming to ObjectConstructor, can it be more specific to 
> reference object types (if that terminology is settled).
> (inline class values are Objects too).
> (I suppose it will be easy to do a global search/replace later).
>

I would wait to do the renaming when we settle on the terminologies.   
At least both JDK and hotspot implementation are consistent in these 
terms (is_object_constructor and is_static_init_factory [1]).

> InfoFromMemberName:
>
> 117/121: Would the message be clearer as?
> "object constructor must have return type void"
> "inline class constructor must have return type " + 
> getDeclaringClass().getName()
>

This could be indirect class as well.   This error is very rare and so I 
think we can update it when the terminologies are settled.


Thanks
Mandy

[1] 
http://hg.openjdk.java.net/valhalla/valhalla/file/46a46d8679df/src/hotspot/share/oops/method.hpp#l696

> Looks ok, Roger
>
>
>
>
> On 06/07/2019 06:02 PM, Mandy Chung wrote:
>> Hi Roger,
>>
>> This patch fixes a few issues in java.lang.invoke implementation when 
>> accessing the static init factories. findStatic allows to find the 
>> static init factory whereas findConstructor remains only finding the 
>> object constructor.  This patch does some renaming w.r.t. object 
>> constructor vs static init factory to make distinction clear.
>>
>> I ran into JDK-8225079 when I tried Constructor::newInstance with 
>> your patch.   I currently uncomment the validation involved 
>> Constructor::newInstance in StaticInitFactoryTest.
> Harold has proposed a fix in comments for 8225079.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/lw2/8225462/webrev.00/ 
>>
>>
>> Mandy
>



More information about the valhalla-dev mailing list