65 RegMask Matcher::c_frame_ptr_mask; |
65 RegMask Matcher::c_frame_ptr_mask; |
66 const uint Matcher::_begin_rematerialize = _BEGIN_REMATERIALIZE; |
66 const uint Matcher::_begin_rematerialize = _BEGIN_REMATERIALIZE; |
67 const uint Matcher::_end_rematerialize = _END_REMATERIALIZE; |
67 const uint Matcher::_end_rematerialize = _END_REMATERIALIZE; |
68 |
68 |
69 //---------------------------Matcher------------------------------------------- |
69 //---------------------------Matcher------------------------------------------- |
70 Matcher::Matcher( Node_List &proj_list ) : |
70 Matcher::Matcher() |
71 PhaseTransform( Phase::Ins_Select ), |
71 : PhaseTransform( Phase::Ins_Select ), |
72 #ifdef ASSERT |
72 #ifdef ASSERT |
73 _old2new_map(C->comp_arena()), |
73 _old2new_map(C->comp_arena()), |
74 _new2old_map(C->comp_arena()), |
74 _new2old_map(C->comp_arena()), |
75 #endif |
75 #endif |
76 _shared_nodes(C->comp_arena()), |
76 _shared_nodes(C->comp_arena()), |
77 _reduceOp(reduceOp), _leftOp(leftOp), _rightOp(rightOp), |
77 _reduceOp(reduceOp), _leftOp(leftOp), _rightOp(rightOp), |
78 _swallowed(swallowed), |
78 _swallowed(swallowed), |
79 _begin_inst_chain_rule(_BEGIN_INST_CHAIN_RULE), |
79 _begin_inst_chain_rule(_BEGIN_INST_CHAIN_RULE), |
80 _end_inst_chain_rule(_END_INST_CHAIN_RULE), |
80 _end_inst_chain_rule(_END_INST_CHAIN_RULE), |
81 _must_clone(must_clone), _proj_list(proj_list), |
81 _must_clone(must_clone), |
82 _register_save_policy(register_save_policy), |
82 _register_save_policy(register_save_policy), |
83 _c_reg_save_policy(c_reg_save_policy), |
83 _c_reg_save_policy(c_reg_save_policy), |
84 _register_save_type(register_save_type), |
84 _register_save_type(register_save_type), |
85 _ruleName(ruleName), |
85 _ruleName(ruleName), |
86 _allocation_started(false), |
86 _allocation_started(false), |
1302 C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence"); |
1302 C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence"); |
1303 } else { |
1303 } else { |
1304 for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++) |
1304 for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++) |
1305 proj->_rout.Insert(OptoReg::Name(i)); |
1305 proj->_rout.Insert(OptoReg::Name(i)); |
1306 } |
1306 } |
1307 if( proj->_rout.is_NotEmpty() ) |
1307 if (proj->_rout.is_NotEmpty()) { |
1308 _proj_list.push(proj); |
1308 push_projection(proj); |
|
1309 } |
1309 } |
1310 } |
1310 // Transfer the safepoint information from the call to the mcall |
1311 // Transfer the safepoint information from the call to the mcall |
1311 // Move the JVMState list |
1312 // Move the JVMState list |
1312 msfpt->set_jvms(sfpt->jvms()); |
1313 msfpt->set_jvms(sfpt->jvms()); |
1313 for (JVMState* jvms = msfpt->jvms(); jvms; jvms = jvms->caller()) { |
1314 for (JVMState* jvms = msfpt->jvms(); jvms; jvms = jvms->caller()) { |
1683 } |
1684 } |
1684 #endif |
1685 #endif |
1685 } |
1686 } |
1686 |
1687 |
1687 // If the _leaf is an AddP, insert the base edge |
1688 // If the _leaf is an AddP, insert the base edge |
1688 if( leaf->is_AddP() ) |
1689 if (leaf->is_AddP()) { |
1689 mach->ins_req(AddPNode::Base,leaf->in(AddPNode::Base)); |
1690 mach->ins_req(AddPNode::Base,leaf->in(AddPNode::Base)); |
1690 |
1691 } |
1691 uint num_proj = _proj_list.size(); |
1692 |
|
1693 uint number_of_projections_prior = number_of_projections(); |
1692 |
1694 |
1693 // Perform any 1-to-many expansions required |
1695 // Perform any 1-to-many expansions required |
1694 MachNode *ex = mach->Expand(s,_proj_list, mem); |
1696 MachNode *ex = mach->Expand(s, _projection_list, mem); |
1695 if( ex != mach ) { |
1697 if (ex != mach) { |
1696 assert(ex->ideal_reg() == mach->ideal_reg(), "ideal types should match"); |
1698 assert(ex->ideal_reg() == mach->ideal_reg(), "ideal types should match"); |
1697 if( ex->in(1)->is_Con() ) |
1699 if( ex->in(1)->is_Con() ) |
1698 ex->in(1)->set_req(0, C->root()); |
1700 ex->in(1)->set_req(0, C->root()); |
1699 // Remove old node from the graph |
1701 // Remove old node from the graph |
1700 for( uint i=0; i<mach->req(); i++ ) { |
1702 for( uint i=0; i<mach->req(); i++ ) { |
1711 // in space, and will not get emitted as output code. Catch this. |
1713 // in space, and will not get emitted as output code. Catch this. |
1712 // Also, catch any new register allocation constraints ("projections") |
1714 // Also, catch any new register allocation constraints ("projections") |
1713 // generated belatedly during spill code generation. |
1715 // generated belatedly during spill code generation. |
1714 if (_allocation_started) { |
1716 if (_allocation_started) { |
1715 guarantee(ex == mach, "no expand rules during spill generation"); |
1717 guarantee(ex == mach, "no expand rules during spill generation"); |
1716 guarantee(_proj_list.size() == num_proj, "no allocation during spill generation"); |
1718 guarantee(number_of_projections_prior == number_of_projections(), "no allocation during spill generation"); |
1717 } |
1719 } |
1718 |
1720 |
1719 if (leaf->is_Con() || leaf->is_DecodeNarrowPtr()) { |
1721 if (leaf->is_Con() || leaf->is_DecodeNarrowPtr()) { |
1720 // Record the con for sharing |
1722 // Record the con for sharing |
1721 _shared_nodes.map(leaf->_idx, ex); |
1723 _shared_nodes.map(leaf->_idx, ex); |