479 |
479 |
480 // Iterate over the set of live nodes. |
480 // Iterate over the set of live nodes. |
481 uint current_idx = 0; // The current new node ID. Incremented after every assignment. |
481 uint current_idx = 0; // The current new node ID. Incremented after every assignment. |
482 for (uint i = 0; i < _useful.size(); i++) { |
482 for (uint i = 0; i < _useful.size(); i++) { |
483 Node* n = _useful.at(i); |
483 Node* n = _useful.at(i); |
|
484 // Sanity check that fails if we ever decide to execute this phase after EA |
|
485 assert(!n->is_Phi() || n->as_Phi()->inst_mem_id() == -1, "should not be linked to data Phi"); |
484 const Type* type = gvn->type_or_null(n); |
486 const Type* type = gvn->type_or_null(n); |
485 new_type_array.map(current_idx, type); |
487 new_type_array.map(current_idx, type); |
486 |
488 |
487 bool in_worklist = false; |
489 bool in_worklist = false; |
488 if (worklist->member(n)) { |
490 if (worklist->member(n)) { |
1376 hash_find_insert(use); |
1378 hash_find_insert(use); |
1377 } |
1379 } |
1378 i -= num_edges; // we deleted 1 or more copies of this edge |
1380 i -= num_edges; // we deleted 1 or more copies of this edge |
1379 } |
1381 } |
1380 |
1382 |
|
1383 // Search for instance field data PhiNodes in the same region pointing to the old |
|
1384 // memory PhiNode and update their instance memory ids to point to the new node. |
|
1385 if (old->is_Phi() && old->as_Phi()->type()->has_memory() && old->in(0) != NULL) { |
|
1386 Node* region = old->in(0); |
|
1387 for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { |
|
1388 PhiNode* phi = region->fast_out(i)->isa_Phi(); |
|
1389 if (phi != NULL && phi->inst_mem_id() == (int)old->_idx) { |
|
1390 phi->set_inst_mem_id((int)nn->_idx); |
|
1391 } |
|
1392 } |
|
1393 } |
|
1394 |
1381 // Smash all inputs to 'old', isolating him completely |
1395 // Smash all inputs to 'old', isolating him completely |
1382 Node *temp = new (C) Node(1); |
1396 Node *temp = new (C) Node(1); |
1383 temp->init_req(0,nn); // Add a use to nn to prevent him from dying |
1397 temp->init_req(0,nn); // Add a use to nn to prevent him from dying |
1384 remove_dead_node( old ); |
1398 remove_dead_node( old ); |
1385 temp->del_req(0); // Yank bogus edge |
1399 temp->del_req(0); // Yank bogus edge |