RFR (S) 8024635: Caching MethodType's descriptor string improves lambda linkage performance
John Rose
john.r.rose at oracle.com
Thu Oct 31 20:38:34 UTC 2013
On Oct 31, 2013, at 1:05 PM, Mandy Chung <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".
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?
Thanks for the review.
— John
More information about the core-libs-dev
mailing list