RFR: 8336856: Efficient hidden class-based string concatenation strategy [v54]

Claes Redestad redestad at openjdk.org
Tue Aug 13 15:14:02 UTC 2024


On Tue, 13 Aug 2024 09:38:31 GMT, Shaojin Wen <duke at openjdk.org> wrote:

>> This PR implements the same algorithm as the current generateMHInlineCopy based on bytecode to improve startup performance.
>
> Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - remove unused
>  - Minor refactoring

src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java line 1232:

> 1230:             // 1 argment use built-in method
> 1231:             int paramCount  = args.parameterCount();
> 1232:             var concatClass = ConstantUtils.binaryNameToDesc(className);

`String className` and `ClassDesc concatClass` are effectively constant. Refactor to `static final` to save a few instructions.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20273#discussion_r1715473623


More information about the core-libs-dev mailing list