RFR (S) 8024635: Caching MethodType's descriptor string improves lambda linkage performance

Mandy Chung mandy.chung at oracle.com
Thu Oct 31 20:49:21 UTC 2013


On 10/31/2013 1:38 PM, John Rose wrote:
> On Oct 31, 2013, at 1:05 PM, Mandy Chung <mandy.chung at oracle.com 
> <mailto:mandy.chung at oracle.com>> wrote:
>
>> Nit: maybe better to merge two constructors to explicitly specify if 
>> it wants to skip the parameter validations (not sure if there is any 
>> reason for the rtype and ptypes parameter order is different in the 
>> two ctors)
>>
>> 107     private MethodType(Class<?> rtype, Class<?>[] ptypes, boolean 
>> trusted) {
>> 118     private MethodType(Class<?>[] ptypes, Class<?> rtype) {
>
> The backwards constructor is dangerous since it doesn't check 
> parameters; I don't want it to be used by accident.
>
> There isn't a good design pattern for this; I want a constructor named 
> "fake_MethodType_for_table_probe".
>

That's what I want too.

> I suppose I could have used as leading argument of type Unsafe to mark 
> the condition.
>
> A flag does not seem clear enough.  I don't want to factor together 
> checked and unchecked versions of the constructor.
>
> I will add a comment about the odd constructor.  Should I add a 
> strange extra argument instead of swapping the parameters, or is that 
> overkill?

Either way would help.  I actually like the idea of adding a leading 
Unsafe argument that speaks for itself and I presume it doesn't impact 
the performance.

Mandy



More information about the core-libs-dev mailing list