FRF: 8033792: AltHashing used jint for imprecise bit shifting
david.holmes at oracle.com
Thu Feb 6 23:47:59 PST 2014
On 7/02/2014 2:14 PM, Yumin Qi wrote:
> Please review the change for 8033792.
> Summary: AltHashing uses 'jint' type in the way as 'unsigned int' in
> bit shifting, which is imprecise. This could lead loss of precision
> when converted between jint and 'unsigned int' during bit operation. Fix
> by changing operation variable type from 'jint' to 'juint', before
> return, cast it into type 'jint'.
I don't see how casting to unsigned int can lead to a loss of precision
here. Further you now assign h1 from a jint and you pass it as a jint
parameter to the Integer_rotate functions which would seem to me to have
more opportunity for conversion issues. Either way this code is
completely confused about the type of arithmetic it is trying to do (and
I would think a hash should be unsigned to begin with ??).
You didn't mention the unrelated change in
More information about the hotspot-runtime-dev