src/share/vm/opto/graphKit.cpp

changeset 2141
f9883ee8ce39
parent 2103
3e8fbc61cee8
child 2307
f264f4c42799
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Tue Sep 07 11:31:27 2010 -0700
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Wed Sep 08 20:28:57 2010 -0700
     1.3 @@ -1739,6 +1739,7 @@
     1.4    C->gvn_replace_by(callprojs.fallthrough_catchproj, final_state->in(TypeFunc::Control));
     1.5    C->gvn_replace_by(callprojs.fallthrough_memproj,   final_state->in(TypeFunc::Memory));
     1.6    C->gvn_replace_by(callprojs.fallthrough_ioproj,    final_state->in(TypeFunc::I_O));
     1.7 +  Node* final_mem = final_state->in(TypeFunc::Memory);
     1.8  
     1.9    // Replace the result with the new result if it exists and is used
    1.10    if (callprojs.resproj != NULL && result != NULL) {
    1.11 @@ -1776,6 +1777,21 @@
    1.12    // Disconnect the call from the graph
    1.13    call->disconnect_inputs(NULL);
    1.14    C->gvn_replace_by(call, C->top());
    1.15 +
    1.16 +  // Clean up any MergeMems that feed other MergeMems since the
    1.17 +  // optimizer doesn't like that.
    1.18 +  if (final_mem->is_MergeMem()) {
    1.19 +    Node_List wl;
    1.20 +    for (SimpleDUIterator i(final_mem); i.has_next(); i.next()) {
    1.21 +      Node* m = i.get();
    1.22 +      if (m->is_MergeMem() && !wl.contains(m)) {
    1.23 +        wl.push(m);
    1.24 +      }
    1.25 +    }
    1.26 +    while (wl.size()  > 0) {
    1.27 +      _gvn.transform(wl.pop());
    1.28 +    }
    1.29 +  }
    1.30  }
    1.31  
    1.32  

mercurial