< prev index next >

src/hotspot/share/opto/node.cpp

Print this page




 882   // Node::destruct requires all out edges be deleted first
 883   // debug_only(destruct();)   // no reuse benefit expected
 884   if (edges_to_n == 0) {
 885     C->record_dead_node(_idx);
 886   }
 887   return edges_to_n;
 888 }
 889 
 890 //-----------------------------uncast---------------------------------------
 891 // %%% Temporary, until we sort out CheckCastPP vs. CastPP.
 892 // Strip away casting.  (It is depth-limited.)
 893 Node* Node::uncast() const {
 894   // Should be inline:
 895   //return is_ConstraintCast() ? uncast_helper(this) : (Node*) this;
 896   if (is_ConstraintCast())
 897     return uncast_helper(this);
 898   else
 899     return (Node*) this;
 900 }
 901 
 902 bool Node::eqv_uncast(const Node* n) const {
 903   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
 904   Node* obj1 = bs->step_over_gc_barrier(const_cast<Node*>(this));
 905   Node* obj2 = bs->step_over_gc_barrier(const_cast<Node*>(n));
 906   return (obj1->uncast() == obj2->uncast());
 907 }
 908 
 909 // Find out of current node that matches opcode.
 910 Node* Node::find_out_with(int opcode) {
 911   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 912     Node* use = fast_out(i);
 913     if (use->Opcode() == opcode) {
 914       return use;
 915     }
 916   }
 917   return NULL;
 918 }
 919 
 920 // Return true if the current node has an out that matches opcode.
 921 bool Node::has_out_with(int opcode) {
 922   return (find_out_with(opcode) != NULL);
 923 }
 924 
 925 // Return true if the current node has an out that matches any of the opcodes.
 926 bool Node::has_out_with(int opcode1, int opcode2, int opcode3, int opcode4) {
 927   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 928       int opcode = fast_out(i)->Opcode();




 882   // Node::destruct requires all out edges be deleted first
 883   // debug_only(destruct();)   // no reuse benefit expected
 884   if (edges_to_n == 0) {
 885     C->record_dead_node(_idx);
 886   }
 887   return edges_to_n;
 888 }
 889 
 890 //-----------------------------uncast---------------------------------------
 891 // %%% Temporary, until we sort out CheckCastPP vs. CastPP.
 892 // Strip away casting.  (It is depth-limited.)
 893 Node* Node::uncast() const {
 894   // Should be inline:
 895   //return is_ConstraintCast() ? uncast_helper(this) : (Node*) this;
 896   if (is_ConstraintCast())
 897     return uncast_helper(this);
 898   else
 899     return (Node*) this;
 900 }
 901 







 902 // Find out of current node that matches opcode.
 903 Node* Node::find_out_with(int opcode) {
 904   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 905     Node* use = fast_out(i);
 906     if (use->Opcode() == opcode) {
 907       return use;
 908     }
 909   }
 910   return NULL;
 911 }
 912 
 913 // Return true if the current node has an out that matches opcode.
 914 bool Node::has_out_with(int opcode) {
 915   return (find_out_with(opcode) != NULL);
 916 }
 917 
 918 // Return true if the current node has an out that matches any of the opcodes.
 919 bool Node::has_out_with(int opcode1, int opcode2, int opcode3, int opcode4) {
 920   for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
 921       int opcode = fast_out(i)->Opcode();


< prev index next >