671 }
672
673 //------------------------------calling_convention-----------------------------
674 void CallNode::calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const {
675 // Use the standard compiler calling convention
676 Matcher::calling_convention( sig_bt, parm_regs, argcnt, true );
677 }
678
679
680 //------------------------------match------------------------------------------
681 // Construct projections for control, I/O, memory-fields, ..., and
682 // return result(s) along with their RegMask info
683 Node *CallNode::match( const ProjNode *proj, const Matcher *match ) {
684 switch (proj->_con) {
685 case TypeFunc::Control:
686 case TypeFunc::I_O:
687 case TypeFunc::Memory:
688 return new MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj);
689
690 case TypeFunc::Parms+1: // For LONG & DOUBLE returns
691 assert(tf()->_range->field_at(TypeFunc::Parms+1) == Type::HALF, "");
692 // 2nd half of doubles and longs
693 return new MachProjNode(this,proj->_con, RegMask::Empty, (uint)OptoReg::Bad);
694
695 case TypeFunc::Parms: { // Normal returns
696 uint ideal_reg = tf()->range()->field_at(TypeFunc::Parms)->ideal_reg();
697 OptoRegPair regs = is_CallRuntime()
698 ? match->c_return_value(ideal_reg,true) // Calls into C runtime
699 : match-> return_value(ideal_reg,true); // Calls into compiled Java code
700 RegMask rm = RegMask(regs.first());
701 if( OptoReg::is_valid(regs.second()) )
702 rm.Insert( regs.second() );
703 return new MachProjNode(this,proj->_con,rm,ideal_reg);
704 }
705
706 case TypeFunc::ReturnAdr:
707 case TypeFunc::FramePtr:
708 default:
709 ShouldNotReachHere();
710 }
711 return NULL;
|
671 }
672
673 //------------------------------calling_convention-----------------------------
674 void CallNode::calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const {
675 // Use the standard compiler calling convention
676 Matcher::calling_convention( sig_bt, parm_regs, argcnt, true );
677 }
678
679
680 //------------------------------match------------------------------------------
681 // Construct projections for control, I/O, memory-fields, ..., and
682 // return result(s) along with their RegMask info
683 Node *CallNode::match( const ProjNode *proj, const Matcher *match ) {
684 switch (proj->_con) {
685 case TypeFunc::Control:
686 case TypeFunc::I_O:
687 case TypeFunc::Memory:
688 return new MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj);
689
690 case TypeFunc::Parms+1: // For LONG & DOUBLE returns
691 assert(tf()->range()->field_at(TypeFunc::Parms+1) == Type::HALF, "");
692 // 2nd half of doubles and longs
693 return new MachProjNode(this,proj->_con, RegMask::Empty, (uint)OptoReg::Bad);
694
695 case TypeFunc::Parms: { // Normal returns
696 uint ideal_reg = tf()->range()->field_at(TypeFunc::Parms)->ideal_reg();
697 OptoRegPair regs = is_CallRuntime()
698 ? match->c_return_value(ideal_reg,true) // Calls into C runtime
699 : match-> return_value(ideal_reg,true); // Calls into compiled Java code
700 RegMask rm = RegMask(regs.first());
701 if( OptoReg::is_valid(regs.second()) )
702 rm.Insert( regs.second() );
703 return new MachProjNode(this,proj->_con,rm,ideal_reg);
704 }
705
706 case TypeFunc::ReturnAdr:
707 case TypeFunc::FramePtr:
708 default:
709 ShouldNotReachHere();
710 }
711 return NULL;
|