src/hotspot/share/opto/node.cpp
changeset 58285 1182ff8929cc
parent 57722 8e51da27b53a
child 58516 d376d86b0a01
equal deleted inserted replaced
58284:59f7c242ccb8 58285:1182ff8929cc
   702     if( _in[i] != NULL )
   702     if( _in[i] != NULL )
   703       return false;
   703       return false;
   704   dump();
   704   dump();
   705   return true;
   705   return true;
   706 }
   706 }
   707 #endif
   707 
   708 
   708 bool Node::is_reachable_from_root() const {
       
   709   ResourceMark rm;
       
   710   Unique_Node_List wq;
       
   711   wq.push((Node*)this);
       
   712   RootNode* root = Compile::current()->root();
       
   713   for (uint i = 0; i < wq.size(); i++) {
       
   714     Node* m = wq.at(i);
       
   715     if (m == root) {
       
   716       return true;
       
   717     }
       
   718     for (DUIterator_Fast jmax, j = m->fast_outs(jmax); j < jmax; j++) {
       
   719       Node* u = m->fast_out(j);
       
   720       wq.push(u);
       
   721     }
       
   722   }
       
   723   return false;
       
   724 }
       
   725 #endif
   709 
   726 
   710 //------------------------------is_unreachable---------------------------------
   727 //------------------------------is_unreachable---------------------------------
   711 bool Node::is_unreachable(PhaseIterGVN &igvn) const {
   728 bool Node::is_unreachable(PhaseIterGVN &igvn) const {
   712   assert(!is_Mach(), "doesn't work with MachNodes");
   729   assert(!is_Mach(), "doesn't work with MachNodes");
   713   return outcnt() == 0 || igvn.type(this) == Type::TOP || (in(0) != NULL && in(0)->is_top());
   730   return outcnt() == 0 || igvn.type(this) == Type::TOP || (in(0) != NULL && in(0)->is_top());