src/share/vm/opto/multnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/multnode.cpp

Print this page
rev 9106 : 8137168: Replace IfNode with a new RangeCheckNode for range checks
Summary: new RangeCheckNode to enable optimization of explicit library level range checks
Reviewed-by:


  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) {
  54         assert(Opcode() != Op_If || proj->Opcode() == (which_proj?Op_IfTrue:Op_IfFalse), "bad if #2");
  55         return proj;
  56       }
  57     } else {
  58       assert(p == this && this->is_Start(), "else must be proj");
  59       continue;
  60     }
  61   }
  62   return NULL;
  63 }
  64 
  65 //=============================================================================
  66 //------------------------------ProjNode---------------------------------------
  67 uint ProjNode::hash() const {
  68   // only one input
  69   return (uintptr_t)in(TypeFunc::Control) + (_con << 1) + (_is_io_use ? 1 : 0);
  70 }
  71 uint ProjNode::cmp( const Node &n ) const { return _con == ((ProjNode&)n)._con && ((ProjNode&)n)._is_io_use == _is_io_use; }
  72 uint ProjNode::size_of() const { return sizeof(ProjNode); }
  73 
  74 // Test if we propagate interesting control along this projection




  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");
  55         return proj;
  56       }
  57     } else {
  58       assert(p == this && this->is_Start(), "else must be proj");
  59       continue;
  60     }
  61   }
  62   return NULL;
  63 }
  64 
  65 //=============================================================================
  66 //------------------------------ProjNode---------------------------------------
  67 uint ProjNode::hash() const {
  68   // only one input
  69   return (uintptr_t)in(TypeFunc::Control) + (_con << 1) + (_is_io_use ? 1 : 0);
  70 }
  71 uint ProjNode::cmp( const Node &n ) const { return _con == ((ProjNode&)n)._con && ((ProjNode&)n)._is_io_use == _is_io_use; }
  72 uint ProjNode::size_of() const { return sizeof(ProjNode); }
  73 
  74 // Test if we propagate interesting control along this projection


src/share/vm/opto/multnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File