< prev index next >

src/hotspot/share/opto/stringopts.cpp

Print this page

 329         result->append(other->argument(y), other->mode(y));
 330       }
 331     } else {
 332       result->append(argx, mode(x));
 333     }
 334   }
 335   result->set_allocation(other->_begin);
 336   for (uint i = 0; i < _constructors.size(); i++) {
 337     result->add_constructor(_constructors.at(i));
 338   }
 339   for (uint i = 0; i < other->_constructors.size(); i++) {
 340     result->add_constructor(other->_constructors.at(i));
 341   }
 342   result->_multiple = true;
 343   return result;
 344 }
 345 
 346 
 347 void StringConcat::eliminate_call(CallNode* call) {
 348   Compile* C = _stringopts->C;
 349   CallProjections projs;
 350   call->extract_projections(&projs, false);
 351   if (projs.fallthrough_catchproj != NULL) {
 352     C->gvn_replace_by(projs.fallthrough_catchproj, call->in(TypeFunc::Control));
 353   }
 354   if (projs.fallthrough_memproj != NULL) {
 355     C->gvn_replace_by(projs.fallthrough_memproj, call->in(TypeFunc::Memory));
 356   }
 357   if (projs.catchall_memproj != NULL) {
 358     C->gvn_replace_by(projs.catchall_memproj, C->top());
 359   }
 360   if (projs.fallthrough_ioproj != NULL) {
 361     C->gvn_replace_by(projs.fallthrough_ioproj, call->in(TypeFunc::I_O));
 362   }
 363   if (projs.catchall_ioproj != NULL) {
 364     C->gvn_replace_by(projs.catchall_ioproj, C->top());
 365   }
 366   if (projs.catchall_catchproj != NULL) {
 367     // EA can't cope with the partially collapsed graph this
 368     // creates so put it on the worklist to be collapsed later.
 369     for (SimpleDUIterator i(projs.catchall_catchproj); i.has_next(); i.next()) {
 370       Node *use = i.get();
 371       int opc = use->Opcode();
 372       if (opc == Op_CreateEx || opc == Op_Region) {
 373         _stringopts->record_dead_node(use);
 374       }
 375     }
 376     C->gvn_replace_by(projs.catchall_catchproj, C->top());
 377   }
 378   if (projs.resproj != NULL) {
 379     C->gvn_replace_by(projs.resproj, C->top());

 380   }
 381   C->gvn_replace_by(call, C->top());
 382 }
 383 
 384 void StringConcat::eliminate_initialize(InitializeNode* init) {
 385   Compile* C = _stringopts->C;
 386 
 387   // Eliminate Initialize node.
 388   assert(init->outcnt() <= 2, "only a control and memory projection expected");
 389   assert(init->req() <= InitializeNode::RawStores, "no pending inits");
 390   Node *ctrl_proj = init->proj_out_or_null(TypeFunc::Control);
 391   if (ctrl_proj != NULL) {
 392     C->gvn_replace_by(ctrl_proj, init->in(TypeFunc::Control));
 393   }
 394   Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);
 395   if (mem_proj != NULL) {
 396     Node *mem = init->in(TypeFunc::Memory);
 397     C->gvn_replace_by(mem_proj, mem);
 398   }
 399   C->gvn_replace_by(init, C->top());

 329         result->append(other->argument(y), other->mode(y));
 330       }
 331     } else {
 332       result->append(argx, mode(x));
 333     }
 334   }
 335   result->set_allocation(other->_begin);
 336   for (uint i = 0; i < _constructors.size(); i++) {
 337     result->add_constructor(_constructors.at(i));
 338   }
 339   for (uint i = 0; i < other->_constructors.size(); i++) {
 340     result->add_constructor(other->_constructors.at(i));
 341   }
 342   result->_multiple = true;
 343   return result;
 344 }
 345 
 346 
 347 void StringConcat::eliminate_call(CallNode* call) {
 348   Compile* C = _stringopts->C;
 349   CallProjections* projs = call->extract_projections(false);
 350   if (projs->fallthrough_catchproj != NULL) {
 351     C->gvn_replace_by(projs->fallthrough_catchproj, call->in(TypeFunc::Control));

 352   }
 353   if (projs->fallthrough_memproj != NULL) {
 354     C->gvn_replace_by(projs->fallthrough_memproj, call->in(TypeFunc::Memory));
 355   }
 356   if (projs->catchall_memproj != NULL) {
 357     C->gvn_replace_by(projs->catchall_memproj, C->top());
 358   }
 359   if (projs->fallthrough_ioproj != NULL) {
 360     C->gvn_replace_by(projs->fallthrough_ioproj, call->in(TypeFunc::I_O));
 361   }
 362   if (projs->catchall_ioproj != NULL) {
 363     C->gvn_replace_by(projs->catchall_ioproj, C->top());
 364   }
 365   if (projs->catchall_catchproj != NULL) {
 366     // EA can't cope with the partially collapsed graph this
 367     // creates so put it on the worklist to be collapsed later.
 368     for (SimpleDUIterator i(projs->catchall_catchproj); i.has_next(); i.next()) {
 369       Node *use = i.get();
 370       int opc = use->Opcode();
 371       if (opc == Op_CreateEx || opc == Op_Region) {
 372         _stringopts->record_dead_node(use);
 373       }
 374     }
 375     C->gvn_replace_by(projs->catchall_catchproj, C->top());
 376   }
 377   if (projs->resproj[0] != NULL) {
 378     assert(projs->nb_resproj == 1, "unexpected number of results");
 379     C->gvn_replace_by(projs->resproj[0], C->top());
 380   }
 381   C->gvn_replace_by(call, C->top());
 382 }
 383 
 384 void StringConcat::eliminate_initialize(InitializeNode* init) {
 385   Compile* C = _stringopts->C;
 386 
 387   // Eliminate Initialize node.
 388   assert(init->outcnt() <= 2, "only a control and memory projection expected");
 389   assert(init->req() <= InitializeNode::RawStores, "no pending inits");
 390   Node *ctrl_proj = init->proj_out_or_null(TypeFunc::Control);
 391   if (ctrl_proj != NULL) {
 392     C->gvn_replace_by(ctrl_proj, init->in(TypeFunc::Control));
 393   }
 394   Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);
 395   if (mem_proj != NULL) {
 396     Node *mem = init->in(TypeFunc::Memory);
 397     C->gvn_replace_by(mem_proj, mem);
 398   }
 399   C->gvn_replace_by(init, C->top());
< prev index next >