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

Chen Liang liach at openjdk.org
Wed Jun 5 12:43:01 UTC 2024


On Wed, 5 Jun 2024 12:00:25 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> [JDK-8294961](https://bugs.openjdk.org/browse/JDK-8294961) changed to use classfile API for reflection proxy-generation. Actual implementation of `ProxyGenerator` is focused on performance, however it causes JDK bootstrap regressions. `ProxyGenerator.TEMPLATE` class model is statically created and each proxy class is transformed from the template.
>> 
>> This patch is intended to examine plain proxy generation impact on performance and JDK bootstrap (vs proxy transformation from template).
>> 
>> The generated proxy is migrated from static initialization to CONDY bootstrap.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> 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

test/micro/org/openjdk/bench/java/lang/reflect/ProxyGenBench.java line 2:

> 1: /*
> 2:  * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.

Suggestion:

 * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.

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

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


More information about the core-libs-dev mailing list