Request for review (M): 6998541: JSR 292 implement missing return-type conversion for OP_RETYPE_RAW
Tom Rodriguez
tom.rodriguez at oracle.com
Wed May 11 09:24:12 PDT 2011
On May 11, 2011, at 9:12 AM, John Rose wrote:
> 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:
Very weird but ok.
tom
>
>> 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.
>
> http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm-old/2011-0510/java/lang/invoke/MethodHandles.html
>
> 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.
>
> -- John
More information about the hotspot-compiler-dev
mailing list