[patterns-instanceof-primitive] RFR: 8303374: Compiler Implementation for Primitive types in patterns, instanceof, and switch [v2]

Raffaello Giulietti rgiulietti at openjdk.org
Fri Mar 10 17:36:40 UTC 2023


On Fri, 10 Mar 2023 17:16:51 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update int_float, long_float, long_double
>>   
>>   Co-authored-by: Angelos Bimpoudis <angelos.bimpoudis at oracle.com>
>>   Co-authored-by: Raffaello Giulietti <raffaello.giulietti at oracle.com>
>
> src/java.base/share/classes/java/lang/runtime/ExactnessMethods.java line 38:
> 
>> 36: 
>> 37:     private ExactnessMethods() { }
>> 38: 
> 
> Suggestion:
> 
>     public static boolean isNegativeZero(float n) {
>         return Float.floatToIntRawBits(n) == Integer.MIN_VALUE;
>     }
> 
>     public static boolean isNegativeZero(double n) {
>         return Double.doubleToRawLongBits(n) == Long.MIN_VALUE;
>     }

These will be used below, and could be `private` if so preferred.

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

PR: https://git.openjdk.org/amber/pull/91


More information about the amber-dev mailing list