< prev index next >

src/share/vm/opto/block.cpp

Print this page
rev 11179 : 8140594: Various minor code improvements (compiler)
Reviewed-by: thartmann


1413     // All connector blocks should be at the end of the list
1414     if (b->is_connector()) break;
1415 
1416     // If this block and the next one have a one-to-one successor
1417     // predecessor relationship, simply append the next block
1418     int nfallthru = b->num_fall_throughs();
1419     while (nfallthru == 1 &&
1420            b->succ_fall_through(0)) {
1421       Block *n = b->_succs[0];
1422 
1423       // Skip over single-entry connector blocks, we don't want to
1424       // add them to the trace.
1425       while (n->is_connector() && n->num_preds() == 1) {
1426         n = n->_succs[0];
1427       }
1428 
1429       // We see a merge point, so stop search for the next block
1430       if (n->num_preds() != 1) break;
1431 
1432       i++;
1433       assert(n = _cfg.get_block(i), "expecting next block");
1434       tr->append(n);
1435       uf->map(n->_pre_order, tr->id());
1436       traces[n->_pre_order] = NULL;
1437       nfallthru = b->num_fall_throughs();
1438       b = n;
1439     }
1440 
1441     if (nfallthru > 0) {
1442       // Create a CFGEdge for each outgoing
1443       // edge that could be a fall-through.
1444       for (uint j = 0; j < b->_num_succs; j++ ) {
1445         if (b->succ_fall_through(j)) {
1446           Block *target = b->non_connector_successor(j);
1447           float freq = b->_freq * b->succ_prob(j);
1448           int from_pct = (int) ((100 * freq) / b->_freq);
1449           int to_pct = (int) ((100 * freq) / target->_freq);
1450           edges->append(new CFGEdge(b, target, freq, from_pct, to_pct));
1451         }
1452       }
1453     }




1413     // All connector blocks should be at the end of the list
1414     if (b->is_connector()) break;
1415 
1416     // If this block and the next one have a one-to-one successor
1417     // predecessor relationship, simply append the next block
1418     int nfallthru = b->num_fall_throughs();
1419     while (nfallthru == 1 &&
1420            b->succ_fall_through(0)) {
1421       Block *n = b->_succs[0];
1422 
1423       // Skip over single-entry connector blocks, we don't want to
1424       // add them to the trace.
1425       while (n->is_connector() && n->num_preds() == 1) {
1426         n = n->_succs[0];
1427       }
1428 
1429       // We see a merge point, so stop search for the next block
1430       if (n->num_preds() != 1) break;
1431 
1432       i++;
1433       assert(n == _cfg.get_block(i), "expecting next block");
1434       tr->append(n);
1435       uf->map(n->_pre_order, tr->id());
1436       traces[n->_pre_order] = NULL;
1437       nfallthru = b->num_fall_throughs();
1438       b = n;
1439     }
1440 
1441     if (nfallthru > 0) {
1442       // Create a CFGEdge for each outgoing
1443       // edge that could be a fall-through.
1444       for (uint j = 0; j < b->_num_succs; j++ ) {
1445         if (b->succ_fall_through(j)) {
1446           Block *target = b->non_connector_successor(j);
1447           float freq = b->_freq * b->succ_prob(j);
1448           int from_pct = (int) ((100 * freq) / b->_freq);
1449           int to_pct = (int) ((100 * freq) / target->_freq);
1450           edges->append(new CFGEdge(b, target, freq, from_pct, to_pct));
1451         }
1452       }
1453     }


< prev index next >