Skip to content

Commit 6a51139

Browse files
author
duke
committed
Backport ddf326b8e6e50403303b410635e4c26d7bf56aaa
1 parent c83786b commit 6a51139

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hotspot/share/opto/block.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,8 @@ void PhaseBlockLayout::find_edges() {
16111611
Block *target = b->non_connector_successor(j);
16121612
float freq = b->_freq * b->succ_prob(j);
16131613
int from_pct = (int) ((100 * freq) / b->_freq);
1614-
int to_pct = (int) ((100 * freq) / target->_freq);
1614+
float f_to_pct = (100 * freq) / target->_freq;
1615+
int to_pct = (f_to_pct < 100.0) ? (int)f_to_pct : 100;
16151616
edges->append(new CFGEdge(b, target, freq, from_pct, to_pct));
16161617
}
16171618
}

0 commit comments

Comments
 (0)