RFR(M): Tiered: incorrect results in VM tests stringconcat with -Xcomp -XX:+DeoptimizeALot on solaris-amd64

Igor Veresov igor.veresov at oracle.com
Wed Oct 9 15:11:04 PDT 2013

String concat optimization optimization collapses the pattern

StringBuffer x = new StringBuffer();

into a single allocation of a string and forming the result directly. All possible deopts that may happen in the optimized code restart this pattern from the beginning (starting from the StringBuffer allocation). That means that the whole pattern must me side-effect free.  Existing code verifies that the pattern is sound from the control flow point of view, but omits the memory flow verification. This leaves a possibility for a computation on an argument of append() to have side effects. The fix adds memory flow analysis to find the possibly offending stores. We iterate up the memory graph (doing DFS) finding all possible simple paths starting from an append call, until we see the next append call, or a StringBuffer constructor.  Then we analyze the path to see if it contains side effects. The analysis is exponential, so we limit the number of iterations.

Webrev: http://cr.openjdk.java.net/~iveresov/8009303/webrev/

Testing: eyeballing the graph, the failing tests, jprt


More information about the hotspot-compiler-dev mailing list