RFR: 8341664: ReferenceClassDescImpl cache internalName
Shaojin Wen
swen at openjdk.org
Mon Oct 7 16:49:05 UTC 2024
On Sun, 6 Oct 2024 01:22:33 GMT, Shaojin Wen <swen at openjdk.org> wrote:
> ReferenceClassDescImpl caches internalName to avoid creating a new String object for each call, which can also simplify the implementation of classfile.
In many scenarios where classfile is used, ClassDesc is cached by statically declaring constants, such as InvokerBytecodeGenerator/StringConcatFactory.
However, internalName is generated by subString every time bytecode is built, which means that the purpose of caching ClassDesc is not fully achieved.
This problem can be solved by caching internalName.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21373#issuecomment-2395482862
More information about the core-libs-dev
mailing list