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

Simplify and eagerly initialize StringConcatFactory

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:
      None

      Description

      JDK-8155090 added some measures to StringConcatFactory to prevent issues with a security manager that does string concatenation. As an alternative approach, we should consider eagerly initializing the StringConcatFactory base class during bootstrap.

      Doing so will add minute overhead to bootstrap - which will be amortized on first use of SCF. This would also be a good opportunity to clean up and improve the initialization.

      For example, the CACHE and CACHE_ENABLE fields can be moved to BytecodeStringBuilderStrategy, since it's the only place where we actually have implemented caching (the MethodHandle based strategies rely on LF sharing to de-duplicate shared). This reduces the initialization overhead of SCF for the default case.

        Attachments

          Activity

            People

            • Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: