Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8341664

ReferenceClassDescImpl cache internalName

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • core-libs
    • None
    • master

      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.

            swen Shaojin Wen
            swen Shaojin Wen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: