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

Simplify and eagerly initialize StringConcatFactory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 15
    • None
    • core-libs
    • None

      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.

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

              Created:
              Updated:
              Resolved: