303 |
303 |
304 // Create new ideal node ConP #NULL even if it does exist in old space |
304 // Create new ideal node ConP #NULL even if it does exist in old space |
305 // to avoid false sharing if the corresponding mach node is not used. |
305 // to avoid false sharing if the corresponding mach node is not used. |
306 // The corresponding mach node is only used in rare cases for derived |
306 // The corresponding mach node is only used in rare cases for derived |
307 // pointers. |
307 // pointers. |
308 Node* new_ideal_null = ConNode::make(C, TypePtr::NULL_PTR); |
308 Node* new_ideal_null = ConNode::make(TypePtr::NULL_PTR); |
309 |
309 |
310 // Swap out to old-space; emptying new-space |
310 // Swap out to old-space; emptying new-space |
311 Arena *old = C->node_arena()->move_contents(C->old_arena()); |
311 Arena *old = C->node_arena()->move_contents(C->old_arena()); |
312 |
312 |
313 // Save debug and profile information for nodes in old space: |
313 // Save debug and profile information for nodes in old space: |
1641 if (shared_node != NULL) { |
1641 if (shared_node != NULL) { |
1642 return shared_node; |
1642 return shared_node; |
1643 } |
1643 } |
1644 |
1644 |
1645 // Build the object to represent this state & prepare for recursive calls |
1645 // Build the object to represent this state & prepare for recursive calls |
1646 MachNode *mach = s->MachNodeGenerator( rule, C ); |
1646 MachNode *mach = s->MachNodeGenerator(rule); |
1647 mach->_opnds[0] = s->MachOperGenerator( _reduceOp[rule], C ); |
1647 mach->_opnds[0] = s->MachOperGenerator(_reduceOp[rule]); |
1648 assert( mach->_opnds[0] != NULL, "Missing result operand" ); |
1648 assert( mach->_opnds[0] != NULL, "Missing result operand" ); |
1649 Node *leaf = s->_leaf; |
1649 Node *leaf = s->_leaf; |
1650 // Check for instruction or instruction chain rule |
1650 // Check for instruction or instruction chain rule |
1651 if( rule >= _END_INST_CHAIN_RULE || rule < _BEGIN_INST_CHAIN_RULE ) { |
1651 if( rule >= _END_INST_CHAIN_RULE || rule < _BEGIN_INST_CHAIN_RULE ) { |
1652 assert(C->node_arena()->contains(s->_leaf) || !has_new_node(s->_leaf), |
1652 assert(C->node_arena()->contains(s->_leaf) || !has_new_node(s->_leaf), |
1754 if( newrule < NUM_OPERANDS ) { |
1754 if( newrule < NUM_OPERANDS ) { |
1755 // Chain from operand or operand class, may be output of shared node |
1755 // Chain from operand or operand class, may be output of shared node |
1756 assert( 0 <= opnd_class_instance && opnd_class_instance < NUM_OPERANDS, |
1756 assert( 0 <= opnd_class_instance && opnd_class_instance < NUM_OPERANDS, |
1757 "Bad AD file: Instruction chain rule must chain from operand"); |
1757 "Bad AD file: Instruction chain rule must chain from operand"); |
1758 // Insert operand into array of operands for this instruction |
1758 // Insert operand into array of operands for this instruction |
1759 mach->_opnds[1] = s->MachOperGenerator( opnd_class_instance, C ); |
1759 mach->_opnds[1] = s->MachOperGenerator(opnd_class_instance); |
1760 |
1760 |
1761 ReduceOper( s, newrule, mem, mach ); |
1761 ReduceOper( s, newrule, mem, mach ); |
1762 } else { |
1762 } else { |
1763 // Chain from the result of an instruction |
1763 // Chain from the result of an instruction |
1764 assert( newrule >= _LAST_MACH_OPER, "Do NOT chain from internal operand"); |
1764 assert( newrule >= _LAST_MACH_OPER, "Do NOT chain from internal operand"); |
1765 mach->_opnds[1] = s->MachOperGenerator( _reduceOp[catch_op], C ); |
1765 mach->_opnds[1] = s->MachOperGenerator(_reduceOp[catch_op]); |
1766 Node *mem1 = (Node*)1; |
1766 Node *mem1 = (Node*)1; |
1767 debug_only(Node *save_mem_node = _mem_node;) |
1767 debug_only(Node *save_mem_node = _mem_node;) |
1768 mach->add_req( ReduceInst(s, newrule, mem1) ); |
1768 mach->add_req( ReduceInst(s, newrule, mem1) ); |
1769 debug_only(_mem_node = save_mem_node;) |
1769 debug_only(_mem_node = save_mem_node;) |
1770 } |
1770 } |
1805 int newrule = newstate->_rule[catch_op]; |
1805 int newrule = newstate->_rule[catch_op]; |
1806 |
1806 |
1807 if( newrule < NUM_OPERANDS ) { // Operand/operandClass or internalOp/instruction? |
1807 if( newrule < NUM_OPERANDS ) { // Operand/operandClass or internalOp/instruction? |
1808 // Operand/operandClass |
1808 // Operand/operandClass |
1809 // Insert operand into array of operands for this instruction |
1809 // Insert operand into array of operands for this instruction |
1810 mach->_opnds[num_opnds++] = newstate->MachOperGenerator( opnd_class_instance, C ); |
1810 mach->_opnds[num_opnds++] = newstate->MachOperGenerator(opnd_class_instance); |
1811 ReduceOper( newstate, newrule, mem, mach ); |
1811 ReduceOper( newstate, newrule, mem, mach ); |
1812 |
1812 |
1813 } else { // Child is internal operand or new instruction |
1813 } else { // Child is internal operand or new instruction |
1814 if( newrule < _LAST_MACH_OPER ) { // internal operand or instruction? |
1814 if( newrule < _LAST_MACH_OPER ) { // internal operand or instruction? |
1815 // internal operand --> call ReduceInst_Interior |
1815 // internal operand --> call ReduceInst_Interior |
1816 // Interior of complex instruction. Do nothing but recurse. |
1816 // Interior of complex instruction. Do nothing but recurse. |
1817 num_opnds = ReduceInst_Interior( newstate, newrule, mem, mach, num_opnds ); |
1817 num_opnds = ReduceInst_Interior( newstate, newrule, mem, mach, num_opnds ); |
1818 } else { |
1818 } else { |
1819 // instruction --> call build operand( ) to catch result |
1819 // instruction --> call build operand( ) to catch result |
1820 // --> ReduceInst( newrule ) |
1820 // --> ReduceInst( newrule ) |
1821 mach->_opnds[num_opnds++] = s->MachOperGenerator( _reduceOp[catch_op], C ); |
1821 mach->_opnds[num_opnds++] = s->MachOperGenerator(_reduceOp[catch_op]); |
1822 Node *mem1 = (Node*)1; |
1822 Node *mem1 = (Node*)1; |
1823 debug_only(Node *save_mem_node = _mem_node;) |
1823 debug_only(Node *save_mem_node = _mem_node;) |
1824 mach->add_req( ReduceInst( newstate, newrule, mem1 ) ); |
1824 mach->add_req( ReduceInst( newstate, newrule, mem1 ) ); |
1825 debug_only(_mem_node = save_mem_node;) |
1825 debug_only(_mem_node = save_mem_node;) |
1826 } |
1826 } |