In C++, the result of an overflowing cast to a signed integer is
undefined. The functions used to implement f2i, f2l, d2i and d2l,
however, rely on the assumption that the result of an overflowing
cast will be the largest magnitude number with the correct sign.
Replaces SharedRuntime::f2i et al with versions that should work
regardless of the compiler, operating system, or CPU architecture.
Added the test provided for 6779290 (closed as duplicate of this one).
Reviewed by: never
Contributed by: ###@###.###
Fix verified (y/n): y, provided test.