comparison src/share/vm/opto/lcm.cpp @ 7196:2aff40cb4703

7092905: C2: Keep track of the number of dead nodes Summary: keep an (almost) accurate running count of the reachable (live) flow graph nodes. Reviewed-by: kvn, twisti, jrose, vlivanov
author bharadwaj
date Tue, 27 Nov 2012 17:24:15 -0800
parents 8e47bac5643a
children b30b3c2a0cf2
comparison
equal deleted inserted replaced
7195:2cd5e15048e6 7196:2aff40cb4703
1004 } 1004 }
1005 1005
1006 //------------------------------call_catch_cleanup----------------------------- 1006 //------------------------------call_catch_cleanup-----------------------------
1007 // If we inserted any instructions between a Call and his CatchNode, 1007 // If we inserted any instructions between a Call and his CatchNode,
1008 // clone the instructions on all paths below the Catch. 1008 // clone the instructions on all paths below the Catch.
1009 void Block::call_catch_cleanup(Block_Array &bbs) { 1009 void Block::call_catch_cleanup(Block_Array &bbs, Compile* C) {
1010 1010
1011 // End of region to clone 1011 // End of region to clone
1012 uint end = end_idx(); 1012 uint end = end_idx();
1013 if( !_nodes[end]->is_Catch() ) return; 1013 if( !_nodes[end]->is_Catch() ) return;
1014 // Start of region to clone 1014 // Start of region to clone
1066 1066
1067 } // End of for all Nodes in cloned area 1067 } // End of for all Nodes in cloned area
1068 1068
1069 // Remove the now-dead cloned ops 1069 // Remove the now-dead cloned ops
1070 for(uint i3 = beg; i3 < end; i3++ ) { 1070 for(uint i3 = beg; i3 < end; i3++ ) {
1071 _nodes[beg]->disconnect_inputs(NULL); 1071 _nodes[beg]->disconnect_inputs(NULL, C);
1072 _nodes.remove(beg); 1072 _nodes.remove(beg);
1073 } 1073 }
1074 1074
1075 // If the successor blocks have a CreateEx node, move it back to the top 1075 // If the successor blocks have a CreateEx node, move it back to the top
1076 for(uint i4 = 0; i4 < _num_succs; i4++ ) { 1076 for(uint i4 = 0; i4 < _num_succs; i4++ ) {
1079 // Remove any newly created, but dead, nodes. 1079 // Remove any newly created, but dead, nodes.
1080 for( uint j = new_cnt; j > 0; j-- ) { 1080 for( uint j = new_cnt; j > 0; j-- ) {
1081 Node *n = sb->_nodes[j]; 1081 Node *n = sb->_nodes[j];
1082 if (n->outcnt() == 0 && 1082 if (n->outcnt() == 0 &&
1083 (!n->is_Proj() || n->as_Proj()->in(0)->outcnt() == 1) ){ 1083 (!n->is_Proj() || n->as_Proj()->in(0)->outcnt() == 1) ){
1084 n->disconnect_inputs(NULL); 1084 n->disconnect_inputs(NULL, C);
1085 sb->_nodes.remove(j); 1085 sb->_nodes.remove(j);
1086 new_cnt--; 1086 new_cnt--;
1087 } 1087 }
1088 } 1088 }
1089 // If any newly created nodes remain, move the CreateEx node to the top 1089 // If any newly created nodes remain, move the CreateEx node to the top