1276
1277 // End of region to clone
1278 uint end = block->end_idx();
1279 if( !block->get_node(end)->is_Catch() ) return;
1280 // Start of region to clone
1281 uint beg = end;
1282 while(!block->get_node(beg-1)->is_MachProj() ||
1283 !block->get_node(beg-1)->in(0)->is_MachCall() ) {
1284 beg--;
1285 assert(beg > 0,"Catch cleanup walking beyond block boundary");
1286 }
1287 // Range of inserted instructions is [beg, end)
1288 if( beg == end ) return;
1289
1290 // Clone along all Catch output paths. Clone area between the 'beg' and
1291 // 'end' indices.
1292 for( uint i = 0; i < block->_num_succs; i++ ) {
1293 Block *sb = block->_succs[i];
1294 // Clone the entire area; ignoring the edge fixup for now.
1295 for( uint j = end; j > beg; j-- ) {
1296 // It is safe here to clone a node with anti_dependence
1297 // since clones dominate on each path.
1298 Node *clone = block->get_node(j-1)->clone();
1299 sb->insert_node(clone, 1);
1300 map_node_to_block(clone, sb);
1301 }
1302 }
1303
1304
1305 // Fixup edges. Check the def-use info per cloned Node
1306 for(uint i2 = beg; i2 < end; i2++ ) {
1307 uint n_clone_idx = i2-beg+1; // Index of clone of n in each successor block
1308 Node *n = block->get_node(i2); // Node that got cloned
1309 // Need DU safe iterator because of edge manipulation in calls.
1310 Unique_Node_List *out = new Unique_Node_List(Thread::current()->resource_area());
1311 for (DUIterator_Fast j1max, j1 = n->fast_outs(j1max); j1 < j1max; j1++) {
1312 out->push(n->fast_out(j1));
1313 }
1314 uint max = out->size();
1315 for (uint j = 0; j < max; j++) {// For all users
1316 Node *use = out->pop();
1317 Block *buse = get_block_for_node(use);
1318 if( use->is_Phi() ) {
1319 for( uint k = 1; k < use->req(); k++ )
1320 if( use->in(k) == n ) {
|
1276
1277 // End of region to clone
1278 uint end = block->end_idx();
1279 if( !block->get_node(end)->is_Catch() ) return;
1280 // Start of region to clone
1281 uint beg = end;
1282 while(!block->get_node(beg-1)->is_MachProj() ||
1283 !block->get_node(beg-1)->in(0)->is_MachCall() ) {
1284 beg--;
1285 assert(beg > 0,"Catch cleanup walking beyond block boundary");
1286 }
1287 // Range of inserted instructions is [beg, end)
1288 if( beg == end ) return;
1289
1290 // Clone along all Catch output paths. Clone area between the 'beg' and
1291 // 'end' indices.
1292 for( uint i = 0; i < block->_num_succs; i++ ) {
1293 Block *sb = block->_succs[i];
1294 // Clone the entire area; ignoring the edge fixup for now.
1295 for( uint j = end; j > beg; j-- ) {
1296 Node *clone = block->get_node(j-1)->clone();
1297 sb->insert_node(clone, 1);
1298 map_node_to_block(clone, sb);
1299 if (clone->needs_anti_dependence_check()) {
1300 insert_anti_dependences(sb, clone);
1301 }
1302 }
1303 }
1304
1305
1306 // Fixup edges. Check the def-use info per cloned Node
1307 for(uint i2 = beg; i2 < end; i2++ ) {
1308 uint n_clone_idx = i2-beg+1; // Index of clone of n in each successor block
1309 Node *n = block->get_node(i2); // Node that got cloned
1310 // Need DU safe iterator because of edge manipulation in calls.
1311 Unique_Node_List *out = new Unique_Node_List(Thread::current()->resource_area());
1312 for (DUIterator_Fast j1max, j1 = n->fast_outs(j1max); j1 < j1max; j1++) {
1313 out->push(n->fast_out(j1));
1314 }
1315 uint max = out->size();
1316 for (uint j = 0; j < max; j++) {// For all users
1317 Node *use = out->pop();
1318 Block *buse = get_block_for_node(use);
1319 if( use->is_Phi() ) {
1320 for( uint k = 1; k < use->req(); k++ )
1321 if( use->in(k) == n ) {
|