United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6892658 C2 should optimize some stringbuilder patterns
JDK-6892658 : C2 should optimize some stringbuilder patterns

Details
Type:
Enhancement
Submit Date:
2009-10-16
Status:
Closed
Updated Date:
2011-09-08
Project Name:
JDK
Resolved Date:
2010-01-15
Component:
hotspot
OS:
solaris_9,generic,windows_xp
Sub-Component:
compiler
CPU:
x86,sparc,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs17,hs22.5,6,7
Fixed Versions:
hs16 (b12)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
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.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/baseline/rev/1a1b644fe617
                                     
2009-11-12
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/master/rev/1a1b644fe617
                                     
2009-11-13
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/7c57aead6d3e
                                     
2009-12-01



Hardware and Software, Engineered to Work Together