305 result->append(other->argument(y), other->mode(y));
306 }
307 } else {
308 result->append(argx, mode(x));
309 }
310 }
311 result->set_allocation(other->_begin);
312 for (uint i = 0; i < _constructors.size(); i++) {
313 result->add_constructor(_constructors.at(i));
314 }
315 for (uint i = 0; i < other->_constructors.size(); i++) {
316 result->add_constructor(other->_constructors.at(i));
317 }
318 result->_multiple = true;
319 return result;
320 }
321
322
323 void StringConcat::eliminate_call(CallNode* call) {
324 Compile* C = _stringopts->C;
325 CallProjections projs;
326 call->extract_projections(&projs, false);
327 if (projs.fallthrough_catchproj != NULL) {
328 C->gvn_replace_by(projs.fallthrough_catchproj, call->in(TypeFunc::Control));
329 }
330 if (projs.fallthrough_memproj != NULL) {
331 C->gvn_replace_by(projs.fallthrough_memproj, call->in(TypeFunc::Memory));
332 }
333 if (projs.catchall_memproj != NULL) {
334 C->gvn_replace_by(projs.catchall_memproj, C->top());
335 }
336 if (projs.fallthrough_ioproj != NULL) {
337 C->gvn_replace_by(projs.fallthrough_ioproj, call->in(TypeFunc::I_O));
338 }
339 if (projs.catchall_ioproj != NULL) {
340 C->gvn_replace_by(projs.catchall_ioproj, C->top());
341 }
342 if (projs.catchall_catchproj != NULL) {
343 // EA can't cope with the partially collapsed graph this
344 // creates so put it on the worklist to be collapsed later.
345 for (SimpleDUIterator i(projs.catchall_catchproj); i.has_next(); i.next()) {
346 Node *use = i.get();
347 int opc = use->Opcode();
348 if (opc == Op_CreateEx || opc == Op_Region) {
349 _stringopts->record_dead_node(use);
350 }
351 }
352 C->gvn_replace_by(projs.catchall_catchproj, C->top());
353 }
354 if (projs.resproj != NULL) {
355 C->gvn_replace_by(projs.resproj, C->top());
356 }
357 C->gvn_replace_by(call, C->top());
358 }
359
360 void StringConcat::eliminate_initialize(InitializeNode* init) {
361 Compile* C = _stringopts->C;
362
363 // Eliminate Initialize node.
364 assert(init->outcnt() <= 2, "only a control and memory projection expected");
365 assert(init->req() <= InitializeNode::RawStores, "no pending inits");
366 Node *ctrl_proj = init->proj_out_or_null(TypeFunc::Control);
367 if (ctrl_proj != NULL) {
368 C->gvn_replace_by(ctrl_proj, init->in(TypeFunc::Control));
369 }
370 Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);
371 if (mem_proj != NULL) {
372 Node *mem = init->in(TypeFunc::Memory);
373 C->gvn_replace_by(mem_proj, mem);
374 }
375 C->gvn_replace_by(init, C->top());
|
305 result->append(other->argument(y), other->mode(y));
306 }
307 } else {
308 result->append(argx, mode(x));
309 }
310 }
311 result->set_allocation(other->_begin);
312 for (uint i = 0; i < _constructors.size(); i++) {
313 result->add_constructor(_constructors.at(i));
314 }
315 for (uint i = 0; i < other->_constructors.size(); i++) {
316 result->add_constructor(other->_constructors.at(i));
317 }
318 result->_multiple = true;
319 return result;
320 }
321
322
323 void StringConcat::eliminate_call(CallNode* call) {
324 Compile* C = _stringopts->C;
325 CallProjections* projs = call->extract_projections(false);
326 if (projs->fallthrough_catchproj != NULL) {
327 C->gvn_replace_by(projs->fallthrough_catchproj, call->in(TypeFunc::Control));
328 }
329 if (projs->fallthrough_memproj != NULL) {
330 C->gvn_replace_by(projs->fallthrough_memproj, call->in(TypeFunc::Memory));
331 }
332 if (projs->catchall_memproj != NULL) {
333 C->gvn_replace_by(projs->catchall_memproj, C->top());
334 }
335 if (projs->fallthrough_ioproj != NULL) {
336 C->gvn_replace_by(projs->fallthrough_ioproj, call->in(TypeFunc::I_O));
337 }
338 if (projs->catchall_ioproj != NULL) {
339 C->gvn_replace_by(projs->catchall_ioproj, C->top());
340 }
341 if (projs->catchall_catchproj != NULL) {
342 // EA can't cope with the partially collapsed graph this
343 // creates so put it on the worklist to be collapsed later.
344 for (SimpleDUIterator i(projs->catchall_catchproj); i.has_next(); i.next()) {
345 Node *use = i.get();
346 int opc = use->Opcode();
347 if (opc == Op_CreateEx || opc == Op_Region) {
348 _stringopts->record_dead_node(use);
349 }
350 }
351 C->gvn_replace_by(projs->catchall_catchproj, C->top());
352 }
353 if (projs->resproj[0] != NULL) {
354 assert(projs->nb_resproj == 1, "unexpected number of results");
355 C->gvn_replace_by(projs->resproj[0], C->top());
356 }
357 C->gvn_replace_by(call, C->top());
358 }
359
360 void StringConcat::eliminate_initialize(InitializeNode* init) {
361 Compile* C = _stringopts->C;
362
363 // Eliminate Initialize node.
364 assert(init->outcnt() <= 2, "only a control and memory projection expected");
365 assert(init->req() <= InitializeNode::RawStores, "no pending inits");
366 Node *ctrl_proj = init->proj_out_or_null(TypeFunc::Control);
367 if (ctrl_proj != NULL) {
368 C->gvn_replace_by(ctrl_proj, init->in(TypeFunc::Control));
369 }
370 Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);
371 if (mem_proj != NULL) {
372 Node *mem = init->in(TypeFunc::Memory);
373 C->gvn_replace_by(mem_proj, mem);
374 }
375 C->gvn_replace_by(init, C->top());
|