RFR: 8346107: Generators: testing utility for random value generation
theoweidmannoracle
duke at openjdk.org
Wed Dec 18 11:48:37 UTC 2024
On Wed, 18 Dec 2024 10:29:38 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/lib/generators/SpecialDoubleGenerator.java line 32:
>>
>>> 30: * Provide a double distribution picked from a list of special values, including NaN, zero, int, etc.
>>> 31: */
>>> 32: public final class SpecialDoubleGenerator extends DoubleGenerator {
>>
>> Same as for MixedLong/IntGenerator: Special*Generator could share common logic in a superclass if Double/FloatGenerator are interfaces.
>
> Again: I'm not sure if doing this with more complicated and more generic code is really easier than a bit of code duplication. Not that I'm in general an advocate for code duplication 🙈 😅
What I'm thinking of doesn't involve any generics. I'm talking about specialMinFrequency, specialMaxFrequency, specialCountDown and the logic in next* to decide whether to provide a special value or not now. This is independent from whether float or double is used, as far as I can tell.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22716#discussion_r1890107018
More information about the hotspot-compiler-dev
mailing list