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