review(XS): 6988308: assert((cnt > 0.0f) && (prob > 0.0f)) failed: Bad frequency assignment in if

Vladimir Kozlov vladimir.kozlov at
Tue Apr 12 22:13:52 PDT 2011

Looks good.


On 4/12/11 9:37 PM, Igor Veresov wrote:
> The problem can occur in Parse::dynamic_branch_prediction(), where cnt can become negative if the block count is larger
> than max int. This is because the "sum" variable is an int and Block::count() returns uint, which if large enough will
> make "sum" become negative, causing in turn "cnt" to become negative.
> I treated this problem by making the "sum" a float. Also, added guards to detect overflows of "taken" and "not_taken",
> protecting therefore against overflowing an int twice when they are added together.
> Webrev:
> Thanks!
> igor

More information about the hotspot-compiler-dev mailing list