1.1 --- a/src/share/vm/opto/compile.cpp Wed Nov 09 06:14:32 2011 -0800 1.2 +++ b/src/share/vm/opto/compile.cpp Wed Nov 09 07:25:51 2011 -0800 1.3 @@ -346,15 +346,15 @@ 1.4 // Disconnect all useless nodes by disconnecting those at the boundary. 1.5 void Compile::remove_useless_nodes(Unique_Node_List &useful) { 1.6 uint next = 0; 1.7 - while( next < useful.size() ) { 1.8 + while (next < useful.size()) { 1.9 Node *n = useful.at(next++); 1.10 // Use raw traversal of out edges since this code removes out edges 1.11 int max = n->outcnt(); 1.12 - for (int j = 0; j < max; ++j ) { 1.13 + for (int j = 0; j < max; ++j) { 1.14 Node* child = n->raw_out(j); 1.15 - if( ! useful.member(child) ) { 1.16 - assert( !child->is_top() || child != top(), 1.17 - "If top is cached in Compile object it is in useful list"); 1.18 + if (! useful.member(child)) { 1.19 + assert(!child->is_top() || child != top(), 1.20 + "If top is cached in Compile object it is in useful list"); 1.21 // Only need to remove this out-edge to the useless node 1.22 n->raw_del_out(j); 1.23 --j; 1.24 @@ -362,7 +362,14 @@ 1.25 } 1.26 } 1.27 if (n->outcnt() == 1 && n->has_special_unique_user()) { 1.28 - record_for_igvn( n->unique_out() ); 1.29 + record_for_igvn(n->unique_out()); 1.30 + } 1.31 + } 1.32 + // Remove useless macro and predicate opaq nodes 1.33 + for (int i = C->macro_count()-1; i >= 0; i--) { 1.34 + Node* n = C->macro_node(i); 1.35 + if (!useful.member(n)) { 1.36 + remove_macro_node(n); 1.37 } 1.38 } 1.39 debug_only(verify_graph_edges(true/*check for no_dead_code*/);) 1.40 @@ -719,6 +726,7 @@ 1.41 while (_late_inlines.length() > 0) { 1.42 CallGenerator* cg = _late_inlines.pop(); 1.43 cg->do_late_inline(); 1.44 + if (failing()) return; 1.45 } 1.46 } 1.47 assert(_late_inlines.length() == 0, "should have been processed"); 1.48 @@ -1691,13 +1699,20 @@ 1.49 1.50 // Perform escape analysis 1.51 if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) { 1.52 + if (has_loops()) { 1.53 + // Cleanup graph (remove dead nodes). 1.54 + TracePhase t2("idealLoop", &_t_idealLoop, true); 1.55 + PhaseIdealLoop ideal_loop( igvn, false, true ); 1.56 + if (major_progress()) print_method("PhaseIdealLoop before EA", 2); 1.57 + if (failing()) return; 1.58 + } 1.59 TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true); 1.60 ConnectionGraph::do_analysis(this, &igvn); 1.61 1.62 if (failing()) return; 1.63 1.64 igvn.optimize(); 1.65 - print_method("Iter GVN 3", 2); 1.66 + print_method("Iter GVN after EA", 2); 1.67 1.68 if (failing()) return; 1.69