< prev index next >

src/share/vm/opto/multnode.cpp

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "opto/callnode.hpp"
  27 #include "opto/cfgnode.hpp"
  28 #include "opto/matcher.hpp"
  29 #include "opto/mathexactnode.hpp"
  30 #include "opto/multnode.hpp"
  31 #include "opto/opcodes.hpp"
  32 #include "opto/phaseX.hpp"
  33 #include "opto/regmask.hpp"

  34 #include "opto/type.hpp"
  35 
  36 //=============================================================================
  37 //------------------------------MultiNode--------------------------------------
  38 const RegMask &MultiNode::out_RegMask() const {
  39   return RegMask::Empty;
  40 }
  41 
  42 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); }
  43 
  44 //------------------------------proj_out---------------------------------------
  45 // Get a named projection
  46 ProjNode* MultiNode::proj_out(uint which_proj) const {
  47   assert(Opcode() != Op_If || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
  48   assert(Opcode() != Op_If || outcnt() == 2, "bad if #1");
  49   for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
  50     Node *p = fast_out(i);
  51     if (p->is_Proj()) {
  52       ProjNode *proj = p->as_Proj();
  53       if (proj->_con == which_proj) {


 124     Node* o = this->out(i);
 125     if (NotANode(o)) {
 126       st->print("[?]");
 127     } else if (o == NULL) {
 128       st->print("[_]");
 129     } else {
 130       st->print("[%d]", o->_idx);
 131     }
 132   }
 133   st->print("#%d", _con);
 134 }
 135 #endif
 136 
 137 //----------------------------check_con----------------------------------------
 138 void ProjNode::check_con() const {
 139   Node* n = in(0);
 140   if (n == NULL)       return;  // should be assert, but NodeHash makes bogons
 141   if (n->is_Mach())    return;  // mach. projs. are not type-safe
 142   if (n->is_Start())   return;  // alas, starts can have mach. projs. also
 143   if (_con == SCMemProjNode::SCMEMPROJCON ) return;

 144   const Type* t = n->bottom_type();
 145   if (t == Type::TOP)  return;  // multi is dead
 146   assert(_con < t->is_tuple()->cnt(), "ProjNode::_con must be in range");
 147 }
 148 
 149 //------------------------------Value------------------------------------------
 150 const Type *ProjNode::Value( PhaseTransform *phase ) const {
 151   if (in(0) == NULL) return Type::TOP;
 152   return proj_type(phase->type(in(0)));
 153 }
 154 
 155 //------------------------------out_RegMask------------------------------------
 156 // Pass the buck uphill
 157 const RegMask &ProjNode::out_RegMask() const {
 158   return RegMask::Empty;
 159 }
 160 
 161 //------------------------------ideal_reg--------------------------------------
 162 uint ProjNode::ideal_reg() const {
 163   return bottom_type()->ideal_reg();




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "opto/callnode.hpp"
  27 #include "opto/cfgnode.hpp"
  28 #include "opto/matcher.hpp"
  29 #include "opto/mathexactnode.hpp"
  30 #include "opto/multnode.hpp"
  31 #include "opto/opcodes.hpp"
  32 #include "opto/phaseX.hpp"
  33 #include "opto/regmask.hpp"
  34 #include "opto/shenandoahSupport.hpp"
  35 #include "opto/type.hpp"
  36 
  37 //=============================================================================
  38 //------------------------------MultiNode--------------------------------------
  39 const RegMask &MultiNode::out_RegMask() const {
  40   return RegMask::Empty;
  41 }
  42 
  43 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); }
  44 
  45 //------------------------------proj_out---------------------------------------
  46 // Get a named projection
  47 ProjNode* MultiNode::proj_out(uint which_proj) const {
  48   assert(Opcode() != Op_If || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
  49   assert(Opcode() != Op_If || outcnt() == 2, "bad if #1");
  50   for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
  51     Node *p = fast_out(i);
  52     if (p->is_Proj()) {
  53       ProjNode *proj = p->as_Proj();
  54       if (proj->_con == which_proj) {


 125     Node* o = this->out(i);
 126     if (NotANode(o)) {
 127       st->print("[?]");
 128     } else if (o == NULL) {
 129       st->print("[_]");
 130     } else {
 131       st->print("[%d]", o->_idx);
 132     }
 133   }
 134   st->print("#%d", _con);
 135 }
 136 #endif
 137 
 138 //----------------------------check_con----------------------------------------
 139 void ProjNode::check_con() const {
 140   Node* n = in(0);
 141   if (n == NULL)       return;  // should be assert, but NodeHash makes bogons
 142   if (n->is_Mach())    return;  // mach. projs. are not type-safe
 143   if (n->is_Start())   return;  // alas, starts can have mach. projs. also
 144   if (_con == SCMemProjNode::SCMEMPROJCON ) return;
 145   if (_con == ShenandoahWBMemProjNode::SWBMEMPROJCON ) return;
 146   const Type* t = n->bottom_type();
 147   if (t == Type::TOP)  return;  // multi is dead
 148   assert(_con < t->is_tuple()->cnt(), "ProjNode::_con must be in range");
 149 }
 150 
 151 //------------------------------Value------------------------------------------
 152 const Type *ProjNode::Value( PhaseTransform *phase ) const {
 153   if (in(0) == NULL) return Type::TOP;
 154   return proj_type(phase->type(in(0)));
 155 }
 156 
 157 //------------------------------out_RegMask------------------------------------
 158 // Pass the buck uphill
 159 const RegMask &ProjNode::out_RegMask() const {
 160   return RegMask::Empty;
 161 }
 162 
 163 //------------------------------ideal_reg--------------------------------------
 164 uint ProjNode::ideal_reg() const {
 165   return bottom_type()->ideal_reg();


< prev index next >