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

Igor Veresov igor.veresov at oracle.com
Wed Apr 13 14:15:41 PDT 2011


Thanks Vladimir and Christian!

igor

On 4/12/11 10:13 PM, Vladimir Kozlov wrote:
> Looks good.
>
> Vladimir
>
> 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: http://cr.openjdk.java.net/~iveresov/6988308/webrev.00/
>>
>> Thanks!
>> igor



More information about the hotspot-compiler-dev mailing list