< prev index next >

src/share/vm/opto/machnode.cpp

Print this page




 651   // Values in the domain use the users calling convention, embodied in the
 652   // _in_rms array of RegMasks.
 653   if( idx < TypeFunc::Parms ) return _in_rms[idx];
 654 
 655   if (SafePointNode::needs_polling_address_input() &&
 656       idx == TypeFunc::Parms &&
 657       ideal_Opcode() == Op_SafePoint) {
 658     return MachNode::in_RegMask(idx);
 659   }
 660 
 661   // Values outside the domain represent debug info
 662   assert(in(idx)->ideal_reg() != Op_RegFlags, "flags register is not spillable");
 663   return *Compile::current()->matcher()->idealreg2spillmask[in(idx)->ideal_reg()];
 664 }
 665 
 666 
 667 //=============================================================================
 668 
 669 uint MachCallNode::cmp( const Node &n ) const
 670 { return _tf == ((MachCallNode&)n)._tf; }
 671 const Type *MachCallNode::bottom_type() const { return tf()->range(); }
 672 const Type* MachCallNode::Value(PhaseGVN* phase) const { return tf()->range(); }
 673 
 674 #ifndef PRODUCT
 675 void MachCallNode::dump_spec(outputStream *st) const {
 676   st->print("# ");
 677   if (tf() != NULL)  tf()->dump_on(st);
 678   if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
 679   if (jvms() != NULL)  jvms()->dump_spec(st);
 680 }
 681 #endif
 682 
 683 bool MachCallNode::return_value_is_used() const {
 684   if (tf()->range()->cnt() == TypeFunc::Parms) {
 685     // void return
 686     return false;
 687   }
 688 


 689   // find the projection corresponding to the return value
 690   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 691     Node *use = fast_out(i);
 692     if (!use->is_Proj()) continue;
 693     if (use->as_Proj()->_con == TypeFunc::Parms) {
 694       return true;
 695     }
 696   }
 697   return false;
 698 }
 699 
 700 // Similar to cousin class CallNode::returns_pointer
 701 // Because this is used in deoptimization, we want the type info, not the data
 702 // flow info; the interpreter will "use" things that are dead to the optimizer.
 703 bool MachCallNode::returns_pointer() const {
 704   const TypeTuple *r = tf()->range();
 705   return (r->cnt() > TypeFunc::Parms &&
 706           r->field_at(TypeFunc::Parms)->isa_ptr());




 707 }
 708 
 709 //------------------------------Registers--------------------------------------
 710 const RegMask &MachCallNode::in_RegMask(uint idx) const {
 711   // Values in the domain use the users calling convention, embodied in the
 712   // _in_rms array of RegMasks.
 713   if (idx < tf()->domain_sig()->cnt()) {
 714     return _in_rms[idx];
 715   }
 716   if (idx == mach_constant_base_node_input()) {
 717     return MachConstantBaseNode::static_out_RegMask();
 718   }
 719   // Values outside the domain represent debug info
 720   return *Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()];
 721 }
 722 
 723 //=============================================================================
 724 uint MachCallJavaNode::size_of() const { return sizeof(*this); }
 725 uint MachCallJavaNode::cmp( const Node &n ) const {
 726   MachCallJavaNode &call = (MachCallJavaNode&)n;




 651   // Values in the domain use the users calling convention, embodied in the
 652   // _in_rms array of RegMasks.
 653   if( idx < TypeFunc::Parms ) return _in_rms[idx];
 654 
 655   if (SafePointNode::needs_polling_address_input() &&
 656       idx == TypeFunc::Parms &&
 657       ideal_Opcode() == Op_SafePoint) {
 658     return MachNode::in_RegMask(idx);
 659   }
 660 
 661   // Values outside the domain represent debug info
 662   assert(in(idx)->ideal_reg() != Op_RegFlags, "flags register is not spillable");
 663   return *Compile::current()->matcher()->idealreg2spillmask[in(idx)->ideal_reg()];
 664 }
 665 
 666 
 667 //=============================================================================
 668 
 669 uint MachCallNode::cmp( const Node &n ) const
 670 { return _tf == ((MachCallNode&)n)._tf; }
 671 const Type *MachCallNode::bottom_type() const { return tf()->range_cc(); }
 672 const Type* MachCallNode::Value(PhaseGVN* phase) const { return tf()->range_cc(); }
 673 
 674 #ifndef PRODUCT
 675 void MachCallNode::dump_spec(outputStream *st) const {
 676   st->print("# ");
 677   if (tf() != NULL)  tf()->dump_on(st);
 678   if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
 679   if (jvms() != NULL)  jvms()->dump_spec(st);
 680 }
 681 #endif
 682 
 683 bool MachCallNode::return_value_is_used() const {
 684   if (tf()->range_sig()->cnt() == TypeFunc::Parms) {
 685     // void return
 686     return false;
 687   }
 688 
 689   assert(tf()->returns_value_type_as_fields(), "multiple return values not supported");
 690 
 691   // find the projection corresponding to the return value
 692   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 693     Node *use = fast_out(i);
 694     if (!use->is_Proj()) continue;
 695     if (use->as_Proj()->_con == TypeFunc::Parms) {
 696       return true;
 697     }
 698   }
 699   return false;
 700 }
 701 
 702 // Similar to cousin class CallNode::returns_pointer
 703 // Because this is used in deoptimization, we want the type info, not the data
 704 // flow info; the interpreter will "use" things that are dead to the optimizer.
 705 bool MachCallNode::returns_pointer() const {
 706   const TypeTuple *r = tf()->range_sig();
 707   return (r->cnt() > TypeFunc::Parms &&
 708           r->field_at(TypeFunc::Parms)->isa_ptr());
 709 }
 710 
 711 bool MachCallNode::returns_vt() const {
 712   return tf()->returns_value_type_as_fields();
 713 }
 714 
 715 //------------------------------Registers--------------------------------------
 716 const RegMask &MachCallNode::in_RegMask(uint idx) const {
 717   // Values in the domain use the users calling convention, embodied in the
 718   // _in_rms array of RegMasks.
 719   if (idx < tf()->domain_sig()->cnt()) {
 720     return _in_rms[idx];
 721   }
 722   if (idx == mach_constant_base_node_input()) {
 723     return MachConstantBaseNode::static_out_RegMask();
 724   }
 725   // Values outside the domain represent debug info
 726   return *Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()];
 727 }
 728 
 729 //=============================================================================
 730 uint MachCallJavaNode::size_of() const { return sizeof(*this); }
 731 uint MachCallJavaNode::cmp( const Node &n ) const {
 732   MachCallJavaNode &call = (MachCallJavaNode&)n;


< prev index next >