< prev index next >

src/share/vm/opto/multnode.cpp

Print this page




  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 && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
  48   assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || 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) {
  54         assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || proj->Opcode() == (which_proj ? Op_IfTrue : Op_IfFalse), "bad if #2");


  89   if ((_con == TypeFunc::Parms) &&
  90       n->is_CallStaticJava() && n->as_CallStaticJava()->is_boxing_method()) {
  91     // The result of autoboxing is always non-null on normal path.
  92     t = t->join_speculative(TypePtr::NOTNULL);
  93   }
  94   return t;
  95 }
  96 
  97 const Type *ProjNode::bottom_type() const {
  98   if (in(0) == NULL) return Type::TOP;
  99   return proj_type(in(0)->bottom_type());
 100 }
 101 
 102 const TypePtr *ProjNode::adr_type() const {
 103   if (bottom_type() == Type::MEMORY) {
 104     // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
 105     Node* ctrl = in(0);
 106     if (ctrl == NULL)  return NULL; // node is dead
 107     const TypePtr* adr_type = ctrl->adr_type();
 108     #ifdef ASSERT
 109     if (!is_error_reported() && !Node::in_dump())
 110       assert(adr_type != NULL, "source must have adr_type");
 111     #endif
 112     return adr_type;
 113   }
 114   assert(bottom_type()->base() != Type::Memory, "no other memories?");
 115   return NULL;
 116 }
 117 
 118 bool ProjNode::pinned() const { return in(0)->pinned(); }
 119 #ifndef PRODUCT
 120 void ProjNode::dump_spec(outputStream *st) const { st->print("#%d",_con); if(_is_io_use) st->print(" (i_o_use)");}
 121 
 122 void ProjNode::dump_compact_spec(outputStream *st) const {
 123   for (DUIterator i = this->outs(); this->has_out(i); i++) {
 124     Node* o = this->out(i);
 125     if (NotANode(o)) {
 126       st->print("[?]");
 127     } else if (o == NULL) {
 128       st->print("[_]");
 129     } else {




  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 #include "utilities/vmError.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 && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
  49   assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || 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) {
  55         assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || proj->Opcode() == (which_proj ? Op_IfTrue : Op_IfFalse), "bad if #2");


  90   if ((_con == TypeFunc::Parms) &&
  91       n->is_CallStaticJava() && n->as_CallStaticJava()->is_boxing_method()) {
  92     // The result of autoboxing is always non-null on normal path.
  93     t = t->join_speculative(TypePtr::NOTNULL);
  94   }
  95   return t;
  96 }
  97 
  98 const Type *ProjNode::bottom_type() const {
  99   if (in(0) == NULL) return Type::TOP;
 100   return proj_type(in(0)->bottom_type());
 101 }
 102 
 103 const TypePtr *ProjNode::adr_type() const {
 104   if (bottom_type() == Type::MEMORY) {
 105     // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
 106     Node* ctrl = in(0);
 107     if (ctrl == NULL)  return NULL; // node is dead
 108     const TypePtr* adr_type = ctrl->adr_type();
 109     #ifdef ASSERT
 110     if (!VMError::is_error_reported() && !Node::in_dump())
 111       assert(adr_type != NULL, "source must have adr_type");
 112     #endif
 113     return adr_type;
 114   }
 115   assert(bottom_type()->base() != Type::Memory, "no other memories?");
 116   return NULL;
 117 }
 118 
 119 bool ProjNode::pinned() const { return in(0)->pinned(); }
 120 #ifndef PRODUCT
 121 void ProjNode::dump_spec(outputStream *st) const { st->print("#%d",_con); if(_is_io_use) st->print(" (i_o_use)");}
 122 
 123 void ProjNode::dump_compact_spec(outputStream *st) const {
 124   for (DUIterator i = this->outs(); this->has_out(i); i++) {
 125     Node* o = this->out(i);
 126     if (NotANode(o)) {
 127       st->print("[?]");
 128     } else if (o == NULL) {
 129       st->print("[_]");
 130     } else {


< prev index next >