src/share/vm/opto/escape.cpp

changeset 1286
fc4be448891f
parent 1219
b2934faac289
child 1301
18f526145aea
     1.1 --- a/src/share/vm/opto/escape.cpp	Wed Jul 15 13:37:35 2009 -0700
     1.2 +++ b/src/share/vm/opto/escape.cpp	Thu Jul 16 14:10:42 2009 -0700
     1.3 @@ -578,11 +578,24 @@
     1.4    if (phi_alias_idx == alias_idx) {
     1.5      return orig_phi;
     1.6    }
     1.7 -  // have we already created a Phi for this alias index?
     1.8 +  // Have we recently created a Phi for this alias index?
     1.9    PhiNode *result = get_map_phi(orig_phi->_idx);
    1.10    if (result != NULL && C->get_alias_index(result->adr_type()) == alias_idx) {
    1.11      return result;
    1.12    }
    1.13 +  // Previous check may fail when the same wide memory Phi was split into Phis
    1.14 +  // for different memory slices. Search all Phis for this region.
    1.15 +  if (result != NULL) {
    1.16 +    Node* region = orig_phi->in(0);
    1.17 +    for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
    1.18 +      Node* phi = region->fast_out(i);
    1.19 +      if (phi->is_Phi() &&
    1.20 +          C->get_alias_index(phi->as_Phi()->adr_type()) == alias_idx) {
    1.21 +        assert(phi->_idx >= nodes_size(), "only new Phi per instance memory slice");
    1.22 +        return phi->as_Phi();
    1.23 +      }
    1.24 +    }
    1.25 +  }
    1.26    if ((int)C->unique() + 2*NodeLimitFudgeFactor > MaxNodeLimit) {
    1.27      if (C->do_escape_analysis() == true && !C->failing()) {
    1.28        // Retry compilation without escape analysis.
    1.29 @@ -595,6 +608,7 @@
    1.30    orig_phi_worklist.append_if_missing(orig_phi);
    1.31    const TypePtr *atype = C->get_adr_type(alias_idx);
    1.32    result = PhiNode::make(orig_phi->in(0), NULL, Type::MEMORY, atype);
    1.33 +  C->copy_node_notes_to(result, orig_phi);
    1.34    set_map_phi(orig_phi->_idx, result);
    1.35    igvn->set_type(result, result->bottom_type());
    1.36    record_for_optimizer(result);

mercurial