aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto
diff options
context:
space:
mode:
authorkvn <none@none>2012-07-16 19:50:52 -0700
committerkvn <none@none>2012-07-16 19:50:52 -0700
commit667a00b2341cafe85c9b954f6073ca138e7f48e3 (patch)
tree5f75d6e869b25b522f0c8c6f354c0928320b5d4a /src/share/vm/opto
parentabf2e7a5fcee76ab34091515d7cb64decf537bc2 (diff)
parent713d7cad56e96880d095a4837ed231acd0760530 (diff)
Merge
Diffstat (limited to 'src/share/vm/opto')
-rw-r--r--src/share/vm/opto/stringopts.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/share/vm/opto/stringopts.cpp b/src/share/vm/opto/stringopts.cpp
index d606a7fda..803b13899 100644
--- a/src/share/vm/opto/stringopts.cpp
+++ b/src/share/vm/opto/stringopts.cpp
@@ -533,7 +533,17 @@ StringConcat* PhaseStringOpts::build_candidate(CallStaticJavaNode* call) {
if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) {
CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava();
if (csj->method() != NULL &&
- csj->method()->intrinsic_id() == vmIntrinsics::_Integer_toString) {
+ csj->method()->intrinsic_id() == vmIntrinsics::_Integer_toString &&
+ arg->outcnt() == 1) {
+ // _control is the list of StringBuilder calls nodes which
+ // will be replaced by new String code after this optimization.
+ // Integer::toString() call is not part of StringBuilder calls
+ // chain. It could be eliminated only if its result is used
+ // only by this SB calls chain.
+ // Another limitation: it should be used only once because
+ // it is unknown that it is used only by this SB calls chain
+ // until all related SB calls nodes are collected.
+ assert(arg->unique_out() == cnode, "sanity");
sc->add_control(csj);
sc->push_int(csj->in(TypeFunc::Parms));
continue;