[code-reflection] RFR: Bitwise complement op

Paul Sandoz psandoz at openjdk.org
Thu Aug 15 16:50:19 UTC 2024


On Wed, 14 Aug 2024 23:00:12 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Lowering `~x` to bytecode generates the equivalent of `x ^ -1`, so the first lift and generation cycle will result in different bytecode.
>
> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 586:
> 
>> 584:                         processFirstOperand(op);
>> 585:                         switch (rvt) {
>> 586:                             case IntType, BooleanType, ByteType, ShortType, CharType -> {
> 
> Do we intend to support boolean even though JLS doesn't allow complement `~` on boolean values?

I observed that too, but decided to copy the same pattern as used else where. @asotona will know more.

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/216#discussion_r1718689779


More information about the babylon-dev mailing list