Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8066312

Add new Node* Node::find_out(int opc) method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • b49
    • generic
    • generic

        We have a lot places which search for particular user node:

            Node* xorx = NULL;
            for (DUIterator_Fast imax, i = p2x->fast_outs(imax); i < imax; i++) {
              Node* u = p2x->fast_out(i);
              if (u->Opcode() == Op_XorX) {
                xorx = u;
                break;
              }
            }

              for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
                Node *use = n->fast_out(i);
                if (use->Opcode() == Op_SCMemProj) {
                  n = use;
                  break;
                }
              }

        bool LoadStoreNode::result_not_used() const {
          for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
            Node *x = fast_out(i);
            if (x->Opcode() == Op_SCMemProj) continue;
            return false;
          }
          return true;
        }

              uint cnt = def->outcnt();
              for (uint i = 0; i < cnt; i++) {
                Node* proj = def->raw_out(i);
                if (proj->Opcode() == Op_SCMemProj) {
                  return false;
                }
              }


        and so on.

        Add new Node* Node::find_user(int opc) method to be used in such cases.

              zmajo Zoltan Majo (Inactive)
              kvn Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: