RFR: JDK-8282798 java.lang.runtime.Carrier [v17]
ExE Boss
duke at openjdk.java.net
Tue Mar 29 19:02:43 UTC 2022
On Tue, 29 Mar 2022 15:56:37 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
>> doesn't the compiler (either javac or hotspot) automatically do that?
>
> Yes, the compilers handle this. I did however switch to
>
>
> primitiveCount != 0 ? new long[(primitiveCount + 1) / LONG_SLOTS] : null;
> doesn't the compiler (either javac or hotspot) automatically do that?
Only for multiplication, because `-1 >> 1 == -1`, `-1 >>> 1 == Integer.MAX_VALUE`, and `-1 / 2 == 0`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7744
More information about the core-libs-dev
mailing list