src/share/vm/opto/memnode.cpp

changeset 628
44a553b2809d
parent 604
9148c65abefc
child 631
d1605aabd0a1
child 656
1e026f8da827
     1.1 --- a/src/share/vm/opto/memnode.cpp	Fri Jun 13 14:49:07 2008 -0700
     1.2 +++ b/src/share/vm/opto/memnode.cpp	Fri Jun 13 15:08:56 2008 -0700
     1.3 @@ -253,11 +253,17 @@
     1.4    if (dom == NULL || dom->is_top() || sub == NULL || sub->is_top())
     1.5      return false; // Conservative answer for dead code
     1.6  
     1.7 -  // Check 'dom'.
     1.8 +  // Check 'dom'. Skip Proj and CatchProj nodes.
     1.9    dom = dom->find_exact_control(dom);
    1.10    if (dom == NULL || dom->is_top())
    1.11      return false; // Conservative answer for dead code
    1.12  
    1.13 +  if (dom == sub) {
    1.14 +    // For the case when, for example, 'sub' is Initialize and the original
    1.15 +    // 'dom' is Proj node of the 'sub'.
    1.16 +    return false;
    1.17 +  }
    1.18 +
    1.19    if (dom->is_Con() || dom->is_Start() || dom->is_Root() || dom == sub)
    1.20      return true;
    1.21  
    1.22 @@ -271,6 +277,7 @@
    1.23           sub->is_Region(), "expecting only these nodes");
    1.24  
    1.25    // Get control edge of 'sub'.
    1.26 +  Node* orig_sub = sub;
    1.27    sub = sub->find_exact_control(sub->in(0));
    1.28    if (sub == NULL || sub->is_top())
    1.29      return false; // Conservative answer for dead code
    1.30 @@ -296,14 +303,16 @@
    1.31  
    1.32      for (uint next = 0; next < dom_list.size(); next++) {
    1.33        Node* n = dom_list.at(next);
    1.34 +      if (n == orig_sub)
    1.35 +        return false; // One of dom's inputs dominated by sub.
    1.36        if (!n->is_CFG() && n->pinned()) {
    1.37          // Check only own control edge for pinned non-control nodes.
    1.38          n = n->find_exact_control(n->in(0));
    1.39          if (n == NULL || n->is_top())
    1.40            return false; // Conservative answer for dead code
    1.41          assert(n->is_CFG(), "expecting control");
    1.42 -      }
    1.43 -      if (n->is_Con() || n->is_Start() || n->is_Root()) {
    1.44 +        dom_list.push(n);
    1.45 +      } else if (n->is_Con() || n->is_Start() || n->is_Root()) {
    1.46          only_dominating_controls = true;
    1.47        } else if (n->is_CFG()) {
    1.48          if (n->dominates(sub, nlist))

mercurial