hotspot/src/share/vm/opto/stringopts.cpp
changeset 15113 823590505eb4
parent 14828 bb9dffedf46c
child 20716 5093ad743df4
equal deleted inserted replaced
15085:e0b0c4bbad19 15113:823590505eb4
   263         eliminate_call(n->as_Call());
   263         eliminate_call(n->as_Call());
   264       }
   264       }
   265     } else if (n->is_IfTrue()) {
   265     } else if (n->is_IfTrue()) {
   266       Compile* C = _stringopts->C;
   266       Compile* C = _stringopts->C;
   267       C->gvn_replace_by(n, n->in(0)->in(0));
   267       C->gvn_replace_by(n, n->in(0)->in(0));
   268       C->gvn_replace_by(n->in(0), C->top());
   268       // get rid of the other projection
       
   269       C->gvn_replace_by(n->in(0)->as_If()->proj_out(false), C->top());
   269     }
   270     }
   270   }
   271   }
   271 }
   272 }
   272 
   273 
   273 
   274 
   437       if (alloc == NULL) {
   438       if (alloc == NULL) {
   438         break;
   439         break;
   439       }
   440       }
   440       // Find the constructor call
   441       // Find the constructor call
   441       Node* result = alloc->result_cast();
   442       Node* result = alloc->result_cast();
   442       if (result == NULL || !result->is_CheckCastPP()) {
   443       if (result == NULL || !result->is_CheckCastPP() || alloc->in(TypeFunc::Memory)->is_top()) {
   443         // strange looking allocation
   444         // strange looking allocation
   444 #ifndef PRODUCT
   445 #ifndef PRODUCT
   445         if (PrintOptimizeStringConcat) {
   446         if (PrintOptimizeStringConcat) {
   446           tty->print("giving up because allocation looks strange ");
   447           tty->print("giving up because allocation looks strange ");
   447           alloc->jvms()->dump_spec(tty); tty->cr();
   448           alloc->jvms()->dump_spec(tty); tty->cr();
   832           ptr->in(2) != NULL && ptr->in(2)->is_Proj() &&
   833           ptr->in(2) != NULL && ptr->in(2)->is_Proj() &&
   833           ptr->in(1)->in(0) == ptr->in(2)->in(0) &&
   834           ptr->in(1)->in(0) == ptr->in(2)->in(0) &&
   834           ptr->in(1)->in(0) != NULL && ptr->in(1)->in(0)->is_If()) {
   835           ptr->in(1)->in(0) != NULL && ptr->in(1)->in(0)->is_If()) {
   835         // Simple diamond.
   836         // Simple diamond.
   836         // XXX should check for possibly merging stores.  simple data merges are ok.
   837         // XXX should check for possibly merging stores.  simple data merges are ok.
       
   838         // The IGVN will make this simple diamond go away when it
       
   839         // transforms the Region. Make sure it sees it.
       
   840         Compile::current()->record_for_igvn(ptr);
   837         ptr = ptr->in(1)->in(0)->in(0);
   841         ptr = ptr->in(1)->in(0)->in(0);
   838         continue;
   842         continue;
   839       }
   843       }
   840 #ifndef PRODUCT
   844 #ifndef PRODUCT
   841       if (PrintOptimizeStringConcat) {
   845       if (PrintOptimizeStringConcat) {