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.
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.
- links to
-
Commit(master) openjdk/jdk/0963b9e8
-
Review(master) openjdk/jdk/21373