mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 20:44:41 +02:00
7123926: Some CTW test crash: !_control.contains(ctrl)
Don't eliminate Integer::toString() call node during String concatenation optimization if it has several uses. Reviewed-by: twisti
This commit is contained in:
parent
e0cf9c652d
commit
27e9d6f36d
1 changed files with 11 additions and 1 deletions
|
@ -533,7 +533,17 @@ StringConcat* PhaseStringOpts::build_candidate(CallStaticJavaNode* call) {
|
||||||
if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) {
|
if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) {
|
||||||
CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava();
|
CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava();
|
||||||
if (csj->method() != NULL &&
|
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->add_control(csj);
|
||||||
sc->push_int(csj->in(TypeFunc::Parms));
|
sc->push_int(csj->in(TypeFunc::Parms));
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue