1605 1606 //------------------------------print_statistics------------------------------- 1607 #ifndef PRODUCT 1608 void PhasePeephole::print_statistics() { 1609 tty->print_cr("Peephole: peephole rules applied: %d", _total_peepholes); 1610 } 1611 #endif 1612 1613 1614 //============================================================================= 1615 //------------------------------set_req_X-------------------------------------- 1616 void Node::set_req_X( uint i, Node *n, PhaseIterGVN *igvn ) { 1617 assert( is_not_dead(n), "can not use dead node"); 1618 assert( igvn->hash_find(this) != this, "Need to remove from hash before changing edges" ); 1619 Node *old = in(i); 1620 set_req(i, n); 1621 1622 // old goes dead? 1623 if( old ) { 1624 switch (old->outcnt()) { 1625 case 0: // Kill all his inputs, and recursively kill other dead nodes. 1626 if (!old->is_top()) 1627 igvn->remove_dead_node( old ); 1628 break; 1629 case 1: 1630 if( old->is_Store() || old->has_special_unique_user() ) 1631 igvn->add_users_to_worklist( old ); 1632 break; 1633 case 2: 1634 if( old->is_Store() ) 1635 igvn->add_users_to_worklist( old ); 1636 if( old->Opcode() == Op_Region ) 1637 igvn->_worklist.push(old); 1638 break; 1639 case 3: 1640 if( old->Opcode() == Op_Region ) { 1641 igvn->_worklist.push(old); 1642 igvn->add_users_to_worklist( old ); 1643 } 1644 break; 1645 default: 1646 break; 1647 } | 1605 1606 //------------------------------print_statistics------------------------------- 1607 #ifndef PRODUCT 1608 void PhasePeephole::print_statistics() { 1609 tty->print_cr("Peephole: peephole rules applied: %d", _total_peepholes); 1610 } 1611 #endif 1612 1613 1614 //============================================================================= 1615 //------------------------------set_req_X-------------------------------------- 1616 void Node::set_req_X( uint i, Node *n, PhaseIterGVN *igvn ) { 1617 assert( is_not_dead(n), "can not use dead node"); 1618 assert( igvn->hash_find(this) != this, "Need to remove from hash before changing edges" ); 1619 Node *old = in(i); 1620 set_req(i, n); 1621 1622 // old goes dead? 1623 if( old ) { 1624 switch (old->outcnt()) { 1625 case 0: 1626 // Put into the worklist to kill later. We do not kill it now because the 1627 // recursive kill will delete the current node (this) if dead-loop exists 1628 if (!old->is_top()) 1629 igvn->_worklist.push( old ); 1630 break; 1631 case 1: 1632 if( old->is_Store() || old->has_special_unique_user() ) 1633 igvn->add_users_to_worklist( old ); 1634 break; 1635 case 2: 1636 if( old->is_Store() ) 1637 igvn->add_users_to_worklist( old ); 1638 if( old->Opcode() == Op_Region ) 1639 igvn->_worklist.push(old); 1640 break; 1641 case 3: 1642 if( old->Opcode() == Op_Region ) { 1643 igvn->_worklist.push(old); 1644 igvn->add_users_to_worklist( old ); 1645 } 1646 break; 1647 default: 1648 break; 1649 } |