RFR: 8339192: Native annotation parsing code of deprecated annotations causes crash [v2]
David Holmes
dholmes at openjdk.org
Tue Sep 17 06:05:05 UTC 2024
On Tue, 17 Sep 2024 05:51:56 GMT, Chen Liang <liach at openjdk.org> wrote:
>> This is pre-existing code. As far as I am aware we will always encode booleans as either 1 or 0 in a `CONSTANT_Integer` in the CP. The JVMS doesn't clearly specify this, except for boolean arrays, but it is what our tools do.
>
> jvms specifies the convention of 1 for true and 0 for false. We can technically ignore other values, but in instructions like bastore it takes a bitwise and per jvms.
Also I'm not clear what encoding you are envisaging as the "normal" C based encoding would be zero == false and anything else is true - but that doesn't map to using `& 1`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21030#discussion_r1762397137
More information about the hotspot-runtime-dev
mailing list