Request for review (M): 6998541: JSR 292 implement missing return-type conversion for OP_RETYPE_RAW
john.r.rose at oracle.com
Wed May 11 09:12:26 PDT 2011
On May 11, 2011, at 8:36 AM, Tom Rodriguez wrote:
> This doesn't seem right. 2 becomes false but 1 becomes true?
JSR 292 weirdness; see javadoc for explicitCastArguments:
> If T0 and T1 are primitives and one is boolean, the boolean is treated as a one-bit unsigned integer. (This treatment follows the usage of the bytecode verifier.) A conversion from another primitive type behaves as if it first converts to byte, and then masks all but the low bit.
Easier and more stable to check the low bit than remember the original length of the scalar and take all the bits into account. Otherwise long->int->boolean does something different than long->short->boolean.
More information about the hotspot-compiler-dev