Mercurial > hg > truffle
comparison src/share/vm/opto/stringopts.cpp @ 6223:ed21db7b3fda
7123926: Some CTW test crash: !_control.contains(ctrl)
Summary: Don't eliminate Integer::toString() call node during String concatenation optimization if it has several uses.
Reviewed-by: twisti
author | kvn |
---|---|
date | Fri, 13 Jul 2012 17:48:26 -0700 |
parents | 751bd303aa45 |
children | e626685e9f6c |
comparison
equal
deleted
inserted
replaced
6222:6d8f36bcef55 | 6223:ed21db7b3fda |
---|---|
531 sc->push_char(arg); | 531 sc->push_char(arg); |
532 } else { | 532 } else { |
533 if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { | 533 if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { |
534 CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); | 534 CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); |
535 if (csj->method() != NULL && | 535 if (csj->method() != NULL && |
536 csj->method()->intrinsic_id() == vmIntrinsics::_Integer_toString) { | 536 csj->method()->intrinsic_id() == vmIntrinsics::_Integer_toString && |
537 arg->outcnt() == 1) { | |
538 // _control is the list of StringBuilder calls nodes which | |
539 // will be replaced by new String code after this optimization. | |
540 // Integer::toString() call is not part of StringBuilder calls | |
541 // chain. It could be eliminated only if its result is used | |
542 // only by this SB calls chain. | |
543 // Another limitation: it should be used only once because | |
544 // it is unknown that it is used only by this SB calls chain | |
545 // until all related SB calls nodes are collected. | |
546 assert(arg->unique_out() == cnode, "sanity"); | |
537 sc->add_control(csj); | 547 sc->add_control(csj); |
538 sc->push_int(csj->in(TypeFunc::Parms)); | 548 sc->push_int(csj->in(TypeFunc::Parms)); |
539 continue; | 549 continue; |
540 } | 550 } |
541 } | 551 } |