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

C2 should optimize some stringbuilder patterns

XMLWordPrintable

    • b12
    • generic, x86, sparc
    • generic, solaris_9, windows_xp
    • Not verified

        There are many common patterns of string concatenation using StringBuilder that could be transformed into much more efficient patterns. StringBuilder has some assumptions that it might be used in a persistent way that result in many extra copies and intermediate values being produced. Transforming these patterns into an optimal set of string operations can greatly speed up these operations.

        Doing this within in the context of hotspot has some extra complexity because of deoptimization. It always has to be possible to recover a valid execution state where you can resume in the interpeter. This we can handled by introducing a transactional style of code generation where an early JVMState capture the starting point and any uncommon traps lead back to that execution point. Any code like allocations also reuses that point to describe the current state.

              never Tom Rodriguez
              never Tom Rodriguez
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: