RFR: 8332457: Examine startup overheads from JDK-8294961 [v19]

Claes Redestad redestad at openjdk.org
Fri Jun 7 08:52:18 UTC 2024


On Wed, 5 Jun 2024 12:39:13 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   An assortment of potential improvements
>>   
>>   Co-authored-by: Claes Redestad <redestad at openjdk.org>
>
> src/java.base/share/classes/java/lang/constant/ConstantDescs.java line 356:
> 
>> 354:         ClassDesc[] fullParamTypes = new ClassDesc[paramTypes.length + prefixLen];
>> 355:         System.arraycopy(INDY_BOOTSTRAP_ARGS, 0, fullParamTypes, 0, prefixLen);
>> 356:         System.arraycopy(paramTypes, 0, fullParamTypes, prefixLen, paramTypes.length);
> 
> I'm thinking about creating a basic MethodTypeDesc like `INDY_BOOTSTRAP_TYPE = MethodTypeDesc.ofValidated(CD_Object, INDY_BOOTSTRAP_ARGS)`, and we derive bsm with 
> 
> INDY_BOOTSTRAP_TYPE
>     .insertParameterTypes(INDY_BOOTSTRAP_TYPE.parameterCount(), paramTypes)
>     .changeReturnType(returnType)
> 
> which creates two MTD wrappers but they share the same parameter array

That'd arguably be a bit cleaner. Might allocate an extra MTD (unless/until EA kicks in), but that might not matter really.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1630868455


More information about the core-libs-dev mailing list