indy-based string-switch proposal

Joe Darcy joe.darcy at oracle.com
Tue Nov 5 21:31:05 UTC 2019


On 11/5/2019 1:25 AM, forax at univ-mlv.fr wrote:
> ----- Mail original -----
>> De: "Brian Goetz" <brian.goetz at oracle.com>
>> À: "JARvis PROgrammer" <mrjarviscraft at gmail.com>
>> Cc: "Remi Forax" <forax at univ-mlv.fr>, "amber-dev" <amber-dev at openjdk.java.net>
>> Envoyé: Mardi 5 Novembre 2019 10:06:38
>> Objet: Re: indy-based string-switch proposal
>> So, a good next step is to put in place some measurement of switch cost using
>> different translations.  We can start by comparing old and new, and then can
>> experiment with alternate bootstrap implementations (such as other has codes).
>>
>> Note that we want to use this technique for all switches except those over int
>> and smaller.  This includes not only string and enum, but long and float, and
>> patterns.
> Switching on floats and doubles is a weird idea for me.


Switching over floats and doubles is perfectly well-defined. There are 
precise sets of representable values for each type, the finite values 
are a subset of the Dyadic rationals 
(https://en.wikipedia.org/wiki/Dyadic_rational), and numerical 
algorithms will often test for special-case values before going off to 
more general code.

-Joe




More information about the amber-dev mailing list