src/share/vm/opto/compile.cpp

changeset 1989
60a14ad85270
parent 1964
4311f23817fd
child 2040
0e35fa8ebccd
     1.1 --- a/src/share/vm/opto/compile.cpp	Fri Jul 02 15:01:47 2010 -0700
     1.2 +++ b/src/share/vm/opto/compile.cpp	Fri Jul 02 17:30:30 2010 -0700
     1.3 @@ -637,34 +637,6 @@
     1.4    if (failing())  return;
     1.5    NOT_PRODUCT( verify_graph_edges(); )
     1.6  
     1.7 -  // Perform escape analysis
     1.8 -  if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) {
     1.9 -    TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
    1.10 -    // Add ConP#NULL and ConN#NULL nodes before ConnectionGraph construction.
    1.11 -    PhaseGVN* igvn = initial_gvn();
    1.12 -    Node* oop_null = igvn->zerocon(T_OBJECT);
    1.13 -    Node* noop_null = igvn->zerocon(T_NARROWOOP);
    1.14 -
    1.15 -    _congraph = new(comp_arena()) ConnectionGraph(this);
    1.16 -    bool has_non_escaping_obj = _congraph->compute_escape();
    1.17 -
    1.18 -#ifndef PRODUCT
    1.19 -    if (PrintEscapeAnalysis) {
    1.20 -      _congraph->dump();
    1.21 -    }
    1.22 -#endif
    1.23 -    // Cleanup.
    1.24 -    if (oop_null->outcnt() == 0)
    1.25 -      igvn->hash_delete(oop_null);
    1.26 -    if (noop_null->outcnt() == 0)
    1.27 -      igvn->hash_delete(noop_null);
    1.28 -
    1.29 -    if (!has_non_escaping_obj) {
    1.30 -      _congraph = NULL;
    1.31 -    }
    1.32 -
    1.33 -    if (failing())  return;
    1.34 -  }
    1.35    // Now optimize
    1.36    Optimize();
    1.37    if (failing())  return;
    1.38 @@ -1601,6 +1573,20 @@
    1.39  
    1.40    if (failing())  return;
    1.41  
    1.42 +  // Perform escape analysis
    1.43 +  if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) {
    1.44 +    TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
    1.45 +    ConnectionGraph::do_analysis(this, &igvn);
    1.46 +
    1.47 +    if (failing())  return;
    1.48 +
    1.49 +    igvn.optimize();
    1.50 +    print_method("Iter GVN 3", 2);
    1.51 +
    1.52 +    if (failing())  return;
    1.53 +
    1.54 +  }
    1.55 +
    1.56    // Loop transforms on the ideal graph.  Range Check Elimination,
    1.57    // peeling, unrolling, etc.
    1.58  

mercurial