--- a/hotspot/src/share/vm/opto/compile.cpp Fri Jul 02 15:01:47 2010 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp Fri Jul 02 17:30:30 2010 -0700
@@ -637,34 +637,6 @@
if (failing()) return;
NOT_PRODUCT( verify_graph_edges(); )
- // Perform escape analysis
- if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) {
- TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
- // Add ConP#NULL and ConN#NULL nodes before ConnectionGraph construction.
- PhaseGVN* igvn = initial_gvn();
- Node* oop_null = igvn->zerocon(T_OBJECT);
- Node* noop_null = igvn->zerocon(T_NARROWOOP);
-
- _congraph = new(comp_arena()) ConnectionGraph(this);
- bool has_non_escaping_obj = _congraph->compute_escape();
-
-#ifndef PRODUCT
- if (PrintEscapeAnalysis) {
- _congraph->dump();
- }
-#endif
- // Cleanup.
- if (oop_null->outcnt() == 0)
- igvn->hash_delete(oop_null);
- if (noop_null->outcnt() == 0)
- igvn->hash_delete(noop_null);
-
- if (!has_non_escaping_obj) {
- _congraph = NULL;
- }
-
- if (failing()) return;
- }
// Now optimize
Optimize();
if (failing()) return;
@@ -1601,6 +1573,20 @@
if (failing()) return;
+ // Perform escape analysis
+ if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) {
+ TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
+ ConnectionGraph::do_analysis(this, &igvn);
+
+ if (failing()) return;
+
+ igvn.optimize();
+ print_method("Iter GVN 3", 2);
+
+ if (failing()) return;
+
+ }
+
// Loop transforms on the ideal graph. Range Check Elimination,
// peeling, unrolling, etc.