70 Node *StartNode::match( const ProjNode *proj, const Matcher *match ) { |
70 Node *StartNode::match( const ProjNode *proj, const Matcher *match ) { |
71 switch (proj->_con) { |
71 switch (proj->_con) { |
72 case TypeFunc::Control: |
72 case TypeFunc::Control: |
73 case TypeFunc::I_O: |
73 case TypeFunc::I_O: |
74 case TypeFunc::Memory: |
74 case TypeFunc::Memory: |
75 return new (match->C, 1) MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); |
75 return new (match->C) MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); |
76 case TypeFunc::FramePtr: |
76 case TypeFunc::FramePtr: |
77 return new (match->C, 1) MachProjNode(this,proj->_con,Matcher::c_frame_ptr_mask, Op_RegP); |
77 return new (match->C) MachProjNode(this,proj->_con,Matcher::c_frame_ptr_mask, Op_RegP); |
78 case TypeFunc::ReturnAdr: |
78 case TypeFunc::ReturnAdr: |
79 return new (match->C, 1) MachProjNode(this,proj->_con,match->_return_addr_mask,Op_RegP); |
79 return new (match->C) MachProjNode(this,proj->_con,match->_return_addr_mask,Op_RegP); |
80 case TypeFunc::Parms: |
80 case TypeFunc::Parms: |
81 default: { |
81 default: { |
82 uint parm_num = proj->_con - TypeFunc::Parms; |
82 uint parm_num = proj->_con - TypeFunc::Parms; |
83 const Type *t = _domain->field_at(proj->_con); |
83 const Type *t = _domain->field_at(proj->_con); |
84 if (t->base() == Type::Half) // 2nd half of Longs and Doubles |
84 if (t->base() == Type::Half) // 2nd half of Longs and Doubles |
85 return new (match->C, 1) ConNode(Type::TOP); |
85 return new (match->C) ConNode(Type::TOP); |
86 uint ideal_reg = t->ideal_reg(); |
86 uint ideal_reg = t->ideal_reg(); |
87 RegMask &rm = match->_calling_convention_mask[parm_num]; |
87 RegMask &rm = match->_calling_convention_mask[parm_num]; |
88 return new (match->C, 1) MachProjNode(this,proj->_con,rm,ideal_reg); |
88 return new (match->C) MachProjNode(this,proj->_con,rm,ideal_reg); |
89 } |
89 } |
90 } |
90 } |
91 return NULL; |
91 return NULL; |
92 } |
92 } |
93 |
93 |
623 Node *CallNode::match( const ProjNode *proj, const Matcher *match ) { |
623 Node *CallNode::match( const ProjNode *proj, const Matcher *match ) { |
624 switch (proj->_con) { |
624 switch (proj->_con) { |
625 case TypeFunc::Control: |
625 case TypeFunc::Control: |
626 case TypeFunc::I_O: |
626 case TypeFunc::I_O: |
627 case TypeFunc::Memory: |
627 case TypeFunc::Memory: |
628 return new (match->C, 1) MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); |
628 return new (match->C) MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); |
629 |
629 |
630 case TypeFunc::Parms+1: // For LONG & DOUBLE returns |
630 case TypeFunc::Parms+1: // For LONG & DOUBLE returns |
631 assert(tf()->_range->field_at(TypeFunc::Parms+1) == Type::HALF, ""); |
631 assert(tf()->_range->field_at(TypeFunc::Parms+1) == Type::HALF, ""); |
632 // 2nd half of doubles and longs |
632 // 2nd half of doubles and longs |
633 return new (match->C, 1) MachProjNode(this,proj->_con, RegMask::Empty, (uint)OptoReg::Bad); |
633 return new (match->C) MachProjNode(this,proj->_con, RegMask::Empty, (uint)OptoReg::Bad); |
634 |
634 |
635 case TypeFunc::Parms: { // Normal returns |
635 case TypeFunc::Parms: { // Normal returns |
636 uint ideal_reg = tf()->range()->field_at(TypeFunc::Parms)->ideal_reg(); |
636 uint ideal_reg = tf()->range()->field_at(TypeFunc::Parms)->ideal_reg(); |
637 OptoRegPair regs = is_CallRuntime() |
637 OptoRegPair regs = is_CallRuntime() |
638 ? match->c_return_value(ideal_reg,true) // Calls into C runtime |
638 ? match->c_return_value(ideal_reg,true) // Calls into C runtime |
639 : match-> return_value(ideal_reg,true); // Calls into compiled Java code |
639 : match-> return_value(ideal_reg,true); // Calls into compiled Java code |
640 RegMask rm = RegMask(regs.first()); |
640 RegMask rm = RegMask(regs.first()); |
641 if( OptoReg::is_valid(regs.second()) ) |
641 if( OptoReg::is_valid(regs.second()) ) |
642 rm.Insert( regs.second() ); |
642 rm.Insert( regs.second() ); |
643 return new (match->C, 1) MachProjNode(this,proj->_con,rm,ideal_reg); |
643 return new (match->C) MachProjNode(this,proj->_con,rm,ideal_reg); |
644 } |
644 } |
645 |
645 |
646 case TypeFunc::ReturnAdr: |
646 case TypeFunc::ReturnAdr: |
647 case TypeFunc::FramePtr: |
647 case TypeFunc::FramePtr: |
648 default: |
648 default: |
1173 catchproj->unique_out()->Opcode() != Op_Halt)) { |
1173 catchproj->unique_out()->Opcode() != Op_Halt)) { |
1174 assert(catchproj->is_CatchProj(), "must be a CatchProjNode"); |
1174 assert(catchproj->is_CatchProj(), "must be a CatchProjNode"); |
1175 Node* nproj = catchproj->clone(); |
1175 Node* nproj = catchproj->clone(); |
1176 igvn->register_new_node_with_optimizer(nproj); |
1176 igvn->register_new_node_with_optimizer(nproj); |
1177 |
1177 |
1178 Node *frame = new (phase->C, 1) ParmNode( phase->C->start(), TypeFunc::FramePtr ); |
1178 Node *frame = new (phase->C) ParmNode( phase->C->start(), TypeFunc::FramePtr ); |
1179 frame = phase->transform(frame); |
1179 frame = phase->transform(frame); |
1180 // Halt & Catch Fire |
1180 // Halt & Catch Fire |
1181 Node *halt = new (phase->C, TypeFunc::Parms) HaltNode( nproj, frame ); |
1181 Node *halt = new (phase->C) HaltNode( nproj, frame ); |
1182 phase->C->root()->add_req(halt); |
1182 phase->C->root()->add_req(halt); |
1183 phase->transform(halt); |
1183 phase->transform(halt); |
1184 |
1184 |
1185 igvn->replace_node(catchproj, phase->C->top()); |
1185 igvn->replace_node(catchproj, phase->C->top()); |
1186 return this; |
1186 return this; |
1216 |
1216 |
1217 // Return NULL if new nodes are not allowed |
1217 // Return NULL if new nodes are not allowed |
1218 if (!allow_new_nodes) return NULL; |
1218 if (!allow_new_nodes) return NULL; |
1219 // Create a cast which is control dependent on the initialization to |
1219 // Create a cast which is control dependent on the initialization to |
1220 // propagate the fact that the array length must be positive. |
1220 // propagate the fact that the array length must be positive. |
1221 length = new (phase->C, 2) CastIINode(length, narrow_length_type); |
1221 length = new (phase->C) CastIINode(length, narrow_length_type); |
1222 length->set_req(0, initialization()->proj_out(0)); |
1222 length->set_req(0, initialization()->proj_out(0)); |
1223 } |
1223 } |
1224 } |
1224 } |
1225 |
1225 |
1226 return length; |
1226 return length; |