On Tue, 14 Feb 2023 11:16:26 GMT, Sergey Tsypanov <stsypa...@openjdk.org> wrote:
>> Mandy Chung has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains three additional >> commits since the last revision: >> >> - Merge branch 'master' of https://github.com/openjdk/jdk into JDK-8301460 >> - further clean up >> - JDK-8301460: Code in LambdaForm.java still refers to resolved JDK-8161245 > > src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java line 368: > >> 366: SpeciesData sd = extensions[typeNum]; >> 367: if (sd != null) return sd; >> 368: sd = SPECIALIZER.findSpecies(key() + >> basicType.basicTypeChar()); > > As soon as this is `java.base` I suggest to replace `key() + > basicType.basicTypeChar()` with > `key().concat(String.valueOf(basicType.basicTypeChar()))` to prevent > `StringBuilder` allocation and `append()` chaining. There are only 5 elements in `extensions` arrays for 5 `BasicType`. I don't think this overhead is significant. ------------- PR: https://git.openjdk.org/jdk/pull/12546