On Sun, 6 Oct 2024 01:22:33 GMT, Shaojin Wen <s...@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

Reply via email to